Another 4.8-rc locked splat: btrfs_close_devices()

2016-09-08 Thread Ilya Dryomov
Hello, This one seems to have appeared after Anand's commit 142388194191 ("btrfs: do not background blkdev_put()") got merged into 4.8-rc4. Thanks, Ilya [ 983.284212] == [ 983.290401] [ INFO: possible circular locking dependen

Possible recursive locking on btrfs_inode::log_mutex

2016-08-20 Thread Ilya Dryomov
Hi, I'm seeing the attached lockdep splat on 4.8-rc2 - I'm guessing it got introduced in 4.8-rc. It appears to be very easy to trigger and shows up within seconds after mkfs + mount. Thanks, Ilya kernel: = kernel: [ INFO: possible recu

Re: Infinite loop in in btrfs_find_space_cluster() with btrfs_free_cluster::lock held

2016-03-30 Thread Ilya Dryomov
On Wed, Mar 30, 2016 at 7:25 PM, Liu Bo wrote: > On Wed, Mar 30, 2016 at 05:24:04PM +0200, Ilya Dryomov wrote: >> Hi, >> >> We are hitting the attached lockup on a somewhat regular basis during >> nightly tests. Looks like a bunch of CPUs spin in find_free_extent() >

Infinite loop in in btrfs_find_space_cluster() with btrfs_free_cluster::lock held

2016-03-30 Thread Ilya Dryomov
Hi, We are hitting the attached lockup on a somewhat regular basis during nightly tests. Looks like a bunch of CPUs spin in find_free_extent() on btrfs_free_cluster::lock, which is held by writer, who seems to be stuck in an endless loop in btrfs_find_space_cluster(), trying to cleanup bitmaps li

Re: [PATCH] btrfs: Allow forced conversion of metadata to dup profile on multiple devices

2014-02-24 Thread Ilya Dryomov
On Mon, Feb 24, 2014 at 3:44 PM, Austin S Hemmelgarn wrote: > On 2014-02-24 08:37, Ilya Dryomov wrote: >> On Thu, Feb 20, 2014 at 6:57 PM, David Sterba wrote: >>> On Wed, Feb 19, 2014 at 11:10:41AM -0500, Austin S Hemmelgarn wrote: >>>> Currently, btrfs balance star

Re: [PATCH] btrfs: Allow forced conversion of metadata to dup profile on multiple devices

2014-02-24 Thread Ilya Dryomov
On Thu, Feb 20, 2014 at 6:57 PM, David Sterba wrote: > On Wed, Feb 19, 2014 at 11:10:41AM -0500, Austin S Hemmelgarn wrote: >> Currently, btrfs balance start fails when trying to convert metadata or >> system chunks to dup profile on filesystems with multiple devices. This >> requires that a conv

Re: [PATCH 2/6] Btrfs-progs: add btrfsck functionality to btrfs

2013-11-14 Thread Ilya Dryomov
On Wed, Nov 13, 2013 at 7:13 PM, David Sterba wrote: > Hi, > > On Sun, Jun 02, 2013 at 05:47:38PM +0200, Dieter Ries wrote: >> For this to have any effect, 'h' must be added to getopt_long(), see >> attached patch 1. >> >> However, this results in btrfsck -h and --help doing different things: >> >

[PATCH 1/3] Btrfs: do not inc uncorrectable_errors counter on ro scrubs

2013-11-03 Thread Ilya Dryomov
d b) we haven't tried to fixup anything. Fix this. Cc: Stefan Behrens Signed-off-by: Ilya Dryomov --- fs/btrfs/scrub.c |6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/fs/btrfs/scrub.c b/fs/btrfs/scrub.c index f21e2df..f94b98d 100644 --- a/fs/btrfs/scrub.c ++

[PATCH 2/3] Btrfs: disable online raid-repair on ro mounts

2013-11-03 Thread Ilya Dryomov
This disables the "if needed, write the good copy back before the read is completed" part of the read sequence for read-only mounts. Cc: Jan Schmidt Signed-off-by: Ilya Dryomov --- fs/btrfs/extent_io.c | 11 --- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git

[PATCH 3/3] Btrfs: fix __btrfs_start_workers retval

2013-11-03 Thread Ilya Dryomov
__btrfs_start_workers returns 0 in case it raced with btrfs_stop_workers and lost the race. This is wrong because worker in this case is not allowed to start and is in fact destroyed. Return -EINVAL instead. Signed-off-by: Ilya Dryomov --- fs/btrfs/async-thread.c |1 + 1 file changed, 1

Re: [PATCH] Btrfs: disallow 'btrfs {balance,replace} cancel' on ro mounts

2013-10-11 Thread Ilya Dryomov
On Fri, Oct 11, 2013 at 12:28 PM, Remco Hosman - Yerf-IT wrote: > i would expect a RO mount never to write anything to a filesystem. not even > replay a journal (or a seperate option for that). > Its possible that the device is not writable at all, if its a snapshot or a > RO iscsi device of some

Re: [PATCH] Btrfs: disallow 'btrfs {balance,replace} cancel' on ro mounts

2013-10-11 Thread Ilya Dryomov
On Fri, Oct 11, 2013 at 4:13 AM, Wang Shilong wrote: > On 10/11/2013 01:40 AM, Ilya Dryomov wrote: > > I have a question in my mind. > > Can we reach a state that there is operation in progress when filesystem > has been readonly?If we do cancel operations on a ro filesystem, w

[PATCH] Btrfs: disallow 'btrfs {balance,replace} cancel' on ro mounts

