[PATCH] Btrfs: fix a memory leak in btrfs_get_sb

2008-12-28 Thread Shen Feng
subvol_name should be freed if error occurs. Signed-off-by: Shen Feng --- fs/btrfs/super.c |9 - 1 files changed, 4 insertions(+), 5 deletions(-) diff --git a/fs/btrfs/super.c b/fs/btrfs/super.c index d0e8dce..a53f690 100644 --- a/fs/btrfs/super.c +++ b/fs/btrfs/super.c @@ -429,7 +

[PATCH] Btrfs: do not call kfree if kmalloc failed in btrfs_sysfs_add_super

2008-12-28 Thread Shen Feng
kfree should not be called if kmalloc is not success. Signed-off-by: Shen Feng --- fs/btrfs/sysfs.c |3 +-- 1 files changed, 1 insertions(+), 2 deletions(-) diff --git a/fs/btrfs/sysfs.c b/fs/btrfs/sysfs.c index 300076e..04087c0 100644 --- a/fs/btrfs/sysfs.c +++ b/fs/btrfs/sysfs.c @@ -212,1

[PATCH] Btrfs: check return of kmalloc in btrfs_control_ioctl

2008-12-28 Thread Shen Feng
The memory allocated by kmalloc should be checked before using it. Signed-off-by: Shen Feng --- fs/btrfs/super.c |2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/fs/btrfs/super.c b/fs/btrfs/super.c index 84c3b66..d0e8dce 100644 --- a/fs/btrfs/super.c +++ b/fs/btrfs/supe

Re: multiple device usage

2008-12-28 Thread yanhai zhu
> so i can do btrfs-vol -r /dev/sdb while it`s being mounted, pull the disk , > replace it with a bigger one, rescan-scsi-bus, mkfs.btrfs the new disk and ~~~ This step will fail, yo