Re: btrfs qgroup destroy - ERROR: unable to create quota group: Device or resource busy

2013-08-09 Thread Tomasz Chmielewski
On Fri, 09 Aug 2013 13:56:19 +0800 Wang Shilong wangsl.f...@cn.fujitsu.com wrote: It seems that btrfs automatically assigns a qgroup to newly created snapshot/subvolume, but does not destroy the qgroup when the subvolume is deleted. This should be implemented. And will soon. Great to

Re: btrfs qgroup destroy - ERROR: unable to create quota group: Device or resource busy

2013-08-09 Thread Wang Shilong
On 08/09/2013 02:42 PM, Tomasz Chmielewski wrote: On Fri, 09 Aug 2013 14:08:48 +0800 Wang Shilong wangsl.f...@cn.fujitsu.com wrote: 0/4494 839516160 18446744073709481984 --- -- want to remove only this one 13/1 2142674944 2142674944

Re: btrfs qgroup destroy - ERROR: unable to create quota group: Device or resource busy

2013-08-09 Thread Tomasz Chmielewski
On Fri, 09 Aug 2013 14:56:15 +0800 Wang Shilong wangsl.f...@cn.fujitsu.com wrote: So how exactly should I do it? A bit confused on how to proceed. btrfs qgroup remove 4494 13/1 mnt will destroy relation between 4494 and 13/1 Then you can try: btrfs qgroup destroy 4494 mnt Excellent,

Re: [patch v2 1/2] Btrfs: fix possible memory leak in find_parent_nodes()

2013-08-09 Thread Jan Schmidt
On Fri, August 09, 2013 at 07:25 (+0200), Wang Shilong wrote: The origin code dealt with 'ref' as following steps: |-list_del(ref-list) |-some operations |-kfree(ref) If operations failed, it would goto label 'out' without freeing this 'ref'. and then memory

[PATCH V3 1/2] Btrfs: fix possible memory leak in find_parent_nodes()

2013-08-09 Thread Wang Shilong
The origin code dealt with 'ref' as following steps: |-list_del(ref-list) |-some operations |--goto cleanup if failed |-kfree(ref) cleanup: |-cleanup all 'ref's in the list If operations failed, it would goto label 'cleanup' without freeing this 'ref'.The

Re: [PATCH 1/3] Btrfs: fix oops when writing dirty qgroups to disk

2013-08-09 Thread Wang Shilong
On 08/08/2013 09:20 PM, Josef Bacik wrote: On Wed, Aug 07, 2013 at 01:12:29PM +0800, Wang Shilong wrote: When disabling quota, we should clear out list 'dirty_qgroups',otherwise, we will get oops if enabling quota again. Fix this by abstracting similar code from del_qgroup_rb().

Re: [PATCH 1/3] Btrfs: fix oops when writing dirty qgroups to disk

2013-08-09 Thread Arne Jansen
On 07.08.2013 07:12, Wang Shilong wrote: When disabling quota, we should clear out list 'dirty_qgroups',otherwise, we will get oops if enabling quota again. Fix this by abstracting similar code from del_qgroup_rb(). Signed-off-by: Wang Shilong wangsl.f...@cn.fujitsu.com Reviewed-by: Miao

Re: [PATCH 3/3] Btrfs: remove reduplicate check when disabling quota

2013-08-09 Thread Arne Jansen
On 07.08.2013 07:12, Wang Shilong wrote: We have checked 'quota_root' with qgroup_ioctl_lock held before,So here the check is reduplicate, remove it. Signed-off-by: Wang Shilong wangsl.f...@cn.fujitsu.com Reviewed-by: Miao Xie mi...@cn.fujitsu.com --- fs/btrfs/qgroup.c | 5 - 1 file

Re: [PATCH 2/2] btrfs-progs: introduce btrfs filesystem show --kernel