2013-10-10 Thread Ilya Dryomov
For both balance and replace, cancelling involves changing the on-disk state and committing a transaction, which is not a good thing to do on read-only filesystems. Cc: Stefan Behrens Signed-off-by: Ilya Dryomov --- fs/btrfs/dev-replace.c |3 +++ fs/btrfs/volumes.c |3 +++ 2 files

[PATCH] Btrfs: don't leak ioctl args in btrfs_ioctl_dev_replace

2013-10-10 Thread Ilya Dryomov
struct btrfs_ioctl_dev_replace_args memory is leaked if replace is requested on a read-only filesystem. Fix it. Signed-off-by: Ilya Dryomov --- fs/btrfs/ioctl.c |9 + 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c index 9d46f60

[PATCH] Btrfs: nuke a bogus rw_devices decrement in __btrfs_close_devices

2013-10-10 Thread Ilya Dryomov
e fail early in the mount sequence. Fix this by checking the devid instead of ->is_tgtdev_for_dev_replace before the decrement: for replace targets devid is always equal to BTRFS_DEV_REPLACE_DEVID. Cc: Stefan Behrens Signed-off-by: Ilya Dryomov --- fs/btrfs/volumes.c |3 ++- 1 file c

[PATCH] Btrfs: fix the dev-replace suspend sequence

2013-10-07 Thread Ilya Dryomov
chunk returns with -ECANCELED, so this fix covers both suspend and error cases.) Cc: Stefan Behrens Signed-off-by: Ilya Dryomov --- fs/btrfs/scrub.c |5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/fs/btrfs/scrub.c b/fs/btrfs/scrub.c index a18e0e2..f21e2df 100644 --- a/fs/

[PATCH] Btrfs: fix a use-after-free bug in btrfs_dev_replace_finishing

2013-10-02 Thread Ilya Dryomov
-off-by: Ilya Dryomov --- fs/btrfs/dev-replace.c |5 + fs/btrfs/volumes.c |7 ++- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/fs/btrfs/dev-replace.c b/fs/btrfs/dev-replace.c index a644353..5aa0718 100644 --- a/fs/btrfs/dev-replace.c +++ b/fs/btrfs/dev

[PATCH] Btrfs: eliminate races in worker stopping code

2013-10-02 Thread Ilya Dryomov
waken up, fireworks ensue With this applied, I wasn't able to trigger the problem in 48 hours, whereas previously I could reliably reproduce at least one of these races within an hour. Reported-by: David Sterba Signed-off-by: Ilya Dryomov --- fs/btrfs/async-threa

Re: [PATCH] xfstests: unify apostrophes in output files

