[PATCH] btrfs-progs: from troubleshooting point of view messages must be unique

2013-03-01 Thread Anand Jain
>From the below, we won't readily know from where the error is generated - cmds-device.c: fprintf(stderr, "ERROR: unable to scan the device '%s' - %s\n", utils.c:fprintf(stderr, "ERROR: unable to scan the device '%s' - %s\n", - Signed-off-by: Anand Jain

[PATCH] btrfs-progs: usage should match what is coded

2013-03-01 Thread Anand Jain
Signed-off-by: Anand Jain --- cmds-restore.c | 4 1 file changed, 4 deletions(-) diff --git a/cmds-restore.c b/cmds-restore.c index 9385042..4a14f93 100644 --- a/cmds-restore.c +++ b/cmds-restore.c @@ -763,10 +763,6 @@ const char * const cmd_restore_usage[] = { "-f filesystem l

[PATCH] btrfs-progs: traverse to backup super-block only when indicated

2013-03-01 Thread Anand Jain
This patch adds 4th parameter to btrfs_scan_one_device() which when set to non-zero value will traverse to check backup super-block. Signed-off-by: Anand Jain --- btrfs-show.c | 2 +- btrfsctl.c| 2 +- cmds-device.c | 4 ++-- cmds-filesystem.c | 4 ++-- cmds-replace.c|

Re: [bug] mkfs.btrfs reports device busy for ext4 mounted disk

2013-03-01 Thread Anand Jain
btrfs-progs shouldn't be unconditionally trusting the backup superblocks if the primary is garbage. It should only check the backups if the user specifically asks it to. Agreed. Let me add that all the rescue tools should accept a parameter to pick the backup superblocks. Currently fsck -s,

Re: [PATCH v4] Btrfs: ability to add label to snapshot and subvol

2013-03-01 Thread Anand Jain
As long as we integrate, broadcast and use single keyword for a purpose I am fine with using xattr. Patch using xattr was posted as well. Just a note, potential applications using snapshot label are: - Yum, btrfs-progs, snapper, btrfs-gui, Gnome-Nautilus-snapshot-plugin, enterpris

[PATCH 1/2] Btrfs: don't call btrfs_qgroup_free if just btrfs_qgroup_reserve fails

2013-03-01 Thread Wang Shilong
From: Wang Shilong commit eb6b88d92c6df083dd09a8c471011e3788dfd7c6 leads into another bug. If it is just because qgroup_reserve fails, the function btrfs_qgroup_free should not be called, otherwise, it will cause the wrong quota accounting. Signed-off-by: Wang Shilong --- fs/btrfs/extent-tree.

[PATCH 2/2] Btrfs: cleanup to make the function btrfs_delalloc_reserve_metadata more logic

2013-03-01 Thread Wang Shilong
From: Wang Shilong The original code is a little confusing and not clear, The right way to deal with the kernel code like this: [...] if (ret) goto out; [...] So i move the common clean_up code to the place labeled with out_

about btrfs patches

2013-03-01 Thread Shilong Wang
Hello Josef, Could you please pull these patches: https://patchwork.kernel.org/patch/2192901/ https://patchwork.kernel.org/patch/2192911/ https://patchwork.kernel.org/patch/2192921/ The first one is definitely a bug that needs to be fixed, the second one is to remove unnecessary BUG_ON, the l

[PATCH] btrfs: try harder to allocate raid56 stripe cache

2013-03-01 Thread David Sterba
The stripe hash table is large, starting with allocation order 4 and can go as high as order 7 in case lock debugging is turned on and structure padding happens. Observed mount failure: mount: page allocation failure: order:7, mode:0x200050 Pid: 8234, comm: mount Tainted: GW3.8.0-defa

Re: [PATCH] btrfs: try harder to allocate raid56 stripe cache

2013-03-01 Thread Chris Mason
On Fri, Mar 01, 2013 at 08:03:00AM -0700, David Sterba wrote: > The stripe hash table is large, starting with allocation order 4 and can go as > high as order 7 in case lock debugging is turned on and structure padding > happens. Thanks Dave, I had this on my todo list but it dropped off. We don'

Re: [PATCH] btrfs: try harder to allocate raid56 stripe cache

2013-03-01 Thread David Sterba
On Fri, Mar 01, 2013 at 10:14:26AM -0500, Chris Mason wrote: > On Fri, Mar 01, 2013 at 08:03:00AM -0700, David Sterba wrote: > > The stripe hash table is large, starting with allocation order 4 and can go > > as > > high as order 7 in case lock debugging is turned on and structure padding > > happ

[PATCH v2] btrfs: clean snapshots one by one

2013-03-01 Thread David Sterba
Each time pick one dead root from the list and let the caller know if it's needed to continue. This should improve responsiveness during umount and balance which at some point wait for cleaning all currently queued dead roots. A new dead root is added to the end of the list, so the snapshots disap

Re: [PATCH v2] btrfs: clean snapshots one by one

2013-03-01 Thread David Sterba
The mail did not make it to the list on Monday, anyway, now I have a few testing results to share. The umount responsiveness is much improved, it took a few seconds when there were many roots to clean scheduled. With $ echo 'func btrfs_drop_snapshot +pf' > /sys/debug/kernel/dynamic_debug/control

[PATCH] Btrfs: delete inline extents when we find them during logging

2013-03-01 Thread Josef Bacik
Apparently when we do inline extents we allow the data to overlap the last chunk of the btrfs_file_extent_item, which means that we can possibly have a btrfs_file_extent_item that isn't actually as large as a btrfs_file_extent_item. This messes with us when we try to overwrite the extent when loggi

Re: [PATCH] btrfs-progs: traverse to backup super-block only when indicated

2013-03-01 Thread Eric Sandeen
On 3/1/13 4:13 AM, Anand Jain wrote: > This patch adds 4th parameter to btrfs_scan_one_device() > which when set to non-zero value will traverse to check > backup super-block. > > Signed-off-by: Anand Jain > --- > btrfs-show.c | 2 +- > btrfsctl.c| 2 +- > cmds-device.c | 4 +

Re: [PATCH] btrfs-progs: usage should match what is coded

2013-03-01 Thread Eric Sandeen
On 3/1/13 4:10 AM, Anand Jain wrote: > Signed-off-by: Anand Jain Revieed-by: Eric Sandeen But the curious side of me wonders how it got this way. commit e43cc461550130494194201037590a2b1f0f6880 Author: Ian Kumlien Date: Fri Feb 8 01:37:02 2013 +0100 Btrfs-progs: add restore command to

Re: [PATCH] btrfs-progs: usage should match what is coded

2013-03-01 Thread Hugo Mills
On Fri, Mar 01, 2013 at 11:47:50AM -0600, Eric Sandeen wrote: > On 3/1/13 4:10 AM, Anand Jain wrote: > > Signed-off-by: Anand Jain > > Revieed-by: Eric Sandeen > > But the curious side of me wonders how it got this way. > > commit e43cc461550130494194201037590a2b1f0f6880 > Author: Ian Kumlien

Re: [PATCH] btrfs: try harder to allocate raid56 stripe cache

2013-03-01 Thread Zach Brown
> The stripe hash table is large, starting with allocation order 4 and can go as > high as order 7 in case lock debugging is turned on and structure padding > happens. Agreed, this should be fixed. > - table = kzalloc(sizeof(*table) + sizeof(*h) * num_entries, GFP_NOFS); > + table = kzal

Re: [PATCH] btrfs-progs: traverse to backup super-block only when indicated

2013-03-01 Thread Zach Brown
On Fri, Mar 01, 2013 at 06:13:20PM +0800, Anand Jain wrote: > This patch adds 4th parameter to btrfs_scan_one_device() > which when set to non-zero value will traverse to check > backup super-block. Cool, thanks for working on this. How'd you decide which callers wanted to scan the backups and wh

[PATCH] Btrfs: use set_nlink if our i_nlink is 0

2013-03-01 Thread Josef Bacik
We need to inc the nlink of deleted entries when running replay so we can do the unlink on the fs_root and get everything cleaned up and then have the orphan cleanup do the right thing. The problem is inc_nlink complains about this, even thought it still does the right thing. So use set_nlink() i

unremovable dirs from failed unlink

2013-03-01 Thread Zach Brown
A while ago someone on IRC had a directory with no entries but with a non-zero i_size. rmdir fails because i_size isn't zero but there are no items left to remove and decrease i_size. At the time casual code inspection implied that this would be possible in unlucky error cases. I finally got ar

Re: [PATCH] btrfs: try harder to allocate raid56 stripe cache

2013-03-01 Thread David Sterba
On Fri, Mar 01, 2013 at 10:18:27AM -0800, Zach Brown wrote: > > - table = kzalloc(sizeof(*table) + sizeof(*h) * num_entries, GFP_NOFS); > > > + table = kzalloc(table_size, GFP_KERNEL | __GFP_NOWARN | __GFP_REPEAT); > > I guess this lost _NOFS on purpose because it was always being done in > m

Re: Changing allocation mode

2013-03-01 Thread Fredrik Tolf
On Wed, 27 Feb 2013, Liu Bo wrote: On Sat, Feb 23, 2013 at 01:46:03AM +0100, Fredrik Tolf wrote: If I were transferring the data to a new filesystem on mdraid, the procedure I would use for that last portion of the data would be to remove one disk only from either of the old mdraid mirror arrays

Re: lvm volume like support

2013-03-01 Thread Marcus Sorensen
That's great, but the issue is that usually the block device version performs better than just creating a file and using it as a raw image or loop device. Creating a file, then running it through a SCSI target seems like it's going in the opposite direction. On Wed, Feb 27, 2013 at 2:57 AM, Alex E

[PATCH] btrfs: return EPERM in btrfs_rm_device()

2013-03-01 Thread Jerry Snitselaar
Currently there are error paths in btrfs_rm_device() where EINVAL is returned telling the user they passed an invalid argument even though they passed a valid device. Change to return EPERM instead as the operation is not permitted. Signed-off-by: Jerry Snitselaar --- fs/btrfs/volumes.c | 8