2013-08-09 Thread anand jain
On 09/08/2013 02:08, Zach Brown wrote: On Thu, Aug 08, 2013 at 04:07:07PM +0800, Anand Jain wrote: As of now btrfs filesystem show reads directly from disks. So sometimes output can be stale, mainly when user want to verify their last operation like, labeling or device delete or add... etc.

Re: btrfs zero divide

2013-08-09 Thread Andreas Schwab
Andreas Schwab sch...@linux-m68k.org writes: Josef Bacik jba...@fusionio.com writes: So stripe_len shouldn't be 0, if it is you have bigger problems :). The bigger problem is that stripe_nr is u64, this is completely bogus. The first operand of do_div must be u32. This goes through the

Re: btrfs qgroup destroy - ERROR: unable to create quota group: Device or resource busy

2013-08-09 Thread Wang Shilong
Hello, just add my answer for a missing question. On Fri, 09 Aug 2013 13:56:19 +0800 Wang Shilong wangsl.f...@cn.fujitsu.com wrote: It seems that btrfs automatically assigns a qgroup to newly created snapshot/subvolume, but does not destroy the qgroup when the subvolume is deleted.

Re: [PATCH v2] Btrfs-progs: add dedup subcommand

2013-08-09 Thread David Sterba
On Thu, Aug 08, 2013 at 04:35:46PM +0800, Liu Bo wrote: This aims to add deduplication subcommand, 'btrfs dedup command path', ie. register/unregister'. I'm not sure that calling it register/unregister is the right thing, IMO it's more enable/disable as you write in the documentation under each

Re: [PATCH RFC] Btrfs: add support for persistent mount options

2013-08-09 Thread Filipe David Manana
On Fri, Aug 9, 2013 at 1:01 AM, David Sterba dste...@suse.cz wrote: On Wed, Aug 07, 2013 at 12:33:09PM +0100, Filipe David Manana wrote: Thanks, I missed to find that before. The implementation is very different from the one I proposed. That's one of the fundaental questions how to store the

Re: [PATCH] Btrfs: fix race between removing a dev and writing sbs

2013-08-09 Thread Filipe David Manana
On Fri, Aug 9, 2013 at 2:07 PM, Stefan Behrens sbehr...@giantdisaster.de wrote: On Thu, 8 Aug 2013 21:00:52 +0100, Filipe David Borba Manana wrote: Since all code paths that update the number of devices in the super copy (fs_info-super_copy) first lock the device list

Re: [PATCH 2/2] btrfs-progs: mark static remove unused from non-kernel code

2013-08-09 Thread David Sterba
On Wed, Aug 07, 2013 at 10:17:57AM -0500, Eric Sandeen wrote: And isn't it still a mistake? I think it used to be that subvol_uuid_search_init() would allocate the memory which must be freed, but that's no longer the case, right? So under what circumstances is it correct to call

Re: btrfs zero divide

2013-08-09 Thread Josef Bacik
On Fri, Aug 09, 2013 at 02:30:38PM +0200, Andreas Schwab wrote: Andreas Schwab sch...@linux-m68k.org writes: Josef Bacik jba...@fusionio.com writes: So stripe_len shouldn't be 0, if it is you have bigger problems :). The bigger problem is that stripe_nr is u64, this is completely

Re: [PATCH 2/2] btrfs-progs: mark static remove unused from non-kernel code

2013-08-09 Thread Stefan Behrens
On Fri, 9 Aug 2013 16:10:39 +0200, David Sterba wrote: On Wed, Aug 07, 2013 at 10:17:57AM -0500, Eric Sandeen wrote: And isn't it still a mistake? I think it used to be that subvol_uuid_search_init() would allocate the memory which must be freed, but that's no longer the case, right? So

[PATCH v2] Btrfs: fix race between removing a dev and writing sbs

2013-08-09 Thread Filipe David Borba Manana
This change fixes an issue when removing a device and writing all super blocks run simultaneously. Here's the steps necessary for the issue to happen: 1) disk-io.c:write_all_supers() gets a number of N devices from the super_copy, so it will not panic if it fails to write super blocks for N

