[PATCH] BTRFS: Don't leak memory in btrfs_get_acl()

2010-12-24 Thread Jesper Juhl
Hi, Currrently we leak memory in btrfs_get_acl::btrfs_get_acl() if posix_acl_from_xattr() fails. With this patch we do not. Signed-off-by: Jesper Juhl j...@chaosbits.net --- acl.c |4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/fs/btrfs/acl.c b/fs/btrfs/acl.c index

Re: [PATCH] BTRFS: Don't leak memory in btrfs_get_acl()

2010-12-25 Thread Jesper Juhl
On Sat, 25 Dec 2010, Mariusz Kozlowski wrote: On Fri, Dec 24, 2010 at 11:45:21PM +0100, Jesper Juhl wrote: Hi, Currrently we leak memory in btrfs_get_acl::btrfs_get_acl() if posix_acl_from_xattr() fails. With this patch we do not. I sent similar patch some time ago but no reply from

[PATCH] btrfs: Don't pass NULL ptr to func that may deref it.

2010-12-25 Thread Jesper Juhl
btrfs_free_path() deal gracefully with NULL pointers. If you disagree, feel free to come up with an alternative patch. Signed-off-by: Jesper Juhl j...@chaosbits.net --- ctree.c |2 ++ 1 file changed, 2 insertions(+) diff --git a/fs/btrfs/ctree.c b/fs/btrfs/ctree.c index 9ac1715..99599f1 100644

[PATCH] btrfs: Mem leak in btrfs_get_acl()

2011-01-06 Thread Jesper Juhl
It seems to me that we leak the memory allocated to 'value' in btrfs_get_acl() if the call to posix_acl_from_xattr() fails. Here's a patch that attempts to correct that problem. Signed-off-by: Jesper Juhl j...@chaosbits.net --- acl.c |4 +++- 1 file changed, 3 insertions(+), 1 deletion

Re: [PATCH] btrfs: Mem leak in btrfs_get_acl()

2011-01-08 Thread Jesper Juhl
On Fri, 7 Jan 2011, Aneesh Kumar K. V wrote: On Thu, 6 Jan 2011 22:45:21 +0100 (CET), Jesper Juhl j...@chaosbits.net wrote: It seems to me that we leak the memory allocated to 'value' in btrfs_get_acl() if the call to posix_acl_from_xattr() fails. Here's a patch that attempts

[PATCH] BTRFS: Fix mem leak in btrfs_submit_direct()

2011-03-13 Thread Jesper Juhl
When memory is low and the allocation for 'dip-csums' fail in fs/btrfs/inode.c:btrfs_submit_direct() we make the situation worse by leaking the memory allocated to 'dip'. This patch removes the leak by kfree()'ing 'dip' before jumping to the 'free_ordered' label. Signed-off-by: Jesper Juhl j

Re: [PATCH] BTRFS: Fix mem leak in btrfs_submit_direct()

2011-03-13 Thread Jesper Juhl
On Sun, 13 Mar 2011, Jesper Juhl wrote: When memory is low and the allocation for 'dip-csums' fail in fs/btrfs/inode.c:btrfs_submit_direct() we make the situation worse by leaking the memory allocated to 'dip'. This patch removes the leak by kfree()'ing 'dip' before jumping

[PATCH 04/37] Remove unneeded version.h includes from fs/

2011-06-23 Thread Jesper Juhl
It was pointed out by 'make versioncheck' that some includes of linux/version.h were not needed in fs/ (fs/btrfs/ctree.h and fs/omfs/file.c). This patch removes them. Signed-off-by: Jesper Juhl j...@chaosbits.net --- fs/btrfs/ctree.h |1 - fs/omfs/file.c |1 - 2 files changed, 0

[PATCH] btrfs: Don't leak mem in scrub_fixup().

2011-11-06 Thread Jesper Juhl
-by: Jesper Juhl j...@chaosbits.net --- fs/btrfs/scrub.c |1 + 1 files changed, 1 insertions(+), 0 deletions(-) Compile tested only since I don't have any btrfs filesystems to test on. diff --git a/fs/btrfs/scrub.c b/fs/btrfs/scrub.c index a8d03d5..b53433e 100644 --- a/fs/btrfs/scrub.c +++ b/fs

[PATCH][TRIVIAL] btrfs: Remove a couple of redundant semi-colons

2011-12-17 Thread Jesper Juhl
Signed-off-by: Jesper Juhl j...@chaosbits.net --- fs/btrfs/disk-io.c |2 +- fs/btrfs/free-space-cache.c |2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c index f44b392..2a8038a 100644 --- a/fs/btrfs/disk-io.c +++ b/fs

btrfs: potential null derefs

2010-11-07 Thread Jesper Juhl
dereferencing a NULL pointer when the allocations fail. Enjoy ;-) PS. Please CC me on replies. -- Jesper Juhl j...@chaosbits.net http://www.chaosbits.net/ Plain text mails only, please http://www.expita.com/nomime.html Don't top-post http://www.catb.org/~esr/jargon/html/T

[PATCH] BTRFS: Don't include disk-io.h twice in check-integrity.c

2012-02-04 Thread Jesper Juhl
Once should be enough. Signed-off-by: Jesper Juhl j...@chaosbits.net --- fs/btrfs/check-integrity.c |1 - 1 files changed, 0 insertions(+), 1 deletions(-) diff --git a/fs/btrfs/check-integrity.c b/fs/btrfs/check-integrity.c index b669a7d..064b29b 100644 --- a/fs/btrfs/check-integrity.c

[PATCH][trivial] btrfs: assignment in write_dev_flush() doesn't need two semi-colons

2012-02-26 Thread Jesper Juhl
One is enough. Signed-off-by: Jesper Juhl j...@chaosbits.net --- fs/btrfs/disk-io.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c index 534266f..f87590b 100644 --- a/fs/btrfs/disk-io.c +++ b/fs/btrfs/disk-io.c @@ -2744,7 +2744,7

[PATCH] Btrfs: Make free_ipath() deal gracefully with NULL pointers

2012-04-12 Thread Jesper Juhl
); free_ipath(ipath); ... If we ever take the true branch of that 'if' statement we'll end up passing a NULL pointer to free_ipath() which will subsequently dereference it and we'll go Boom :-( This patch will avoid that. Signed-off-by: Jesper Juhl j...@chaosbits.net --- fs/btrfs/backref.c |2 ++ 1

[PATCH] Btrfs: Ensure va_end() is always called in __btrfs_std_error() and btrfs_printk()

2012-06-21 Thread Jesper Juhl
__btrfs_std_error() neglects to call va_end() when doing early return after testing if (errno == -EROFS (sb-s_flags MS_RDONLY)) and btrfs_printk() doesn't call va_end() at all. This patch makes sure that va_end() is always properly called. Signed-off-by: Jesper Juhl j...@chaosbits.net --- fs