There's a race condition that leads to a NULL pointer dereference if you
disable quotas while a quota rescan is running. To fix this, we just need
to wait for the quota rescan worker to actually exit before tearing down
the quota structures.
Signed-off-by: Justin Maggard <jmagg...@netgear.
In read_one_chunk(), we may add an empty entry for a missing device.
However, this entry wasn't being added to the dev_list, and so it never
got freed.
Signed-off-by: Justin Maggard <jmagg...@netgear.com>
---
volumes.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/volumes.c b/vol
: Fix a bug causing btrfs-find-root to skip
first chunk)
Signed-off-by: Justin Maggard <jmagg...@netgear.com>
---
volumes.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/volumes.c b/volumes.c
index b350e259..8c0c10ce 100644
--- a/volumes.c
+++ b/volumes.c
@@ -1278,6 +1278,8
On Thu, Jul 28, 2016 at 10:44:11AM -0700, Justin Maggard wrote:
> In read_one_chunk(), we may add an empty entry for a missing device.
> However, this entry wasn't being added to the dev_list, and so it never
> got freed.
>
> Signed-off-by: Justin Maggard <jmagg...@netgear.com
that situation, and
> jumping to the next bg if necessary.
>
> Fixes: e2e0dae9 (btrfs-progs: volume: Fix a bug causing btrfs-find-root to
> skip first chunk)
> Signed-off-by: Justin Maggard <jmagg...@netgear.com>
Applied, thanks. Do you have a minimal image for testing?
--
is good enough to allow me to unmount without
crashing.
Signed-off-by: Justin Maggard <jmagg...@netgear.com>
---
fs/btrfs/qgroup.c | 9 ++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/fs/btrfs/qgroup.c b/fs/btrfs/qgroup.c
index d904ee1..5bfcee9 100644
--- a/fs/btrfs/qg
, but that's a much larger
change. This small change is good enough to allow me to unmount without
crashing.
Signed-off-by: Justin Maggard <jmagg...@netgear.com>
---
fs/btrfs/qgroup.c | 9 ++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/fs/btrfs/qgroup.c b/fs
we're left with
both the qgroup and qgroup reservation accounting for the same space.
This commit adds the missing btrfs_qgroup_free_data() call in the case of
BTRFS_ORDERED_PREALLOC extents.
Signed-off-by: Justin Maggard <jmagg...@netgear.com>
---
fs/btrfs/inode.c | 2 ++
1 file chan
unmount without
> crashing.
>
> Signed-off-by: Justin Maggard <jmagg...@netgear.com>
Can you please submit the test you've used to trigger the crash to
fstests?
Reviewed-by: David Sterba <dste...@suse.com>
--
To unsubscribe from this list: send the line "unsubscribe linux-
t; > dirty roots not recorded in current transaction, making root item of
> > source subvolume not updated.
> >
> > Fix it by forcing recording source subvolume in current transaction
> > before qgroup sub-transaction commit.
> >
> > Reported-by: Justin Magga
is good enough to allow me to unmount without
crashing.
v3: avoid more races by calling btrfs_qgroup_wait_for_completion()
Signed-off-by: Justin Maggard <jmagg...@netgear.com>
---
fs/btrfs/disk-io.c | 3 +++
fs/btrfs/qgroup.c | 9 ++---
2 files changed, 9 insertions(+), 3 deletions(-)
This test case tests if we are able to unmount a filesystem while
a quota rescan is running. Up to now (4.3) this would result
in a kernel NULL pointer dereference.
Fixed by patch (btrfs: qgroup: exit the rescan worker during umount).
Signed-off-by: Justin Maggard <jmagg...@netgear.
This test case tests if we are able to disable quotas on a filesystem
while a quota rescan is running. Up to now (4.3) this would result
in a kernel NULL pointer dereference.
Fixed by patch (btrfs: qgroup: fix quota disable during rescan).
Signed-off-by: Justin Maggard <jmagg...@netgear.
quota reservation
leak on preallocated files"
Signed-off-by: Justin Maggard <jmagg...@netgear.com>
---
tests/btrfs/153 | 72 +
tests/btrfs/153.out | 2 ++
tests/btrfs/group | 1 +
3 files changed, 75 insertions(+)
create mode 100755
.3) this would result
> > in a kernel NULL pointer dereference.
> >
> > Fixed by patch (btrfs: qgroup: fix quota disable during rescan).
> >
> > Signed-off-by: Justin Maggard <jmagg...@netgear.com>
> Reviewed-by: Filipe Manana <fdman...@suse.com>
>
> Look
small change is good enough to allow me to unmount without
>> crashing.
>>
>> Signed-off-by: Justin Maggard <jmagg...@netgear.com>
>
> Can you please submit the test you've used to trigger the crash to
> fstests?
>
Sure, I've got a reproducer coded up for xfstests now.
-by: Justin Maggard <jmagg...@netgear.com>
Signed-off-by: Qu Wenruo <w...@suse.com>
---
fs/btrfs/transaction.c | 10 +-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/fs/btrfs/transaction.c b/fs/btrfs/transaction.c
index ddae813c01dd..f645e5de5fa5 100644
--- a/fs/btrfs/t
xtents.
>
> Signed-off-by: Justin Maggard <jmagg...@netgear.com>
Reviewed-by: Qu Wenruo <w...@suse.com>
Thanks,
Qu
> ---
> fs/btrfs/inode.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c
> index d94e3
) as the culprit.
Signed-off-by: Justin Maggard <jmagg...@netgear.com>
---
tests/btrfs/152 | 102
tests/btrfs/152.out | 13 +++
tests/btrfs/group | 1 +
3 files changed, 116 insertions(+)
create mode 100755 tests/btrfs/152
creat
before tearing down
> the quota structures.
>
> Signed-off-by: Justin Maggard <jmagg...@netgear.com>
Justin, it looks good and it's a very good find.
But can you please give a more detailed change log? You mention a NULL
pointer dereference, but you don't say where, which var
gt;>> close_ctree(), but we do nothing to stop the qgroup rescan. We should
>>> probably be doing the same for qgroup rescan, but that's a much larger
>>> change. This small change is good enough to allow me to unmount without
>>> crashing.
>>>
>>> S
t;
> Fix it by forcing recording source subvolume in current transaction
> before qgroup sub-transaction commit.
>
> Reported-by: Justin Maggard <jmagg...@netgear.com>
> Signed-off-by: Qu Wenruo <w...@suse.com>
Reviewed-by: Filipe Manana <fdman...@suse.com>
Looks goo
about what changes between versions should go after
the "---" (triple dash) below. You should also have mentioned what
changed between v2 and v1 as well (see
https://btrfs.wiki.kernel.org/index.php/Developer%27s_FAQ#Repeated_submissions).
>
> Signed-off-by: Justin Maggard <jmagg...@n
(btrfs: qgroup: exit the rescan worker during umount).
>
> Signed-off-by: Justin Maggard <jmagg...@netgear.com>
Reviewed-by: Filipe Manana <fdman...@suse.com>
> ---
Btw, for future patches/versions, here after the --- you should
mention what changed between versions of the p
e and scrub operations in
> close_ctree(), but we do nothing to stop the qgroup rescan. We should
> probably be doing the same for qgroup rescan, but that's a much larger
> change. This small change is good enough to allow me to unmount without
> crashing.
>
> Signed-off-by: Justin
h (btrfs: qgroup: fix quota disable during rescan).
>
> Signed-off-by: Justin Maggard <jmagg...@netgear.com>
Reviewed-by: Filipe Manana <fdman...@suse.com>
Looks good and it triggers the bug without the btrfs kernel fix.
A side note, and if you would like you could do as a sepa
le of the patch that fixes this problem
("btrfs: qgroup: exit the rescan worker during umount").
>
> Signed-off-by: Justin Maggard <jmagg...@netgear.com>
> ---
> tests/btrfs/104 | 85
> +
> tests/btrfs/104.ou
esult
> > in a kernel NULL pointer dereference.
>
> Please mention here the title of the patch that fixes this problem
> ("btrfs: qgroup: exit the rescan worker during umount").
>
> >
> > Signed-off-by: Justin Maggard
This test case does some concurrent send/receives with qgroups enabled.
Currently (4.13-rc1) this usually results in btrfs check errors, and
often also results in a WARN_ON in record_root_in_trans().
Bisecting points to 6426c7ad697d (btrfs: qgroup: Fix qgroup accounting
when creating snapshot) as
c7ad697d (btrfs: qgroup: Fix qgroup accounting
> when creating snapshot) as the culprit.
Thanks for the report, I'll look into it.
BTW can this only be reproduced by concurrent run?
Will single thread also cause the problem?
Thanks,
Qu
>
> Signed-off-by: Justin Maggard <jmagg...@netgea
; Fix it by forcing recording source subvolume in current transaction
> before qgroup sub-transaction commit.
>
> Reported-by: Justin Maggard <jmagg...@netgear.com>
> Signed-off-by: Qu Wenruo <w...@suse.com>
> ---
> fs/btrfs/transaction.c | 10 +-
> 1 fi
rent transaction, making root item of
>> source subvolume not updated.
>>
>> Fix it by forcing recording source subvolume in current transaction
>> before qgroup sub-transaction commit.
>>
>> Reported-by: Justin Maggard <jmagg...@netgear.com>
>> Signed-
by concurrent run?
> Will single thread also cause the problem?
>
> Thanks,
> Qu
I ran 1000 single-threaded passes with no failures, so I'm pretty sure
there must be multiple concurrent receives running to reproduce it.
-Justin
>>
>> Si
33 matches
Mail list logo