Re: [PATCH] Btrfs: set default max_inline to 8KiB instead of 8MiB

2013-08-09 Thread David Sterba
On Fri, Aug 09, 2013 at 01:47:24PM +0800, Miao Xie wrote: On thu, 8 Aug 2013 22:45:48 +0100, Filipe David Borba Manana wrote: 8MiB is way too large and likely set by mistake. This is not a significant issue as in practice the max amount of data added to an inline extent is also limited by

Re: [PATCH] Btrfs: fix race between removing a dev and writing sbs

2013-08-09 Thread Stefan Behrens
On Fri, 9 Aug 2013 14:50:35 +0100, Filipe David Manana wrote: On Fri, Aug 9, 2013 at 2:07 PM, Stefan Behrens sbehr...@giantdisaster.de wrote: On Thu, 8 Aug 2013 21:00:52 +0100, Filipe David Borba Manana wrote: Since all code paths that update the number of devices in the super copy

Re: hang on 3.9, 3.10-rc5

2013-08-09 Thread Sage Weil
Hi Chris, On Thu, 20 Jun 2013, Chris Mason wrote: Quoting Sage Weil (2013-06-20 17:56:19) On Wed, 19 Jun 2013, Sage Weil wrote: Hi Chris, On Tue, 18 Jun 2013, Chris Mason wrote: [...] Very long way of saying I think we're one release_path short. Sage, I haven't tested

Re: btrfs zero divide

2013-08-09 Thread Zach Brown
On Fri, Aug 09, 2013 at 02:26:36PM +0200, Andreas Schwab wrote: Josef Bacik jba...@fusionio.com writes: So stripe_len shouldn't be 0, if it is you have bigger problems :). The bigger problem is that stripe_nr is u64, this is completely bogus. The first operand of do_div must be u32. This

[PATCH 2/2 V2] btrfs-progs: mark static remove unused from non-kernel code

2013-08-09 Thread Eric Sandeen
Mark many functions as static, and remove any resulting dead code. Signed-off-by: Eric Sandeen sand...@redhat.com --- V2: Keep the special subvol_uuid_search_add()-which-only-frees-pointers because I'm picking my battles :) btrfs-convert.c |8 btrfs-find-root.c |2 +-

[PATCH 2/2] btrfs: don't double brelse on device rm

2013-08-09 Thread Zach Brown
Device removal currently causes bdev removal to try to double free a bh in the bdev: [ 55.714833] WARNING: at fs/buffer.c:1160 __brelse+0x36/0x40() [ 55.714833] VFS: brelse: Trying to free free buffer Commit 7e3d9ebb1 added a double release of the bh for a device being removed when all the

[PATCH 1/2] btrfs: brelse in error path in open_ctree

2013-08-09 Thread Zach Brown
Commit 1104a8855 added an error branch that forgot to release the super bh. I found this while looking for an unrelated double brelse. Signed-off-by: Zach Brown z...@redhat.com --- fs/btrfs/disk-io.c | 1 + 1 file changed, 1 insertion(+) diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c

Re: [PATCH 2/2 V2] btrfs-progs: mark static remove unused from non-kernel code

2013-08-09 Thread David Sterba
On Fri, Aug 09, 2013 at 03:20:47PM -0500, Eric Sandeen wrote: Mark many functions as static, and remove any resulting dead code. Thanks. -struct btrfs_root *link_subvol(struct btrfs_root *root, const char *base, -u64 root_objectid) +static struct btrfs_root *

Re: [PATCH 2/2 V2] btrfs-progs: mark static remove unused from non-kernel code

2013-08-09 Thread Eric Sandeen
On 8/9/13 5:48 PM, David Sterba wrote: On Fri, Aug 09, 2013 at 03:20:47PM -0500, Eric Sandeen wrote: Mark many functions as static, and remove any resulting dead code. Thanks. -struct btrfs_root *link_subvol(struct btrfs_root *root, const char *base, - u64