Re: [RFC PATCH 3/3] coccinelle: api: add offset_in_page.cocci

2018-12-06 Thread Julia Lawall
On Thu, 6 Dec 2018, Johannes Thumshirn wrote: > On 05/12/2018 15:46, Julia Lawall wrote: > [...] > >> +@r_patch depends on !context && patch && !org && !report@ > >> +expression E; > >> +type T; > >> +@@ > >> +

Re: [RFC PATCH 3/3] coccinelle: api: add offset_in_page.cocci

2018-12-05 Thread Julia Lawall
This unfortunately doesn't account for the case when we want PAGE_ALIGNED() > instead of offset_in_page() yet. > > Cc: Julia Lawall > Signed-off-by: Johannes Thumshirn > --- > scripts/coccinelle/api/offset_in_page.cocci | 81 > + > 1 file chang

[josef-btrfs:btrfs-readdir 4/5] fs/btrfs/ref-verify.c:322:12-14: ERROR: reference preceded by free on line 321 (fwd)

2017-08-31 Thread Julia Lawall
It does not look correct to access >node on line 322 after freeing be on line 321. julia -- Forwarded message -- Date: Fri, 1 Sep 2017 07:41:26 +0800 From: kbuild test robot <fengguang...@intel.com> To: kbu...@01.org Cc: Julia Lawall <julia.law...@lip6.fr>

Re: [PATCH 1/3] btrfs: qgroup: Fix qgroup corruption caused by inode_cache mount option (fwd)

2016-11-28 Thread Julia Lawall
It looks like the tree_log_mutex needs to be unlocked at lines 2153 and 2159. julia -- Forwarded message -- Date: Tue, 29 Nov 2016 14:16:30 +0800 From: kbuild test robot <fengguang...@intel.com> To: kbu...@01.org Cc: Julia Lawall <julia.law...@lip6.fr> Subject: Re

[PATCH 00/39] drop null test before destroy functions

2015-09-13 Thread Julia Lawall
Recent commits to kernel/git/torvalds/linux.git have made the following functions able to tolerate NULL arguments: kmem_cache_destroy (commit 3942d29918522) mempool_destroy (commit 4e3ca3e033d1) dma_pool_destroy (commit 44d7175da6ea) These patches remove the associated NULL tests for the files

[PATCH 06/39] Btrfs: drop null test before destroy functions

