Re: [PATCH] Btrfs: fix negative qgroup tracking from owner accounting (bug #61951)

2013-11-06 Thread Jan Schmidt
On Mon, November 04, 2013 at 18:42 (+0100), Josef Bacik wrote: > On Thu, Oct 24, 2013 at 03:22:06PM +0200, Jan Schmidt wrote: >> btrfs_dec_ref() queued a delayed ref for owner of a tree block. The qgroup >> tracking is based on delayed refs. The owner of a tree block is set when

Re: btrfs send/receive do not keep inode ctimes

2013-11-01 Thread Jan Schmidt
Hi Karl, On Fri, October 25, 2013 at 15:12 (+0200), Karl Kiniger wrote: > is there low level support to change inode ctimes somehow? > (on ext[234] it can be done using debugfs) No. > It would be nice to make received snapshots as similar as > possible to their send source. (I am not talking abo

Re: [PATCH] Btrfs: fix negative qgroup tracking from owner accounting (bug #61951)

2013-11-01 Thread Jan Schmidt
refs for the non-existent owner, we now > queue delayed refs for the root being removed. This fixes the qgroup > accounting. > > Signed-off-by: Jan Schmidt > Tested-by: > --- > fs/btrfs/extent-tree.c | 14 +- > 1 files changed, 9 insertions(+), 5 deletio

Re: [PATCH] Btrfs: fix negative qgroup tracking from owner accounting (bug #61951)

2013-11-01 Thread Jan Schmidt
(cc Arne) On Thu, October 24, 2013 at 16:49 (+0200), Wang Shilong wrote: > Hello Jan, > >> btrfs_dec_ref() queued a delayed ref for owner of a tree block. The qgroup >> tracking is based on delayed refs. The owner of a tree block is set when a >> tree block is allocated, it is never updated. >> >

Re: [PATCH] Btrfs: fix negative qgroup tracking from owner accounting (bug #61951)

2013-10-24 Thread Jan Schmidt
On Thu, October 24, 2013 at 16:49 (+0200), Wang Shilong wrote: > Hello Jan, > >> btrfs_dec_ref() queued a delayed ref for owner of a tree block. The qgroup >> tracking is based on delayed refs. The owner of a tree block is set when a >> tree block is allocated, it is never updated. >> >> When you

[PATCH] Btrfs: fix negative qgroup tracking from owner accounting (bug #61951)

2013-10-24 Thread Jan Schmidt
being removed. This fixes the qgroup accounting. Signed-off-by: Jan Schmidt Tested-by: --- fs/btrfs/extent-tree.c | 14 +- 1 files changed, 9 insertions(+), 5 deletions(-) diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c index d58bef1..7846cae 100644 --- a/fs/btrfs

Re: [PATCH] Btrfs: use right root when checking for hash collision

2013-10-16 Thread Jan Schmidt
On Wed, October 09, 2013 at 18:26 (+0200), Josef Bacik wrote: > btrfs_rename was using the root of the old dir instead of the root of the new > dir when checking for a hash collision, so if you tried to move a file into a > subvol it would freak out because it would see the file you are trying to m

Re: [PATCH] Btrfs: Don't allocate inode that is already in use

2013-10-16 Thread Jan Schmidt
On Tue, October 15, 2013 at 22:41 (+0200), Zach Brown wrote: >> Probably a bit too obscure to turn this into an xfstest? At least nobody >> complained so far, and this reproducer takes me 1m57 to run, so nothing I >> want >> in each xfstest cycle. > > I disagree. The entire point of regression

Re: [PATCH] Btrfs: Don't allocate inode that is already in use

2013-10-15 Thread Jan Schmidt
--- a/fs/btrfs/inode-map.c > +++ b/fs/btrfs/inode-map.c > @@ -237,7 +237,7 @@ again: > start_caching(root); > > if (objectid <= root->cache_progress || > - objectid > root->highest_objectid) > + objectid >= root->highest_objectid) >

Re: [PATCH] xfstests: btrfs/011 improvement for compressed filesystems

2013-09-27 Thread Jan Schmidt
us failed" > + grep -q canceled $tmp.tmp || _fail "btrfs replace status > (canceled) failed" > else > if [ "${quick}Q" = "thoroughQ" ]; then > # On current hardware, the thoroug

Re: check for reflink capability and for shared data

2013-08-25 Thread Jan Schmidt
On Sat, August 24, 2013 at 18:20 (+0200), Hugo Mills wrote: > On Sat, Aug 24, 2013 at 06:09:58PM +0200, Thomas Koch wrote: >> Hi, >> >> how can I do the following in a shell script: >> >> - check whether my file system supports cp --reflink? > > touch foo; if cp --reflink=always foo bar; then ..

[PATCH v4 2/2] xfstests btrfs/316: test send / receive

2013-08-13 Thread Jan Schmidt
Basic send / receive functionality test for btrfs. Requires current version of fsstress built (-x support). Relies on fssum tool but can skip the test if it failed to build. Signed-off-by: Jan Schmidt Reviewed-by: Josef Bacik --- tests/btrfs/316 | 116

[PATCH v4 0/2] xfstest btrfs/316: test send / receive

2013-08-13 Thread Jan Schmidt
cluded - fixed comment in test/btrfs/316's header (314 -> 316) v3->v4: - build fssum with help of autotools only if libssl is available - removed clumsy OPT_TARGETS in src/Makefile - added #define directives for SEEK_DATA and SEEK_HOLE to fssum.c Jan Schmidt (2): xfstests: add fssum tool

[PATCH v4 1/2] xfstests: add fssum tool

2013-08-13 Thread Jan Schmidt
fssum is a tool to build a recursive checksum for a file system. The home repository of fssum is git://git.kernel.org/pub/scm/linux/kernel/git/arne/far-progs.git Signed-off-by: Jan Schmidt --- .gitignore |1 + aclocal.m4 |1 + configure.ac |1

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

Re: [patch v2 2/2] Btrfs: allocate prelim_ref with a slab allocater

2013-08-09 Thread Jan Schmidt
iewed-by: Miao Xie > --- > V1->V2: > 1.fix a missing allocating case that should be used by > kmem_cache_alloc() > spotted by Jan Schmidt > 2.rename prelim_ref to btrfs_prelim_ref addressed by David > --- > fs/btrfs/backref.c | 33 +++

Re: [PATCH] Btrfs: deal with enomem in the rewind path V3

2013-08-08 Thread Jan Schmidt
On Thu, August 08, 2013 at 16:28 (+0200), David Sterba wrote: > On Thu, Aug 08, 2013 at 09:36:52AM +0200, Jan Schmidt wrote: >> Weird patch formatting concerning extent_io.c, I assume there are no changes >> in >> extent_buffer_under_io and btrfs_release_extent_buffer

Re: [PATCH] Btrfs: stop using GFP_ATOMIC when allocating rewind ebs

2013-08-08 Thread Jan Schmidt
On Thu, August 08, 2013 at 15:12 (+0200), Josef Bacik wrote: > On Thu, Aug 08, 2013 at 09:23:06AM +0200, Jan Schmidt wrote: >> >> On Wed, August 07, 2013 at 23:11 (+0200), Josef Bacik wrote: >>> There is no reason we can't just set the path to blocking and then do no

Re: [PATCH 3/3] Btrfs: allocate prelim_ref with a slab allocater

2013-08-08 Thread Jan Schmidt
On Thu, August 08, 2013 at 07:04 (+0200), Wang Shilong wrote: > struct __prelim_ref is allocated and freed frequently when > walking backref tree, using slab allocater can not only > speed up allocating but also detect memory leaks. > > Signed-off-by: Wang Shilong > Reviewed-by: Miao Xie > ---

Re: [PATCH 2/3] Btrfs: catch error return value from find_extent_in_eb()

2013-08-08 Thread Jan Schmidt
On Thu, August 08, 2013 at 12:24 (+0200), Filipe David Manana wrote: > On Thu, Aug 8, 2013 at 6:04 AM, Wang Shilong > wrote: >> find_extent_in_eb() may return ENOMEM, catch this error return value. >> >> Signed-off-by: Wang Shilong >> Reviewed-by: Miao Xie >> --- >> fs/btrfs/backref.c | 4 ++

Re: [PATCH 1/3] Btrfs: fix possible memory leak in find_parent_nodes()

2013-08-08 Thread Jan Schmidt
On Thu, August 08, 2013 at 07:04 (+0200), Wang Shilong wrote: > Signed-off-by: Wang Shilong > Reviewed-by: Miao Xie > --- > fs/btrfs/backref.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/fs/btrfs/backref.c b/fs/btrfs/backref.c > index cb73a12..54e7610 100644 > ---

[PATCH v3 0/2] xfstest btrfs/316: test send / receive

2013-08-08 Thread Jan Schmidt
epository where fssum.c comes from as well. -- v1->v2: - included fssum - test number is now 316 (was 314) v2->v3: - added missing -lcrypto to build fssum - removed obsolete change in README now that fssum is included - fixed comment in test/btrfs/316's header (314 -> 316) Jan

[PATCH v3 2/2] xfstests btrfs/316: test send / receive

2013-08-08 Thread Jan Schmidt
Basic send / receive functionality test for btrfs. Requires current version of fsstress built (-x support). Relies on fssum tool but can skip the test if it failed to build. Signed-off-by: Jan Schmidt Reviewed-by: Josef Bacik --- tests/btrfs/316 | 113

[PATCH v3 1/2] xfstests: add fssum tool

2013-08-08 Thread Jan Schmidt
sum will just be skipped if fssum wasn't built. Signed-off-by: Jan Schmidt --- .gitignore|1 + common/config |2 + src/Makefile | 11 +- src/fssum.c | 819 + 4 files changed, 832 insertions(+), 1 deletions(-) cre

Re: [PATCH] Btrfs: pass gfp_t to __add_prelim_ref() to avoid always using GFP_ATOMIC

2013-08-08 Thread Jan Schmidt
bytenr, 1, GFP_NOFS); > break; > case BTRFS_EXTENT_DATA_REF_KEY: { > struct btrfs_extent_data_ref *dref; > @@ -770,7 +770,7 @@ static int __add_keyed_refs(struct btrfs_fs_info *fs_info, > key.offset = btrfs_extent_data_ref_off

Re: [PATCH] Btrfs: deal with enomem in the rewind path V3

2013-08-08 Thread Jan Schmidt
; > - /* One for the page private */ > - page_cache_release(page); > - } > - spin_unlock(&page->mapping->private_lock); > - > - } > - if (page

Re: [PATCH] Btrfs: stop using GFP_ATOMIC when allocating rewind ebs

2013-08-08 Thread Jan Schmidt
On Wed, August 07, 2013 at 23:11 (+0200), Josef Bacik wrote: > There is no reason we can't just set the path to blocking and then do normal > GFP_NOFS allocations for these extent buffers. Thanks, > > Signed-off-by: Josef Bacik > --- > fs/btrfs/ctree.c | 16 ++-- > fs/btrfs/

Re: [RFC PATCH v5 4/5] Btrfs: disable qgroups accounting when quota is off

2013-08-05 Thread Jan Schmidt
On Mon, August 05, 2013 at 16:18 (+0200), Liu Bo wrote: > On Mon, Aug 05, 2013 at 02:34:30PM +0200, Jan Schmidt wrote: >> Nice try hiding this one in a dedup patch set, but I finally found it :-) > > A, I didn't mean to ;-) > >> >> On Wed, July 31, 2013 at

Re: [RFC PATCH v5 4/5] Btrfs: disable qgroups accounting when quota is off

2013-08-05 Thread Jan Schmidt
Nice try hiding this one in a dedup patch set, but I finally found it :-) On Wed, July 31, 2013 at 17:37 (+0200), Liu Bo wrote: > So we don't need to do qgroups accounting trick without enabling quota. > This reduces my tester's costing time from ~28s to ~23s. > > Signed-off-by: Liu Bo > --- >

Re: [PATCH v2] Btrfs: add missing error check to find_parent_nodes

2013-07-31 Thread Jan Schmidt
goto out; > + ref->inode_list = eie; > } > ret = ulist_add_merge(refs, ref->parent, > (uintptr_t)ref->inode_list, > The only ret < 0 I'm seeing is ENOMEM, so that sh

Re: Cloning a Btrfs partition

2013-07-30 Thread Jan Schmidt
3.11 and if I got Liu Bo right he's going to send it to 3.10 stable soon. Thanks, -Jan > Thanks! > > -BJ > > - Original Message - > > From: "Jan Schmidt" > Sent: Monday, July 29, 2013 3:21:51 AM > > Hi BJ, > > [original message

Re: [PATCH v3] Btrfs: fix crash regarding to ulist_add_merge

2013-07-29 Thread Jan Schmidt
rbtree_insert(ulist, &ulist->nodes[i]); > + if (ret < 0) > + return ret; > + } > } > ulist->nodes[ulist->nnodes].val = val; > ulist->nodes[ulist->nnodes].aux = aux; > R

Re: Fwd: Cloning a Btrfs partition

2013-07-29 Thread Jan Schmidt
Hi BJ, [original message rewrapped] On Thu, July 25, 2013 at 18:32 (+0200), BJ Quinn wrote: > (Apologies for the double post -- forgot to send as plain text the first time > around, so the list rejected it.) > > I see that there's now a btrfs send / receive and I've tried using it, but > I'm get

[PATCH v2 0/2] xfstest btrfs/316: test send / receive (was: btrfs/314)

2013-07-24 Thread Jan Schmidt
n the far-progs repository where fssum.c comes from as well. Jan Schmidt (2): xfstests: add fssum tool xfstests btrfs/316: test send / receive .gitignore |1 + README |3 + common/config |2 + src/Makefile| 11 +- src/fssum.c

[PATCH v2 2/2] xfstests btrfs/316: test send / receive

2013-07-24 Thread Jan Schmidt
Basic send / receive functionality test for btrfs. Requires current version of fsstress built (-x support). Relies on fssum tool but can skip the test if it failed to build. Signed-off-by: Jan Schmidt --- README |3 + tests/btrfs/316 | 113

[PATCH v2 1/2] xfstests: add fssum tool

2013-07-24 Thread Jan Schmidt
sum will just be skipped if fssum wasn't built. Signed-off-by: Jan Schmidt --- .gitignore|1 + common/config |2 + src/Makefile | 11 +- src/fssum.c | 819 + 4 files changed, 832 insertions(+), 1 deletions(-) cre

Re: [PATCH] Btrfs: fix extent buffer leak after backref walking

2013-07-03 Thread Jan Schmidt
and end up with extent buffer leak. > > Signed-off-by: Liu Bo Reviewed-by: Jan Schmidt > --- > fs/btrfs/ctree.c |2 +- > 1 files changed, 1 insertions(+), 1 deletions(-) > > diff --git a/fs/btrfs/ctree.c b/fs/btrfs/ctree.c > index 02fae7f..3d790b4 100644 > --- a

Re: [PATCH] Btrfs: only do the tree_mod_log_free_eb if this is our last ref

2013-07-02 Thread Jan Schmidt
block. With this > patch > I no longer hit the panic in __tree_mod_log_rewind. Thanks, > > Signed-off-by: Josef Bacik Strange that never really popped up largely so far, should be quite easy to hit. Anyway, Reviewed-by: Jan Schmidt > --- > fs/btrfs/ctree.c |3 ++- >

Re: [PATCH] Btrfs: stop using GFP_ATOMIC for the tree mod log allocations

2013-07-02 Thread Jan Schmidt
On Mon, July 01, 2013 at 22:25 (+0200), Josef Bacik wrote: > Previously we held the tree mod lock when adding stuff because we use it to > check and see if we truly do want to track tree modifications. This is > admirable, but GFP_ATOMIC in a critical area that is going to get hit pretty > hard an

Re: [PATCH] Btrfs: hold the tree mod lock in __tree_mod_log_rewind

2013-07-02 Thread Jan Schmidt
On Sun, June 30, 2013 at 15:55 (+0200), Josef Bacik wrote: > On Sun, Jun 30, 2013 at 10:25:05AM +0200, Jan Schmidt wrote: >> On 30.06.2013 05:17, Josef Bacik wrote: >>> We need to hold the tree mod log lock in __tree_mod_log_rewind since we walk >>> forward in the tree m

Re: [PATCH] Btrfs: hold the tree mod lock in __tree_mod_log_rewind

2013-06-30 Thread Jan Schmidt
On 30.06.2013 05:17, Josef Bacik wrote: > We need to hold the tree mod log lock in __tree_mod_log_rewind since we walk > forward in the tree mod entries, otherwise we'll end up with random entries > and > trip the BUG_ON() at the front of __tree_mod_log_rewind. This fixes the > panics > people w

Re: [PATCH 0/3] Btrfs: qgroup rescan fixes for next rc

2013-06-10 Thread Jan Schmidt
Hi Chris, I know, Linus is turning grumpy again. I'd still feel better if we sent this patch set for the very next rc now. Any particular objections? -Jan On Tue, May 28, 2013 at 17:47 (+0200), Jan Schmidt wrote: > Here are three fixes for the new qgroup rescan feature. The first t

Re: [PATCH] xfstests btrfs/314: test send / receive

2013-06-07 Thread Jan Schmidt
On Fri, June 07, 2013 at 16:51 (+0200), Arne Jansen wrote: > On 07.06.2013 16:50, Eric Sandeen wrote: >> On 6/7/13 5:29 AM, Dave Chinner wrote: >>> On Fri, Jun 07, 2013 at 09:18:58AM +0200, Jan Schmidt wrote: >>>> (cc Arne for far-progs discussion) >>>>

Re: [PATCH] xfstests btrfs/314: test send / receive

2013-06-07 Thread Jan Schmidt
(cc Arne for far-progs discussion) On Thu, June 06, 2013 at 19:54 (+0200), Eric Sandeen wrote: > On 6/6/13 10:20 AM, Jan Schmidt wrote: >> Basic send / receive functionality test for btrfs. Requires current >> version of fsstress built (-x support). Relies on fssum tool, which is

[PATCH] xfstests btrfs/314: test send / receive

2013-06-06 Thread Jan Schmidt
Basic send / receive functionality test for btrfs. Requires current version of fsstress built (-x support). Relies on fssum tool, which is not part of the test suite but can skip the test if it is missing. Signed-off-by: Jan Schmidt --- README |3 + common/config |2

Re: [PATCH 0/3] Btrfs: qgroup rescan fixes for next rc

2013-05-28 Thread Jan Schmidt
Hi Wang, Please have a look at these patches, you should have been CCed but I just realized git send-email doesn't care about Cc lines in the patch file. Sigh. Thanks, -Jan -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to majord...@vger.kernel.

[PATCH 2/3] Btrfs: avoid double free of fs_info->qgroup_ulist

2013-05-28 Thread Jan Schmidt
ed error paths, turning the ulist_free in btrfs_free_qgroup_config into a noop. Cc: Wang Shilong Signed-off-by: Jan Schmidt --- fs/btrfs/qgroup.c |8 ++-- 1 files changed, 6 insertions(+), 2 deletions(-) diff --git a/fs/btrfs/qgroup.c b/fs/btrfs/qgroup.c index 74b432d..c6ce642 100644

[PATCH 1/3] Btrfs: fix memory patcher through fs_info->qgroup_ulist

2013-05-28 Thread Jan Schmidt
e a check for (ret < 0) would have been the right choice. This commit fixes the check. Cc: Wang Shilong Signed-off-by: Jan Schmidt --- fs/btrfs/qgroup.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/fs/btrfs/qgroup.c b/fs/btrfs/qgroup.c index d059d86..74b432d 100644 --

[PATCH 3/3] Btrfs: fix qgroup rescan resume on mount

2013-05-28 Thread Jan Schmidt
the rescan progress during btrfs_qgroup_account_ref, which is no longer required due to having step 2 from the list above. As a side effect, this commit prepares to move the rescan start code from btrfs_run_qgroups (which is run during commit) to a less time critical section. Signed-off-by: J

[PATCH 0/3] Btrfs: qgroup rescan fixes for next rc

2013-05-28 Thread Jan Schmidt
code change that need not be split artifically in my opinion. Jan Schmidt (3): Btrfs: fix memory patcher through fs_info->qgroup_ulist Btrfs: avoid double free of fs_info->qgroup_ulist Btrfs: fix qgroup rescan resume on mount fs/btrfs/ctree.h |2 + fs/btrfs/disk-io.c |2

Re: hard freezes with 3.9.0 during io-intensive loads

2013-05-17 Thread Jan Schmidt
On Thu, May 16, 2013 at 09:19 (+0200), Kai Krakow wrote: > 3.9.2 still does not fix anything. I'll go with autodefrag=off for the > moment until I hear some news in that regard. With this new information, is > it still helpful to get a metadata image from me? It should be reproducable > if you e

Re: hard freezes with 3.9.0 during io-intensive loads

2013-05-10 Thread Jan Schmidt
On Fri, May 10, 2013 at 01:30 (+0200), Kai Krakow wrote: > Jan Schmidt schrieb: > >>> Apparently, it's not fixed. The system does not freeze now but it threw >>> multiple backtraces right in front of my Xorg session. The backtraces >>> look a littl

Re: hard freezes with 3.9.0 during io-intensive loads

2013-05-08 Thread Jan Schmidt
On Wed, May 08, 2013 at 02:24 (+0200), Kai Krakow wrote: > Kai Krakow schrieb: > I can reliably reproduce it from two different approaches. I'd like to only apply the commits fixing it. Can you name them here? >>> >>> In git log order: >>> >>> 6ced2666 Btrfs: separate sequence numbers f

Re: Kernel BUG: __tree_mod_log_rewind

2013-05-07 Thread Jan Schmidt
r apply the commits mentioned in my previous email today: On Tue, May 07, 2013 at 08:08 (+0200), Jan Schmidt wrote: > In git log order: > > 6ced2666 Btrfs: separate sequence numbers for delayed ref tracking and tree > mod log > ef9120b1 Btrfs: fix tree mod log regression on root split o

Re: [PATCH] Btrfs: fix passing wrong arg gfp_t to decide the correct allocation mode

2013-05-07 Thread Jan Schmidt
On Tue, May 07, 2013 at 08:20 (+0200), Wang Shilong wrote: > If you look the code carefully, you will see all the tree_mod_alloc() > has to use GFP_ATOMIC. However, the original code pass the wrong arg > gfp_t in some places, this dosen't cause any problems, because in the > tree_mod_alloc(), it ig

Re: [PATCH] Btrfs: save us a mutex_lock usage when doing quota rescan

2013-05-07 Thread Jan Schmidt
essary. > > Just remove this check, so that we don't need hold qgroup_rescan_lock > when doing qgroup accounting. NAK. After a discussion on that lock the last thing in this thread I see is ... On Wed, May 01, 2013 at 13:57 (+0200), Jan Schmidt wrote: > Now I see what you mean.

Re: [PATCH] Btrfs: add ioctl to wait for qgroup rescan completion

2013-05-06 Thread Jan Schmidt
On Mon, May 06, 2013 at 23:20 (+0200), David Sterba wrote: > On Mon, May 06, 2013 at 09:14:17PM +0200, Jan Schmidt wrote: >> --- a/include/uapi/linux/btrfs.h >> +++ b/include/uapi/linux/btrfs.h >> @@ -530,6 +530,7 @@ struct btrfs_ioctl_send_args { >>

Re: hard freezes with 3.9.0 during io-intensive loads

2013-05-06 Thread Jan Schmidt
On Mon, May 06, 2013 at 22:29 (+0200), Kai Krakow wrote: > Jan Schmidt schrieb: > >> That one should be fixed in btrfs-next. If you can reliably reproduce the >> bug I'd be glad to get a confirmation - you can probably even save putting >> it on bugzilla then ;-) >

[PATCH] Btrfs: add ioctl to wait for qgroup rescan completion

2013-05-06 Thread Jan Schmidt
btrfs_qgroup_wait_for_completion waits until the currently running qgroup operation completes. It returns immediately when no rescan process is in progress. This is useful to automate things around the rescan process (e.g. testing). Signed-off-by: Jan Schmidt --- fs/btrfs/ctree.h

[PATCH 2/2] Btrfs-progs: added "btrfs quota rescan" -w switch (wait)

2013-05-06 Thread Jan Schmidt
With -w one can wait for a rescan operation to finish. It can be used when starting a rescan operation or later to wait for the currently running rescan operation to finish. Waiting is interruptible. Signed-off-by: Jan Schmidt --- cmds-quota.c | 19 +-- ioctl.h |1

[PATCH 1/2] Btrfs-progs: fixup: add flags to struct btrfs_ioctl_quota_rescan_args

2013-05-06 Thread Jan Schmidt
The patch set previously sent was sent together with the kernel part, but was not updated as I added some reserved bytes to the ioctl struct for future compatibility. This fixes struct btrfs_ioctl_quota_rescan_args. Signed-off-by: Jan Schmidt --- ioctl.h |1 + 1 files changed, 1 insertions

Btrfs: wait for quota rescan to complete

2013-05-06 Thread Jan Schmidt
Two small patches, one for the kernel and one for the user mode. Both required to support waiting for quota rescan to complete. Jan Schmidt (1): Btrfs: add ioctl to wait for qgroup rescan completion fs/btrfs/ctree.h |2 ++ fs/btrfs/ioctl.c | 12 fs/btrfs

Re: hard freezes with 3.9.0 during io-intensive loads

2013-05-06 Thread Jan Schmidt
On Sun, May 05, 2013 at 18:10 (+0200), Kai Krakow wrote: > Hello list, > > Kai Krakow schrieb: > >> I've upgraded to 3.9.0 mainly for the snapshot-aware defragging patches. >> I'm running bedup[1] on a regular basis and it is now the third time that >> I got back to my PC just to find it hard-fr

Re: Possible to dedpulicate read-only snapshots for space-efficient backups

2013-05-05 Thread Jan Schmidt
On Sun, May 05, 2013 at 12:07 (+0200), Kai Krakow wrote: > I'm using an bash/rsync script[1] to backup my whole system on a nightly > basis to an attached USB3 drive into a scratch area, then take a snapshot of > this area. I'd like to have these snapshots immutable, so they should be > read-onl

Re: [PATCH] Btrfs: use arg gfp_mask to decide how to allocate tree mod

2013-05-05 Thread Jan Schmidt
On Sun, May 05, 2013 at 15:58 (+0200), Wang Shilong wrote: > It seems the original code doesn't pass the right arg gfp_t to decide how to > allocate. > Just applying this patch, fsstress will fail. So please ignore this patch, > will resend later.. That's in fact what the comment above the line

Re: [PATCH v4 2/3] Btrfs: rescan for qgroups

2013-05-01 Thread Jan Schmidt
t;> the >>>> next mount. Status information is provided with a separate ioctl while a >>>> rescan operation is in progress. >>>> >>>> Signed-off-by: Jan Schmidt >>>> --- >>>> fs/btrfs/ctree.h | 17 ++- >>>> fs/btr

Re: [PATCH v4 2/3] Btrfs: rescan for qgroups

2013-05-01 Thread Jan Schmidt
be used unless required. >> >> A filesystem under rescan can still be umounted. The rescan continues on the >> next mount. Status information is provided with a separate ioctl while a >> rescan operation is in progress. >> >> Signed-off-by: Jan Schmidt >>

[BUG] crash after failed mount of btrfs-image

2013-04-29 Thread Jan Schmidt
Hi Josef, tried your btrfs-image tool (which didn't work for me but that's not that important). # ~/btrfs-image /dev/sdt1 /var/tmp/janosch.btrfsimage # mount -o loop /var/tmp/janosch.btrfsimage /mnt/test mount: you must specify the filesystem type Doesn't mount, okay. Use -r: # ~/btrfs-image -r

Re: [PATCH] xfstests: btrfs/276 - stop all fsstress before exiting

2013-04-26 Thread Jan Schmidt
On Fri, April 26, 2013 at 07:29 (+0200), Eric Sandeen wrote: > Tests after 276 were failing because the background fsstress > hadn't quit prior to exit, devices couldn't be unmounted, etc. I don't see how that would happen. Any further insight? > Just use the same trick as generic/068 does, and u

[PATCH v4 2/3] Btrfs: rescan for qgroups

2013-04-25 Thread Jan Schmidt
next mount. Status information is provided with a separate ioctl while a rescan operation is in progress. Signed-off-by: Jan Schmidt --- fs/btrfs/ctree.h | 17 ++- fs/btrfs/disk-io.c |5 + fs/btrfs/ioctl.c | 83 ++-- fs/btrfs/qgroup.c | 318

[PATCH v4 1/3] Btrfs: split btrfs_qgroup_account_ref into four functions

2013-04-25 Thread Jan Schmidt
The function is separated into a preparation part and the three accounting steps mentioned in the qgroups documentation. The goal is to make steps two and three usable by the rescan functionality. A side effect is that the function is restructured into readable subunits. Signed-off-by: Jan

[PATCH v4 3/3] Btrfs: automatic rescan after "quota enable" command

2013-04-25 Thread Jan Schmidt
When qgroup tracking is enabled, we do an automatic cycle of the new rescan mechanism. Signed-off-by: Jan Schmidt --- fs/btrfs/qgroup.c | 11 +++ 1 files changed, 11 insertions(+), 0 deletions(-) diff --git a/fs/btrfs/qgroup.c b/fs/btrfs/qgroup.c index 664d457..1df4db5 100644 --- a

[PATCH v4 0/3] Btrfs: quota rescan for 3.10

2013-04-25 Thread Jan Schmidt
ioctl_quota_rescan_args - changed modification to unused #define BTRFS_QUOTA_CTL_RESCAN - added missing (unsigned long long) casts for pr_debug - more detailed commit messages Jan Schmidt (3): Btrfs: split btrfs_qgroup_account_ref into four functions Btrfs: rescan for qgroups Btrfs: automat

Re: [PATCH v3 2/3] Btrfs: rescan for qgroups

2013-04-25 Thread Jan Schmidt
On Thu, April 25, 2013 at 04:16 (+0200), Wang Shilong wrote: > I just have an example in my mind, considering the following example: > > qgroup(1/1) > / \ >/\ > subv(257) snapsho

[PATCH v2] Btrfs: separate sequence numbers for delayed ref tracking and tree mod log

2013-04-24 Thread Jan Schmidt
cking can occasionally go wrong and WARN_ONs from the tree mod log code may happen. Signed-off-by: Jan Schmidt --- Changes v1->v2: - added spin lock and comment around btrfs_inc_tree_mod_seq_minor (to make Josef happy in case I get "hit by a bus and somebody tries to change it later&

Re: [PATCH v3 2/3] Btrfs: rescan for qgroups

2013-04-24 Thread Jan Schmidt
On Wed, April 24, 2013 at 13:00 (+0200), Wang Shilong wrote: > Hello Jan, > > [snip] > >> +/* >> + * returns < 0 on error, 0 when more leafs are to be scanned. >> + * returns 1 when done, 2 when done and FLAG_INCONSISTENT was cleared. >> + */ >> +static int >> +qgroup_rescan_leaf(struct qgroup_re

Re: [PATCH] Btrfs: separate sequence numbers for delayed ref tracking and tree mod log

2013-04-24 Thread Jan Schmidt
On Wed, April 24, 2013 at 15:40 (+0200), Josef Bacik wrote: > On Wed, Apr 24, 2013 at 07:25:09AM -0600, Jan Schmidt wrote: >> On Wed, April 24, 2013 at 15:04 (+0200), Josef Bacik wrote: >>> On Tue, Apr 23, 2013 at 12:00:27PM -0600, Jan Schmidt wrote: >>>> Sequence

Re: [PATCH] Btrfs: separate sequence numbers for delayed ref tracking and tree mod log

2013-04-24 Thread Jan Schmidt
On Wed, April 24, 2013 at 15:04 (+0200), Josef Bacik wrote: > On Tue, Apr 23, 2013 at 12:00:27PM -0600, Jan Schmidt wrote: >> Sequence numbers for delayed refs have been introduced in the first version >> of the qgroup patch set. To solve the problem of find_all_roots on a busy >

Re: [PATCH] Btrfs: separate sequence numbers for delayed ref tracking and tree mod log

2013-04-24 Thread Jan Schmidt
On Wed, April 24, 2013 at 10:12 (+0200), Liu Bo wrote: > On Tue, Apr 23, 2013 at 08:00:27PM +0200, Jan Schmidt wrote: >> Sequence numbers for delayed refs have been introduced in the first version >> of the qgroup patch set. To solve the problem of find_all_roots on a busy >>

[PATCH] Btrfs: separate sequence numbers for delayed ref tracking and tree mod log

2013-04-23 Thread Jan Schmidt
occasionally go wrong and WARN_ONs from the tree mod log code may happen. Signed-off-by: Jan Schmidt --- fs/btrfs/ctree.c | 36 +--- fs/btrfs/ctree.h |7 ++- fs/btrfs/delayed-ref.c |6 -- fs/btrfs/disk-io.c |2 +- fs/b

Re: [PATCH v3 2/3] Btrfs: rescan for qgroups

2013-04-23 Thread Jan Schmidt
On Tue, April 23, 2013 at 16:54 (+0200), Wang Shilong wrote: > > Hello Jan, > >> >> +static void btrfs_qgroup_rescan_worker(struct btrfs_work *work) >> +{ >> +struct qgroup_rescan *qscan = container_of(work, struct qgroup_rescan, >> + work); >>

Re: [PATCH v3 3/3] Btrfs: automatic rescan after "quota enable" command

2013-04-23 Thread Jan Schmidt
On Tue, April 23, 2013 at 17:36 (+0200), David Sterba wrote: > On Tue, Apr 23, 2013 at 01:26:51PM +0200, Jan Schmidt wrote: >> --- a/fs/btrfs/qgroup.c >> +++ b/fs/btrfs/qgroup.c >> @@ -1494,10 +1494,14 @@ int btrfs_run_qgroups(struct btrfs_trans_handle >> *trans, >

Re: [PATCH v3 2/3] Btrfs: rescan for qgroups

2013-04-23 Thread Jan Schmidt
On Tue, April 23, 2013 at 14:05 (+0200), Wang Shilong wrote: > Hello Jan, > > [..snip..] > > > >> /* >> * the delayed ref sequence number we pass depends on the direction of >> * the operation. for add operations, we pass (node->seq - 1) to skip >> @@ -1401,7 +1428,17 @@ int bt

[PATCH v3 2/3] Btrfs: rescan for qgroups

2013-04-23 Thread Jan Schmidt
next mount. Status information is provided with a separate ioctl while a rescan operation is in progress. Signed-off-by: Jan Schmidt --- fs/btrfs/ctree.h | 17 ++- fs/btrfs/disk-io.c |5 + fs/btrfs/ioctl.c | 83 ++-- fs/btrfs/qgroup.c | 312

[PATCH v3 0/3] Btrfs: quota rescan for 3.10

2013-04-23 Thread Jan Schmidt
ght schedule - fix kzalloc error checking - add some reserved ints to struct btrfs_ioctl_quota_rescan_args - changed modification to unused #define BTRFS_QUOTA_CTL_RESCAN - added missing (unsigned long long) casts for pr_debug - more detailed commit messages Jan Schmidt (3): Btrfs: split btrfs_qg

[PATCH v3 1/3] Btrfs: split btrfs_qgroup_account_ref into four functions

2013-04-23 Thread Jan Schmidt
The function is separated into a preparation part and the three accounting steps mentioned in the qgroups documentation. The goal is to make steps two and three usable by the rescan functionality. A side effect is that the function is restructured into readable subunits. Signed-off-by: Jan

[PATCH v3 3/3] Btrfs: automatic rescan after "quota enable" command

2013-04-23 Thread Jan Schmidt
When qgroup tracking is enabled, we do an automatic cycle of the new rescan mechanism. Signed-off-by: Jan Schmidt --- fs/btrfs/qgroup.c | 10 ++ 1 files changed, 10 insertions(+), 0 deletions(-) diff --git a/fs/btrfs/qgroup.c b/fs/btrfs/qgroup.c index 249dd64..b1ae0ab 100644 --- a/fs

Re: [BUG REPORT] Kernel panic on 3.9.0-rc7-4-gbb33db7

2013-04-19 Thread Jan Schmidt
On Fri, April 19, 2013 at 07:57 (+0200), Tejun Heo wrote: > (cc'ing btrfs people) > > On Fri, Apr 19, 2013 at 11:33:20AM +0800, Wanlong Gao wrote: >> RIP: 0010:[] [] >> ftrace_raw_event_block_bio_complete+0x73/0xf0 > ... >> [] bio_endio+0x80/0x90 >> [] btrfs_end_bio+0xf6/0x190 [btrfs] >> [] b

Re: [PATCH v2 2/3] Btrfs: rescan for qgroups

2013-04-17 Thread Jan Schmidt
On Tue, April 16, 2013 at 14:22 (+0200), Wang Shilong wrote: > > Hello Jan, more comments below.. > > [...snip..] > >> >> + >> +static long btrfs_ioctl_quota_rescan_status(struct file *file, void __user >> *arg) >> +{ >> +struct btrfs_root *root = BTRFS_I(fdentry(file)->d_inode)->root; >>

Re: [PATCH v2 2/3] Btrfs: rescan for qgroups

2013-04-16 Thread Jan Schmidt
On Tue, April 16, 2013 at 12:08 (+0200), Wang Shilong wrote: > Hello Jan, > > >> slot = path->slots[0]; >> ptr = btrfs_item_ptr(l, slot, struct btrfs_qgroup_status_item); >> +spin_lock(&fs_info->qgroup_lock); > > > Why we need hold qgroup_lock here? would you please explain... I

Re: [PATCH v2 2/3] Btrfs: rescan for qgroups

2013-04-16 Thread Jan Schmidt
hould not be used unless required. >> >> A filesystem under rescan can still be umounted. The rescan continues on the >> next mount. Status information is provided with a separate ioctl while a >> rescan operation is in progress. >> >> Signed-off-by: Jan Schmidt &

Re: [PATCH v2 1/3] Btrfs: split btrfs_qgroup_account_ref into four functions

2013-04-16 Thread Jan Schmidt
On Tue, April 16, 2013 at 11:20 (+0200), Wang Shilong wrote: > Hello Jan, > >> The function is separated into a preparation part and the three accounting >> steps mentioned in the qgroups documentation. The goal is to make steps two >> and three usable by the rescan functionality. A side effect is

[PATCH v2 1/3] Btrfs: split btrfs_qgroup_account_ref into four functions

2013-04-16 Thread Jan Schmidt
The function is separated into a preparation part and the three accounting steps mentioned in the qgroups documentation. The goal is to make steps two and three usable by the rescan functionality. A side effect is that the function is restructured into readable subunits. Signed-off-by: Jan

[PATCH v2 3/3] Btrfs: automatic rescan after "quota enable" command

2013-04-16 Thread Jan Schmidt
When qgroup tracking is enabled, we do an automatic cycle of the new rescan mechanism. Signed-off-by: Jan Schmidt --- fs/btrfs/qgroup.c | 10 ++ 1 files changed, 10 insertions(+), 0 deletions(-) diff --git a/fs/btrfs/qgroup.c b/fs/btrfs/qgroup.c index bb081b5..0ea2c3e 100644 --- a/fs

[PATCH v2 2/3] Btrfs: rescan for qgroups

2013-04-16 Thread Jan Schmidt
next mount. Status information is provided with a separate ioctl while a rescan operation is in progress. Signed-off-by: Jan Schmidt --- fs/btrfs/ctree.h | 17 ++- fs/btrfs/disk-io.c |6 + fs/btrfs/ioctl.c | 83 ++-- fs/btrfs/qgroup.c | 295

[PATCH v2 0/3] Btrfs: quota rescan for 3.10

2013-04-16 Thread Jan Schmidt
UOTA_CTL_RESCAN - added missing (unsigned long long) casts for pr_debug - more detailed commit messages Jan Schmidt (3): Btrfs: split btrfs_qgroup_account_ref into four functions Btrfs: rescan for qgroups Btrfs: automatic rescan after "quota enable" command fs/btrfs/ctree.h

Re: [PATCH] Btrfs: return error when we specify wrong start

2013-04-16 Thread Jan Schmidt
On Tue, April 16, 2013 at 10:40 (+0200), Liu Bo wrote: > We need such a sanity check for wrong start, otherwise, even with > a wrong start that's larger than file size, we can end up not only > changing inode's force compress flag but also FS's incompat flags. That reads out very cryptic. Can you

Re: [PATCH 1/2] Btrfs: rescan for qgroups

2013-04-14 Thread Jan Schmidt
On Mon, April 15, 2013 at 08:08 (+0200), Wang Shilong wrote: > Hello Jan, > >> On Mon, April 15, 2013 at 07:44 (+0200), Jan Schmidt wrote: >>> Thanks, v2 to come. >> >> Uh, but not immediately. I didn't get tracking of "exclusive" right.

Re: [PATCH 1/2] Btrfs: rescan for qgroups

2013-04-14 Thread Jan Schmidt
On Mon, April 15, 2013 at 07:44 (+0200), Jan Schmidt wrote: > Thanks, v2 to come. Uh, but not immediately. I didn't get tracking of "exclusive" right. That will need some time to fix and test. -Jan -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs&qu

Re: [PATCH 1/2] Btrfs: rescan for qgroups

2013-04-14 Thread Jan Schmidt
On Wed, April 10, 2013 at 18:47 (+0200), David Sterba wrote: > On Fri, Apr 05, 2013 at 01:38:16PM +0200, Jan Schmidt wrote: >> +if (root->fs_info->qgroup_flags & BTRFS_QGROUP_STATUS_FLAG_RESCAN) { > > I was wondering if merging qgroup_flags with fs_state would make

  1   2   3   4   5   6   >