2013-09-19 Thread Ilya Dryomov
On Thu, Sep 19, 2013 at 7:20 PM, Eric Sandeen wrote: > xfstests: unify apostrophes in output files > > From: Tomas Racek > > With coreutils v8.16 the style of apostrophes changed from `word' to > 'word'. This is breaking some tests which use the older form. > > This commit introduces function cha

Re: [PATCH v2 18/20] Btrfs-progs: fix magic return value in cmds-balance.c

2013-09-10 Thread Ilya Dryomov
Address comments from Ilya Dryomov. Reviewed-by: Ilya Dryomov -- 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

Re: [PATCH 18/20] Btrfs-progs: fix magic return value in cmds-balance.c

2013-09-04 Thread Ilya Dryomov
Hi Wang, Thank you for doing the grunt work, it's been a long standing todo. See the comments below. On Wed, Sep 4, 2013 at 6:22 PM, Wang Shilong wrote: > From: Wang Shilong > > If there is no balance in progress.resume/pause/cancel will > return 2. For usage or syntal errors will return 1. 0 m

[PATCH] Btrfs: do not add replace target to the alloc_list

2013-09-01 Thread Ilya Dryomov
ed *after* everything is opened and fs_devices lists are populated. Fix this by checking the devid instead: for replace targets it's always equal to BTRFS_DEV_REPLACE_DEVID. Cc: Stefan Behrens Signed-off-by: Ilya Dryomov --- At first I thought this was caused by my btrfs_device rollback patch, b

[PATCH] Btrfs: stop refusing the relocation of chunk 0

2013-08-27 Thread Ilya Dryomov
code is already doing this: it will happily relocate chunk 0 is part of shrinking the device. [1] https://bugzilla.kernel.org/show_bug.cgi?id=60594 Reported-by: Xavier Bassery Signed-off-by: Ilya Dryomov --- fs/btrfs/volumes.c |6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff

[PATCH v2 2/4] Btrfs: add btrfs_alloc_device and switch to it

2013-08-23 Thread Ilya Dryomov
v add'). Fix this by adding an allocation helper and switch everybody but __btrfs_close_devices to it. (__btrfs_close_devices is dealt with in a later commit.) Signed-off-by: Ilya Dryomov --- v2: - fixed a dev-replace regression spotted by Stefan Behrens fs/btrfs/volume

Re: [PATCH 2/4] Btrfs: add btrfs_alloc_device and switch to it

2013-08-23 Thread Ilya Dryomov
On Fri, Aug 23, 2013 at 10:35 AM, Stefan Behrens wrote: > This WARN_ON(1) is triggered with the device replace procedure because > BTRFS_DEV_REPLACE_DEVID is zero. Ah, a dreaded 0 in C. What a screw up. This came from my rebuild branch where btrfs_init_dev_replace_tgtdev is a bit different, and

[PATCH 2/4] Btrfs: add btrfs_alloc_device and switch to it

2013-08-12 Thread Ilya Dryomov
v add'). Fix this by adding an allocation helper and switch everybody but __btrfs_close_devices to it. (__btrfs_close_devices is dealt with in a later commit.) Signed-off-by: Ilya Dryomov --- fs/btrfs/volumes.c | 150 fs/btrfs/volume

[PATCH 3/4] Btrfs: add alloc_fs_devices and switch to it

2013-08-12 Thread Ilya Dryomov
In the spirit of btrfs_alloc_device, add a helper for allocating and doing some common initialization of btrfs_fs_devices struct. Signed-off-by: Ilya Dryomov --- fs/btrfs/volumes.c | 71 +++- 1 file changed, 53 insertions(+), 18 deletions

[PATCH 0/4] btrfs_device fixes

2013-08-12 Thread Ilya Dryomov
conditions, can lead to mount failures. This is on top of 3.11-rc3, but applies cleanly to btrfs-next/master as of now. You can pull from: git://github.com/idryomov/btrfs-unstable.git dev-fixes Thanks, Ilya Ilya Dryomov (4): Btrfs: find_next_devid: root -> fs_info Btrfs:

[PATCH 1/4] Btrfs: find_next_devid: root -> fs_info

2013-08-12 Thread Ilya Dryomov
find_next_devid() knows which root to search, so it should take an fs_info instead of an arbitrary root. Signed-off-by: Ilya Dryomov --- fs/btrfs/volumes.c | 16 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c index

[PATCH 4/4] Btrfs: rollback btrfs_device fields on umount

2013-08-12 Thread Ilya Dryomov
es on the ->generation. Fix this, and possibly other problems, by zeroing out everything except for what device_list_add sets, so that a mount right after insmod and 'btrfs dev scan' is no different from any later mount in this respect. Signed-off-by: Ilya Dryomov --- fs/btrfs/volum

[PATCH] Btrfs: num_tolerated_disk_barrier_failures is incorrect for RAID6

2013-07-10 Thread Ilya Dryomov
Currently num_tolerated_disk_barrier_failures gets the value of fs_devices->num_devices in the RAID6 case. But, RAID6 can tolerate only two simultaneous failures, so set it to 2. CC: Stefan Behrens Signed-off-by: Ilya Dryomov --- fs/btrfs/disk-io.c |2 +- 1 file changed, 1 insertion(+)

Re: btrfs balance resume + raid5/6

2013-06-22 Thread Ilya Dryomov
On Sun, Jun 16, 2013 at 06:00:10AM +, Tim Castle wrote: > Greetings! > > I'm testing raid6, and recently added two drives. > I haven't been able to properly resume a balance operation: the number of > total chunks is always too low. > > It seems that the balance starts and pauses properly

Re: [RFC] How to enable btrfs reserve block space from specific device?

2013-03-27 Thread Ilya Dryomov
On Wed, Mar 27, 2013 at 09:45:59AM +0800, Zhi Yong Wu wrote: > HI, > > When i work on btrfs hot relocation feature, i hit one question > about block reservation. btrfs hot relocation need to reserve block > space from specific devices such as SSD, but current btrfs reserving > code doesn't dif

Re: [PATCH] btrfs: document mount options in Documentation/fs/btrfs.txt

2013-03-23 Thread Ilya Dryomov
On Sat, Mar 23, 2013 at 12:48:54PM -0500, Eric Sandeen wrote: > Document all current btrfs mount options. > > Signed-off-by: Eric Sandeen > --- > > please, Please, PLEASE review this and suggest improvements. > I'm no btrfs wizard but I've done my best to get this all right > based on commit log

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

2013-03-06 Thread Ilya Dryomov
On Fri, Mar 01, 2013 at 05:30:57PM +0100, David Sterba wrote: > 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 > >

[PATCH] Btrfs: fix a mismerge in btrfs_balance()

2013-03-06 Thread Ilya Dryomov
. Reported-by: David Sterba Signed-off-by: Ilya Dryomov --- fs/btrfs/volumes.c |5 + 1 files changed, 5 insertions(+), 0 deletions(-) diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c index 35bb2d4..33440da 100644 --- a/fs/btrfs/volumes.c +++ b/fs/btrfs/volumes.c @@ -3230,6 +3230,11 @@ int

Re: [PATCH] btrfs: return EPERM in btrfs_rm_device()

2013-03-02 Thread Ilya Dryomov
On Sat, Mar 02, 2013 at 12:13:59AM -0700, Jerry Snitselaar wrote: > 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 per

Re: [PATCH 17/17 V2] btrfs-progs: replace strtok_r with strsep

2013-02-26 Thread Ilya Dryomov
On Tue, Feb 26, 2013 at 02:46:30PM -0600, Eric Sandeen wrote: > On 2/26/13 2:40 PM, Ilya Dryomov wrote: > > On Tue, Feb 26, 2013 at 02:20:30PM -0600, Eric Sandeen wrote: > >> The coverity runs had a false positive complaining that save_ptr > >> is uninitiali

Re: [PATCH 17/17 V2] btrfs-progs: replace strtok_r with strsep

2013-02-26 Thread Ilya Dryomov
On Tue, Feb 26, 2013 at 02:20:30PM -0600, Eric Sandeen wrote: > The coverity runs had a false positive complaining that save_ptr > is uninitialized in the call to strtok_r. > > We could initialize it, but Zach points out that just using > strsep is a lot simpler if there's only one delimiter, > so

[PATCH] Btrfs-progs: move crc32c optimization init

2013-02-12 Thread Ilya Dryomov
Don't call crc32c_optimization_init() until we know that a command is actually going to be invoked. Signed-off-by: Ilya Dryomov --- btrfs.c |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/btrfs.c b/btrfs.c index 687acec..7752bd6 100644 --- a/btrfs.c +++ b/bt

[PATCH] Btrfs-progs: make 0 a valid usage filter argument

2013-02-12 Thread Ilya Dryomov
This is a progs counterpart to a "Btrfs: allow for selecting only completely empty chunks". usage=0 now means "select only only completely empty chunks and nothing else". Signed-off-by: Ilya Dryomov --- cmds-balance.c |2 +- 1 files changed, 1 insertions(+), 1 deleti

Re: [PATCH] btrfs: accept zero for balance usage filter

2013-02-12 Thread Ilya Dryomov
esort option under enospc. > > CC: Ilya Dryomov > Signed-off-by: David Sterba Josef, please don't pull this one into btrfs-next, it's been deprecated by "Btrfs: allow for selecting only completely empty chunks" from me. David and I discussed this on IRC, he is OK with

[PATCH] Btrfs: allow for selecting only completely empty chunks

2013-02-12 Thread Ilya Dryomov
only completely empty chunks and nothing else. Suggested-by: David Sterba Signed-off-by: Ilya Dryomov --- fs/btrfs/volumes.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c index 15f6efd..7e41619 100644 --- a/fs/btrfs/volumes.c

[PATCH] Btrfs: eliminate a use-after-free in btrfs_balance()

2013-02-12 Thread Ilya Dryomov
Commit 5af3e8cc introduced a use-after-free at volumes.c:3139: bctl is freed above in __cancel_balance() in all cases except for balance pause. Fix this by moving the offending check a couple statements above, the meaning of the check is preserved. Reported-by: Chris Mason Signed-off-by: Ilya

Re: [PATCH 6/6] Btrfs-progs: add the rescue section to btrfs

2013-02-08 Thread Ilya Dryomov
On Fri, Feb 08, 2013 at 01:37:02AM +0100, Ian Kumlien wrote: > the btrfs command now lists: > btrfs rescue select-super -s > Select a superblock > btrfs rescue dump-super > Dump a superblock to disk > btrfs rescue debug-tree [options] > Debug the filesystem >

Re: [PATCH] [RFC] include btrfsck in btrfs - including "name check"

2013-01-30 Thread Ilya Dryomov
On Wed, Jan 30, 2013 at 10:11:44PM +0100, Ian Kumlien wrote: > On Wed, Jan 30, 2013 at 12:33:42PM -0800, Filipe Brandenburger wrote: > > Hi Ian, > > > > On Tue, Jan 29, 2013 at 3:03 PM, Ian Kumlien wrote: > > > This patch includes fsck as a subcommand of btrfs, but if you rename > > > the binary

[PATCH] Btrfs: fix a regression in balance usage filter

2013-01-21 Thread Ilya Dryomov
Commit 3fed40cc ("Btrfs: cleanup duplicated division functions"), which was merged into 3.8-rc1, has introduced a regression by removing logic that was guarding us against bad user input. Bring it back. Signed-off-by: Ilya Dryomov --- fs/btrfs/volumes.c |9 - 1 files

[PATCH 1/5] Btrfs: bring back balance pause/resume logic

2013-01-20 Thread Ilya Dryomov
and instead return an error right away. Balancing front-end relied on the blocking behaviour, so the fix is ugly, but short of a complete rework, it's the best we can do. Reported-by: Liu Bo Signed-off-by: Ilya Dryomov --- fs/btrfs/ioctl.c |

Re: [PATCH 0/5] Mutually exclusive ops fixes

2013-01-20 Thread Ilya Dryomov
On Sun, Jan 20, 2013 at 05:22:27PM +0200, Ilya Dryomov wrote: > Hello, > > This is a set of fixes for mutually exclusive ops stuff added by Stefan > as part of the dev-replace patchset. The main one here is the first > patch, it fixes a regression in balancing interface. T

[PATCH 0/5] Mutually exclusive ops fixes

2013-01-20 Thread Ilya Dryomov
. Thanks, Ilya Ilya Dryomov (5): Btrfs: bring back balance pause/resume logic Btrfs: fix "mutually exclusive op is running" error code Btrfs: fix unlock order in btrfs_ioctl_resize Btrfs: fix unlock order in btrfs_ioctl_rm_dev Btrfs: reorder locks and sanity

[PATCH 4/5] Btrfs: fix unlock order in btrfs_ioctl_rm_dev

2013-01-20 Thread Ilya Dryomov
Fix unlock order in btrfs_ioctl_rm_dev(). Signed-off-by: Ilya Dryomov --- fs/btrfs/ioctl.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c index b9a0190..9c079dd 100644 --- a/fs/btrfs/ioctl.c +++ b/fs/btrfs/ioctl.c @@ -2320,8 +2320,8

[PATCH 5/5] Btrfs: reorder locks and sanity checks in btrfs_ioctl_defrag

2013-01-20 Thread Ilya Dryomov
Operation-specific check (whether subvol is readonly or not) should go after the mutual exclusiveness check. Signed-off-by: Ilya Dryomov --- fs/btrfs/ioctl.c | 17 + 1 files changed, 9 insertions(+), 8 deletions(-) diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c index

[PATCH 2/5] Btrfs: fix "mutually exclusive op is running" error code

2013-01-20 Thread Ilya Dryomov
may want to use EINPROGRESS for other purposes. Signed-off-by: Ilya Dryomov --- fs/btrfs/ioctl.c |8 1 files changed, 4 insertions(+), 4 deletions(-) diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c index ab82636..3aebb28 100644 --- a/fs/btrfs/ioctl.c +++ b/fs/btrfs/ioctl.c @@ -1337,7

[PATCH 3/5] Btrfs: fix unlock order in btrfs_ioctl_resize

2013-01-20 Thread Ilya Dryomov
Fix unlock order in btrfs_ioctl_resize(). Signed-off-by: Ilya Dryomov --- fs/btrfs/ioctl.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c index 3aebb28..b9a0190 100644 --- a/fs/btrfs/ioctl.c +++ b/fs/btrfs/ioctl.c @@ -1447,8 +1447,8

Re: [PATCH] Btrfs: fix crash of starting balance

2013-01-15 Thread Ilya Dryomov
On Tue, Jan 15, 2013 at 10:47:57PM +0800, Liu Bo wrote: > We will crash on BUG_ON(ret == -EEXIST) when we do not resume the existing > balance but attempt to start a new one. > > The steps can be: > 1. start balance > 2. pause balance > 3. start balance > > Signed-off-by: Liu Bo > --- > fs/btrf

Re: [PATCH 2/3] btrfs-progs: libify some parts of btrfs-progs

2013-01-15 Thread Ilya Dryomov
On Mon, Jan 14, 2013 at 03:18:14PM +0100, Arvin Schnell wrote: > > Hi, > > please find attached a patch to make the new libbtrfs usable from > C++ (at least for the parts snapper will likely need). > > Regards, > Arvin > > -- > Arvin Schnell, > Senior Software Engineer, Research & Developme

Re: [PATCH 1/2] Update btrfs filesystem df command

2012-10-03 Thread Ilya Dryomov
On Wed, Oct 03, 2012 at 09:38:52PM +0100, Hugo Mills wrote: > On Wed, Oct 03, 2012 at 11:34:00PM +0300, Ilya Dryomov wrote: > > On Wed, Oct 03, 2012 at 07:22:31PM +0200, Goffredo Baroncelli wrote: > [snip] > > > +static const char * const cmd_disk_free_usage[] = { > > &

Re: [PATCH 1/2] Update btrfs filesystem df command

2012-10-03 Thread Ilya Dryomov
On Wed, Oct 03, 2012 at 07:22:31PM +0200, Goffredo Baroncelli wrote: > From: Goffredo Baroncelli > > The command btrfs filesystem df is used to query the > status of the chunks, how many space on the disk(s) are used by > the chunks, how many space are available in the chunks, and an > est

Re: [PATCH][BTRFS-PROGS][V1] btrfs filesystem df

2012-10-03 Thread Ilya Dryomov
On Wed, Oct 03, 2012 at 10:01:00PM +0200, Goffredo Baroncelli wrote: > On 10/03/2012 07:46 PM, Ilya Dryomov wrote: > >On Wed, Oct 03, 2012 at 06:46:00PM +0200, Goffredo Baroncelli wrote: > >>On 10/03/2012 05:01 PM, Ilya Dryomov wrote: > >>>"Type"

Re: [PATCH][BTRFS-PROGS][V1] btrfs filesystem df

2012-10-03 Thread Ilya Dryomov
On Wed, Oct 03, 2012 at 06:46:00PM +0200, Goffredo Baroncelli wrote: > On 10/03/2012 05:01 PM, Ilya Dryomov wrote: > >"Type" for the first column is probably enough. > > > >Why is the third column called Chunk-size? If my understanding is > >correct, it'

Re: [PATCH 1/2] Update btrfs filesystem df command

2012-10-03 Thread Ilya Dryomov
On Wed, Oct 03, 2012 at 06:34:38PM +0200, Goffredo Baroncelli wrote: > On 10/03/2012 05:02 PM, Ilya Dryomov wrote: > >On Wed, Oct 03, 2012 at 01:43:15PM +0200, Goffredo Baroncelli wrote: > >>The command btrfs filesystem df is used to query the > >>status of the ch

Re: [PATCH 1/2] Update btrfs filesystem df command

2012-10-03 Thread Ilya Dryomov
On Wed, Oct 03, 2012 at 01:43:15PM +0200, Goffredo Baroncelli wrote: > The command btrfs filesystem df is used to query the > status of the chunks, how many space on the disk(s) are used by > the chunks, how many space are available in the chunks, and an > estimation of the free space of the

Re: [PATCH][BTRFS-PROGS][V1] btrfs filesystem df

2012-10-03 Thread Ilya Dryomov
On Wed, Oct 03, 2012 at 01:43:14PM +0200, Goffredo Baroncelli wrote: > This serie of patches updated the command "btrfs filesystem > df". I update this command because it is not so easy to get > the information about the disk usage from the command "fi df" and "fi show". > > >>From the man page (s

Re: [PATCH V4 1/2] Btrfs: cleanup duplicated division functions

2012-09-27 Thread Ilya Dryomov
Hi Miao, You haven't addressed any of my concerns with v3. On Thu, Sep 27, 2012 at 06:19:58PM +0800, Miao Xie wrote: (snipped) > the parameters are right. So besides the code cleanup, this patch also > add a check for the usage of the space balance, it is the only place that > we need add check

Re: [PATCH V3 1/2] Btrfs: cleanup duplicated division functions

2012-09-24 Thread Ilya Dryomov
On Mon, Sep 24, 2012 at 06:47:42PM +0200, David Sterba wrote: > On Mon, Sep 24, 2012 at 10:05:02AM +0800, Miao Xie wrote: > > Generally, we should check the value when it is input. If not, we might > > run our program with the wrong value, and it is possible to cause unknown > > problems. So I thin

Re: [PATCH V3 1/2] Btrfs: cleanup duplicated division functions

2012-09-23 Thread Ilya Dryomov
On Fri, Sep 21, 2012 at 05:07:46PM +0800, Miao Xie wrote: > div_factor{_fine} has been implemented for two times, and these two functions > are very similar, so cleanup the reduplicate implement and drop the original > div_factor(), and then rename div_factor_fine() to div_factor(). So the > divis

Re: [PATCH] Btrfs-progs: btrfs subvolume delete could delete subvolumes

2012-09-21 Thread Ilya Dryomov
On Fri, Sep 21, 2012 at 02:54:08PM +0800, Anand jain wrote: > From: Anand Jain > > With this user will be able to provide more than one subvolume > to delete. > eg: btrfs subvolume delete > > Signed-off-by: Anand Jain > --- > cmds-subvolume.c | 36 > ma

Re: [PATCH 1/2] Btrfs: cleanup duplicated division functions

2012-09-17 Thread Ilya Dryomov
On Mon, Sep 17, 2012 at 10:21:00AM +0800, Miao Xie wrote: > On fri, 14 Sep 2012 15:54:18 +0200, David Sterba wrote: > > On Thu, Sep 13, 2012 at 06:51:36PM +0800, Miao Xie wrote: > >> div_factor{_fine} has been implemented for two times, cleanup it. > >> And I move them into a independent file named

Re: Change "small" filesystem to normal

2012-07-22 Thread Ilya Dryomov
On Sun, Jul 22, 2012 at 05:06:24PM +0200, Swâmi Petaramesh wrote: > Hi, > > I've created a "small" BTRFS filesystem, where metadata+data are mixed > (and metadata are not DUP'ed). > > Then I've enlarged the FS to 1 GB ; now I'd like to make it "normal" > with separate data and metadata, and "DUP'

Re: btrfs fi df won't show total=

2012-07-09 Thread Ilya Dryomov
On Mon, Jul 09, 2012 at 10:06:24PM +0200, Jan Engelhardt wrote: > > On Monday 2012-07-09 21:25, Hugo Mills wrote: > >On Mon, Jul 09, 2012 at 09:14:03PM +0200, Jan Engelhardt wrote: > >> > >> On openSUSE_12.1 with Btrfs v0.19+20120406, the following can be > >> observed: after a change of the prof

Re: [RFC PATCH 4/7] Btrfs: introduce subvol uuids and times

2012-07-05 Thread Ilya Dryomov
On Thu, Jul 05, 2012 at 09:18:41PM +0200, Alexander Block wrote: > On Thu, Jul 5, 2012 at 9:01 PM, Zach Brown wrote: > > On 07/05/2012 11:59 AM, Ilya Dryomov wrote: > > > >> What if you are on a big-endian machine with a big-endian kernel and > >> userspace? Ev

Re: [RFC PATCH 4/7] Btrfs: introduce subvol uuids and times

2012-07-05 Thread Ilya Dryomov
On Thu, Jul 05, 2012 at 11:37:40AM -0700, Zach Brown wrote: > > >and take endianess into account with le{64,32}_to_cpu and > >cpu_to_le{64,32} macros. > > The kernel doesn't support system calls from userspace of a different > endianness, no worries there :) What if you are on a big-endian machi

Re: [RFC PATCH 4/7] Btrfs: introduce subvol uuids and times

2012-07-05 Thread Ilya Dryomov
On Thu, Jul 05, 2012 at 10:20:16AM -0700, Zach Brown wrote: > On 07/05/2012 10:14 AM, Alexander Block wrote: > >On Thu, Jul 5, 2012 at 7:08 PM, Zach Brown wrote: > >> > >>Careful, timespec will be different sizes in 32bit userspace and a 64bit > >>kernel. I'd use btrfs_timespec to get a fixed siz

Re: no dev_stats entry found / OK on first mount after mkfs

2012-07-02 Thread Ilya Dryomov
On Mon, Jul 02, 2012 at 02:46:11PM -0700, Christian Kujau wrote: > Hi, > > after upgrading from 3.4.0 to 3.5.0-rc5 on this powerpc machine, the > following is printed during bootup: > > [ 18.630750] device fsid ce8c9df5-0a93-47c6-adf6-25084f352a4f devid 1 > transid 11061 /dev/hda7 > [ 1

Re: [PATCH 1/3] Btrfs-progs: add support to set subvolume/snapshot readonly

2012-07-02 Thread Ilya Dryomov
On Mon, Jul 02, 2012 at 10:07:42AM +0800, Liu Bo wrote: > On 06/29/2012 06:21 PM, Ilya Dryomov wrote: > > > On Fri, Jun 29, 2012 at 06:00:36PM +0800, Liu Bo wrote: > >> Setting subvolume/snapshot readonly has been missing for a long time. > >> > >> With this

Re: [PATCH 2/3] Btrfs-progs: make get default report correctly

2012-07-02 Thread Ilya Dryomov
On Mon, Jul 02, 2012 at 09:39:45AM +0800, Liu Bo wrote: > On 06/29/2012 06:36 PM, Ilya Dryomov wrote: > > > On Fri, Jun 29, 2012 at 06:00:37PM +0800, Liu Bo wrote: > >> We have both set-default and get-default, but actually our get-default > >> does not sho

Re: [PATCH 2/3] Btrfs-progs: make get default report correctly

2012-06-29 Thread Ilya Dryomov
On Fri, Jun 29, 2012 at 06:00:37PM +0800, Liu Bo wrote: > We have both set-default and get-default, but actually our get-default > does not show which one is the default one. > > This patch plus the kernel side patch fix this. Are you referring to the fact that get-default in Chris' btrfs-progs m

Re: [PATCH 1/3] Btrfs-progs: add support to set subvolume/snapshot readonly

2012-06-29 Thread Ilya Dryomov
On Fri, Jun 29, 2012 at 06:00:36PM +0800, Liu Bo wrote: > Setting subvolume/snapshot readonly has been missing for a long time. > > With this patch, we can set a subvolume/snapshot readonly via: > > obtrfs subvolume set-ro Alexander's 'btrfs property' patches do exactly this, but in a much

Re: [PATCH 1/2] Btrfs: restore restriper state on all mounts

2012-06-26 Thread Ilya Dryomov
First of all, thanks for reviewing! On Tue, Jun 26, 2012 at 06:17:39PM +0200, David Sterba wrote: > On Fri, Jun 22, 2012 at 09:24:12PM +0300, Ilya Dryomov wrote: > > Fix a bug that triggered asserts in btrfs_balance() in both normal and > > resume modes -- restriper state w

[PATCH 0/2] Restriper restore bugfix

2012-06-22 Thread Ilya Dryomov
This fixes restriper restore bug which triggered asserts for users with interrupted balances on rootfs btrfs. Thanks, Ilya Ilya Dryomov (2): Btrfs: restore restriper state on all mounts Btrfs: resume balance on rw (re)mounts properly fs/btrfs/disk-io.c | 39

[PATCH 1/2] Btrfs: restore restriper state on all mounts

2012-06-22 Thread Ilya Dryomov
early writes getting the old profile. Signed-off-by: Ilya Dryomov --- fs/btrfs/disk-io.c | 15 ++- fs/btrfs/volumes.c | 39 +++ fs/btrfs/volumes.h |2 +- 3 files changed, 30 insertions(+), 26 deletions(-) diff --git a/fs/btrfs/disk-io.c b/fs

[PATCH 2/2] Btrfs: resume balance on rw (re)mounts properly

2012-06-22 Thread Ilya Dryomov
This introduces btrfs_resume_balance_async(), which, given that restriper state was recovered earlier by btrfs_recover_balance(), resumes balance in btrfs-balance kthread. Signed-off-by: Ilya Dryomov --- fs/btrfs/disk-io.c | 24 +++- fs/btrfs/super.c |4 fs

[PATCH] Btrfs: do not ignore errors from btrfs_cleanup_fs_roots() when mounting

2012-06-22 Thread Ilya Dryomov
There used to be a BUG_ON(ret) there before EH patch (79787eaa) went in. Bail out with EINVAL. Cc: David Sterba Signed-off-by: Ilya Dryomov --- fs/btrfs/disk-io.c |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c index f06db81

[PATCH] Btrfs: do not return EINVAL instead of ENOMEM from open_ctree()

2012-06-22 Thread Ilya Dryomov
When bailing from open_ctree() err is returned, not ret. Signed-off-by: Ilya Dryomov --- fs/btrfs/disk-io.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c index e1890b1..f06db81 100644 --- a/fs/btrfs/disk-io.c +++ b/fs/btrfs

Re: [PATCH 5/5] Btrfs: fix memory leak in btrfs_pause_balance()

2012-05-17 Thread Ilya Dryomov
On Thu, May 17, 2012 at 07:58:53PM +0800, Miao Xie wrote: > We forget to free fs_info->balance_ctl in the btrfs_pause_balance() > when umounting the fs. > > Signed-off-by: Miao Xie > --- > fs/btrfs/volumes.c |3 +++ > 1 files changed, 3 insertions(+), 0 deletions(-) > > diff --git a/fs/btrf

Re: [PATCH 3/5] Btrfs: pause/recover the space balance when doing remount

2012-05-17 Thread Ilya Dryomov
On Thu, May 17, 2012 at 07:57:40PM +0800, Miao Xie wrote: > pause the space balance threads when remounting the fs to be readonly, > and recover it when remounting it from r/o to r/w > > Signed-off-by: Miao Xie > --- > fs/btrfs/super.c |9 - > fs/btrfs/volumes.c |8 +++- >

Re: [PATCH 2/5] Btrfs: count the chunks which will be relocated at first

2012-05-17 Thread Ilya Dryomov
On Thu, May 17, 2012 at 07:56:53PM +0800, Miao Xie wrote: > the balance function should count the chunks which will be relocated at first, > and then relocate those chunks one by one. > > Signed-off-by: Miao Xie > --- > fs/btrfs/volumes.c |2 +- > 1 files changed, 1 insertions(+), 1 deletion

Re: failed disk (was: kernel 3.3.4 damages filesystem (?))

2012-05-09 Thread Ilya Dryomov
On Wed, May 09, 2012 at 03:37:35PM +0100, Hugo Mills wrote: > On Wed, May 09, 2012 at 04:25:00PM +0200, Helmut Hullen wrote: > > Du meintest am 07.05.12: > > > > [...] > > > > >> With a file system like ext2/3/4 I can work with several directories > > >> which are mounted together, but (as said b

Re: balancing metadata fails with no space left on device

2012-05-06 Thread Ilya Dryomov
On Sun, May 06, 2012 at 01:19:38PM +0200, Martin Steigerwald wrote: > Am Freitag, 4. Mai 2012 schrieb Martin Steigerwald: > > Am Freitag, 4. Mai 2012 schrieb Martin Steigerwald: > > > Hi! > > > > > > merkaba:~> btrfs balance start -m / > > > ERROR: error during balancing '/' - No space left on dev

Re: Is it possible to reclaim block groups once they are allocated to data or metadata?

2012-05-06 Thread Ilya Dryomov
On Sun, May 06, 2012 at 11:37:27AM +0100, Hugo Mills wrote: > On Sun, May 06, 2012 at 01:26:45PM +0300, Ilya Dryomov wrote: > > On Sun, May 06, 2012 at 01:07:06PM +1000, Mike Sampson wrote: > > > There is now 8GB less in Metadata and I was able to delete some files > > &g

Re: Is it possible to reclaim block groups once they are allocated to data or metadata?

2012-05-06 Thread Ilya Dryomov
On Sun, May 06, 2012 at 01:07:06PM +1000, Mike Sampson wrote: > On Sat, May 5, 2012 at 10:52 PM, Hugo Mills wrote: > > On Sat, May 05, 2012 at 10:37:01PM +1000, Mike Sampson wrote: > >> Hello list, > >> > >> recently reformatted my home partition from XFS to RAID1 btrfs. I used > >> the default op

Re: 'filesystem resize max' tries to use devid 1

2012-04-24 Thread Ilya Dryomov
On Tue, Apr 24, 2012 at 11:42:26AM -0400, Josef Bacik wrote: > On Tue, Apr 24, 2012 at 06:39:03PM +0300, Ilya Dryomov wrote: > > On Tue, Apr 24, 2012 at 11:31:15AM -0400, Josef Bacik wrote: > > > On Sun, Apr 22, 2012 at 11:03:06PM -0400, Jeremy Atkins wrote: > > > >

Re: 'filesystem resize max' tries to use devid 1

2012-04-24 Thread Ilya Dryomov
On Tue, Apr 24, 2012 at 11:31:15AM -0400, Josef Bacik wrote: > On Sun, Apr 22, 2012 at 11:03:06PM -0400, Jeremy Atkins wrote: > > Back story: > > I started my pool with a 200gb partition at the end of my drive (sdc5) > > , until I was able to clear out the data at the beginning of my drive. > > Wh

[PATCH] Btrfs: fix max chunk size check in chunk allocator

2012-04-13 Thread Ilya Dryomov
Fix a bug, where in case we need to adjust stripe_size so that the length of the resulting chunk is less than or equal to max_chunk_size, DUP chunks turn out to be only half as big as they could be. Cc: Arne Jansen Signed-off-by: Ilya Dryomov --- fs/btrfs/volumes.c |6 -- 1 files

Re: kernel BUG at fs/btrfs/volumes.c:2733

2012-04-10 Thread Ilya Dryomov
On Fri, Mar 30, 2012 at 10:44:05PM +0200, Sander wrote: > Ilya Dryomov wrote (ao): > > On Fri, Mar 30, 2012 at 07:49:56PM +0200, Sander wrote: > > Thanks. btrfs-debug-tree confirms that you've got a balance item on > > media. > > > > > > > Afte

Re: btrfs 3.2.2 -> 3.3.1 upgrade finally ate babies, some advice?

2012-04-10 Thread Ilya Dryomov
On Tue, Apr 10, 2012 at 01:19:54AM +0200, David Sterba wrote: > On Tue, Apr 10, 2012 at 12:32:00AM +0300, Leho Kraav wrote: > > It is also BUG time WITH the patch. Mount succeeds, but "btrfs fi balance > > HOME" gives us: > > > > Apr 10 00:24:18 server sudo: pam_unix(sudo:session): session opened

[PATCH] Btrfs: remove lock assert from get_restripe_target()

2012-04-09 Thread Ilya Dryomov
needed in future. Reported-by: Bobby Powers Reported-by: Mitch Harder Tested-by: Mitch Harder Signed-off-by: Ilya Dryomov --- fs/btrfs/extent-tree.c |5 ++--- 1 files changed, 2 insertions(+), 3 deletions(-) diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c index a844204..8db0884 10

Re: [PATCH v2] Btrfs, lockdep: get_restripe_target: use lockdep in BUG_ON

2012-04-06 Thread Ilya Dryomov
; !lockdep_is_held(l)) > > We can mimic the structure in get_restripe_target(), but we need to > make sure lockdep_is_held() is defined for the !LOCKDEP case. > > CC: Ilya Dryomov > CC: Chris Mason > CC: Andi Kleen > CC: Jeff Mahoney > CC: Ingo Molnar > CC: linux-ker.

Re: kernel BUG at extent-tree.c:3162 (get_restripe_target)

2012-04-06 Thread Ilya Dryomov
On Fri, Apr 06, 2012 at 10:52:13AM -0500, Mitch Harder wrote: > On Fri, Apr 6, 2012 at 10:43 AM, David Sterba wrote: > > On Fri, Apr 06, 2012 at 10:33:04AM -0500, Mitch Harder wrote: > >> I'm consistently hitting the BUG_ON in the new get_restripe_target > >> function that was added by "[PATCH 4/8

Re: [PATCH v2] Btrfs, lockdep: get_restripe_target: use lockdep in BUG_ON

2012-04-05 Thread Ilya Dryomov
On Thu, Apr 05, 2012 at 12:23:01PM -0400, Bobby Powers wrote: > On Wed, Apr 4, 2012 at 10:04 PM, Bobby Powers wrote: > > spin_is_locked always returns 0 on non-SMP systems, which causes btrfs > > to fail the mount.  There is documentation pending as to why checking > > I guess I should be explici

  1   2   3   >