2015-09-13 Thread Julia Lawall
Remove unneeded NULL test. The semantic patch that makes this change is as follows: (http://coccinelle.lip6.fr/) // @@ expression x; @@ -if (x != NULL) \(kmem_cache_destroy\|mempool_destroy\|dma_pool_destroy\)(x); // Signed-off-by: Julia Lawall <julia.law...@lip6.fr> --- fs

Re: [btrfs:integration-4.2 29/57] fs/btrfs/disk-io.c:2325:17-30: ERROR: reference preceded by free on line 2324

2015-06-11 Thread Julia Lawall
This does not look correct. Please check. julia On Thu, 11 Jun 2015, kbuild test robot wrote: TO: Liu Bo bo.li@oracle.com CC: Chris Mason chris.ma...@fusionio.com Chris Mason c...@fb.com CC: David Sterba dste...@suse.cz CC: linux-btrfs@vger.kernel.org tree:

Re: [PATCH] fs: btrfs: free-space-cache.c: remove two unnecessary checks before calling kfree()

2015-02-11 Thread Julia Lawall
On Wed, 11 Feb 2015, Bas Peters wrote: kfree checks whether the pointer it is passed is NULL. The two foregoing checks are therefore unnecessary. This issue was detected using Coccinelle. Signed-off-by: Bas Peters baspeter...@gmail.com --- fs/btrfs/free-space-cache.c | 6 ++ 1

Re: [Cocci] [PATCH 1/1] btrfs: Deletion of unnecessary checks before six function calls

2014-10-31 Thread Julia Lawall
On Fri, 31 Oct 2014, SF Markus Elfring wrote: The following functions test whether their argument is NULL and then return immediately. * btrfs_free_path() * free_extent_buffer() * free_extent_map() * free_extent_state() * iput() * kfree() Thus the test around the call is not needed.

merging printk and WARN

2012-11-04 Thread Julia Lawall
It looks like these patches were not a good idea, because in each case the printk provides an error level, and WARN then provides another one. Sorry for the noise. julia -- To unsubscribe from this list: send the line unsubscribe linux-btrfs in the body of a message to

[PATCH 13/16] fs/btrfs: use WARN

2012-11-03 Thread Julia Lawall
From: Julia Lawall julia.law...@lip6.fr Use WARN rather than printk followed by WARN_ON(1), for conciseness. A simplified version of the semantic patch that makes this transformation is as follows: (http://coccinelle.lip6.fr/) // smpl @@ expression list es; @@ -printk( +WARN(1, es); -WARN_ON

[PATCH 1/8] fs/btrfs: drop if around WARN_ON

2012-11-03 Thread Julia Lawall
From: Julia Lawall julia.law...@lip6.fr Just use WARN_ON rather than an if containing only WARN_ON(1). A simplified version of the semantic patch that makes this transformation is as follows: (http://coccinelle.lip6.fr/) // smpl @@ expression e; @@ - if (e) WARN_ON(1); + WARN_ON(e); // /smpl

[PATCH] fs/btrfs/volumes.c: add missing free_fs_devices

2012-04-14 Thread Julia Lawall
From: Julia Lawall julia.law...@lip6.fr Free fs_devices as done in the error-handling code just below. Signed-off-by: Julia Lawall julia.law...@lip6.fr --- fs/btrfs/volumes.c |4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c index

[PATCH 8/11] fs/btrfs/volumes.c: trivial: use BUG_ON

2011-08-02 Thread Julia Lawall
From: Julia Lawall ju...@diku.dk Use BUG_ON(x) rather than if(x) BUG(); The semantic patch that fixes this problem is as follows: (http://coccinelle.lip6.fr/) // smpl @@ identifier x; @@ -if (x) BUG(); +BUG_ON(x); @@ identifier x; @@ -if (!x) BUG(); +BUG_ON(!x); // /smpl Signed-off-by: Julia

Re: [PATCH 3/5] fs/btrfs: Eliminate memory leak

2010-08-25 Thread Julia Lawall
Hi all, I'm really sorry to have spammed your mailbox with my send-email experiments... julia -- To unsubscribe from this list: send the line unsubscribe linux-btrfs in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html

[PATCH 5/16] fs/btrfs: Use available error codes

2010-08-16 Thread Julia Lawall
From: Julia Lawall ju...@diku.dk Error codes are stored in ret, but the return value is always 0. Return ret instead. The semantic match that finds this problem is as follows: (http://coccinelle.lip6.fr/) // smpl @r@ local idexpression x; constant C; @@ if (...) { ... x = -C ... when != x

[PATCH 5/8] fs/btrfs: Use ERR_CAST

2010-05-22 Thread Julia Lawall
From: Julia Lawall ju...@diku.dk Use ERR_CAST(x) rather than ERR_PTR(PTR_ERR(x)). The former makes more clear what is the purpose of the operation, which otherwise looks like a no-op. The semantic patch that makes this change is as follows: (http://coccinelle.lip6.fr/) // smpl @@ type T; T x

[PATCH] fs/btrfs: Correct use after free

2010-03-28 Thread Julia Lawall
From: Julia Lawall ju...@diku.dk If the kfree is executed, the dereference of range afterwards will represent a use after free. Added goto out, as done in the other nearby error handling code. A simplified version of the semantic match that finds this problem is as follows: (http

[PATCH 7/8] fs/btrfs: introduce missing kfree

2009-09-11 Thread Julia Lawall
From: Julia Lawall ju...@diku.dk Error handling code following a kzalloc should free the allocated data. The semantic match that finds the problem is as follows: (http://www.emn.fr/x-info/coccinelle/) // smpl @r exists@ local idexpression x; statement S; expression E; identifier f,f1,l

[PATCH 5/6] fs/btrfs: convert nested spin_lock_irqsave to spin_lock

2009-07-18 Thread Julia Lawall
From: Julia Lawall ju...@diku.dk If spin_lock_irqsave is called twice in a row with the same second argument, the interrupt state at the point of the second call overwrites the value saved by the first call. Indeed, the second call does not need to save the interrupt state, so it is changed

[PATCH 4/4] fs/btrfs: adjust NULL test

2009-07-13 Thread Julia Lawall
From: Julia Lawall ju...@diku.dk Move the call to BUG_ON to before the dereference of the tested value. A simplified version of the semantic match that finds this problem is as follows: (http://www.emn.fr/x-info/coccinelle/) // smpl @r@ expression x,E,E1; identifier f,l; position p1,p2