.gitignore: add src/fcntl_lock_corner_tests
PATCH 1/3 .gitignore: add src/fcntl_lock_corner_tests
In reply to a message not in the archivegit status reports a stray src/fcntl_lock_corner_tests; bring it under the ignore.
--- .gitignore | 1 + 1 file changed, 1 insertion(+)
.gitignore +1 -0
@@ -93,6 +93,7 @@ tags /src/fsync-err /src/fsync-tester /src/ftrunc +/src/fcntl_lock_corner_tests /src/genhashnames /src/getdevicesize /src/getpagesize
Signature · 1 line
2.39.3
PATCH 2/3 common/rc: specify required device size
In reply to a message not in the archiveThe current _notrun call states that the scratch device is too small but does not specify the required size. Simply update the _notrun messages.
--- common/rc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
common/rc +4 -2
@@ -1834,7 +1834,8 @@ _require_scratch_size() _require_scratch local devsize=`_get_device_size $SCRATCH_DEV` - [ $devsize -lt $1 ] && _notrun "scratch dev too small" + [ $devsize -lt $1 ] && \ +_notrun "scratch device $SCRATCH_DEV should be minimum $1, currently $devsize" } # require a scratch dev of a minimum size (in kb) and should not be checked
@@ -1845,7 +1846,8 @@ _require_scratch_size_nocheck() _require_scratch_nocheck local devsize=`_get_device_size $SCRATCH_DEV` - [ $devsize -lt $1 ] && _notrun "scratch dev too small" + [ $devsize -lt $1 ] && \ +_notrun "require scratch device $SCRATCH_DEV atleast $1, currently $devsize" } # Require scratch fs which supports >16T of filesystem size.
Signature · 1 line
2.39.3
PATCH 3/3 btrfs: test mount fails on physical device with configured dm volume
In reply to a message not in the archiveWhen a flakey device is configured, we have access to both the physical device and the DM flaky device. Ensure that when the flakey device is configured, the physical device mount fails.
--- tests/btrfs/318 | 45 +++++++++++++++++++++++++++++++++++++++++++++ tests/btrfs/318.out | 3 +++ 2 files changed, 48 insertions(+) create mode 100755 tests/btrfs/318 create mode 100644 tests/btrfs/318.out
tests/btrfs/318 new file +45 -0
@@ -0,0 +1,45 @@ +#! /bin/bash +# SPDX-License-Identifier: GPL-2.0 +# Copyright (c) 2024 Oracle. All Rights Reserved. +# +# FS QA Test 318 +# +# Create multiple device nodes with the same device try mount +# +. ./common/preamble +_begin_fstest auto volume tempfsid + +# Override the default cleanup function. +_cleanup() +{ + umount $extra_mnt &> /dev/null + rm -rf $extra_mnt &> /dev/null + _unmount_flakey + _cleanup_flakey + cd / + rm -r -f $tmp.* +} + +# Import common functions. +. ./common/filter +. ./common/dmflakey + +# real QA test starts here +_supported_fs btrfs +_require_scratch +_require_dm_target flakey + +_scratch_mkfs >> $seqres.full +_init_flakey + +_mount_flakey +extra_mnt=$TEST_DIR/extra_mnt +rm -rf $extra_mnt +mkdir -p $extra_mnt +_mount $SCRATCH_DEV $extra_mnt 2>&1 | _filter_testdir_and_scratch + +_flakey_drop_and_remount + +# success, all done +status=0 +exit
tests/btrfs/318.out new file +3 -0
@@ -0,0 +1,3 @@ +QA output created by 318 +mount: TEST_DIR/extra_mnt: wrong fs type, bad option, bad superblock on SCRATCH_DEV, missing codepage or helper program, or other error. + dmesg(1) may have more information after failed mount system call.
Signature · 1 line
2.39.3
Re: [PATCH 3/3] btrfs: test mount fails on physical device with configured dm volume
Quoted 18 lines · Anand Jain
When a flakey device is configured, we have access to both the physical device and the DM flaky device. Ensure that when the flakey device is configured, the physical device mount fails.
Signed-off-by Anand Jain <[email protected]>--- tests/btrfs/318 | 45 +++++++++++++++++++++++++++++++++++++++++++++ tests/btrfs/318.out | 3 +++ 2 files changed, 48 insertions(+) create mode 100755 tests/btrfs/318 create mode 100644 tests/btrfs/318.outtests/btrfs/318 new file +0
-0
tests/btrfs/318 line 10
Quoted 10 lines
tests/btrfs/318 new file +10
-0@@ -0,0 +1,45 @@ +#! /bin/bash +# SPDX-License-Identifier: GPL-2.0 +# Copyright (c) 2024 Oracle. All Rights Reserved. +# +# FS QA Test 318 +# +# Create multiple device nodes with the same device try mount +# +. ./common/preamble +_begin_fstest auto volume tempfsid
May I ask why it's a "tempfsid" related test?
tests/btrfs/318 line 16
Quoted 6 lines
tests/btrfs/318 new file +6
-0+ +# Override the default cleanup function. +_cleanup() +{ + umount $extra_mnt &> /dev/null + rm -rf $extra_mnt &> /dev/null
The "&> /dev/null" isn't needed, if you use "-f" for rm
Quoted 10 lines
tests/btrfs/318 new file +10
-0+ _unmount_flakey + _cleanup_flakey + cd / + rm -r -f $tmp.* +} + +# Import common functions. +. ./common/filter +. ./common/dmflakey +
tests/btrfs/318 line 36
Quoted 10 lines
tests/btrfs/318 new file +10
-0+# real QA test starts here +_supported_fs btrfs +_require_scratch +_require_dm_target flakey + +_scratch_mkfs >> $seqres.full +_init_flakey + +_mount_flakey +extra_mnt=$TEST_DIR/extra_mnt
_require_test ?
tests/btrfs/318 line 39
Quoted 3 lines
tests/btrfs/318 new file +3
-0+rm -rf $extra_mnt +mkdir -p $extra_mnt +_mount $SCRATCH_DEV $extra_mnt 2>&1 | _filter_testdir_and_scratch
Recommend calling "_filter_error_mount" too
Thanks,
Zorro
Quoted 19 lines
tests/btrfs/318 new file +6
-0+ +_flakey_drop_and_remount + +# success, all done +status=0 +exittests/btrfs/318.out new file +3
-0@@ -0,0 +1,3 @@ +QA output created by 318 +mount: TEST_DIR/extra_mnt: wrong fs type, bad option, bad superblock on SCRATCH_DEV, missing codepage or helper program, or other error. + dmesg(1) may have more information after failed mount system call.Signature · 1 line
2.39.3
Re: [PATCH 2/3] common/rc: specify required device size
In reply to Anand JainQuoted 5 lines · Anand Jain
The current
_notruncall states that the scratch device is too small but does not specify the required size. Simply update the_notrunmessages.Signed-off-by Anand Jain <[email protected]>---
OK, I think that makes sense to me.
Quoted 20 lines
common/rc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)common/rc +2
-1@@ -1834,7 +1834,8 @@ _require_scratch_size() _require_scratch local devsize=`_get_device_size $SCRATCH_DEV` - [ $devsize -lt $1 ] && _notrun "scratch dev too small" + [ $devsize -lt $1 ] && \ +_notrun "scratch device $SCRATCH_DEV should be minimum $1, currently $devsize" }# require a scratch dev of a minimum size (in kb) and should not be checked
common/rc _require_scratch_size_nocheck() · line 1850
Quoted 6 lines
common/rc +2
-1@@ -1845,7 +1846,8 @@ _require_scratch_size_nocheck() _require_scratch_nocheck local devsize=`_get_device_size $SCRATCH_DEV` - [ $devsize -lt $1 ] && _notrun "scratch dev too small" + [ $devsize -lt $1 ] && \ +_notrun "require scratch device $SCRATCH_DEV atleast $1, currently $devsize"
"at least"
Why don't output same message with above ? And why not have indentation at here?
I think the message is long enough, so the $SCRATCH_DEV maybe not necessary, how about
[ $devsize -lt $1 ] && \ _notrun "scratch device too small, $devsize < $1"
(same above)
With this change:
As I've given review points to patch 3/3, so I suppose you can change this patch with the 3rd one together :)
Thanks,
Zorro
Quoted 7 lines
common/rc +0
-0} # Require scratch fs which supports >16T of filesystem size.Signature · 1 line
2.39.3
Quoted 13 lines · Anand Jain
git status reports a stray src/fcntl_lock_corner_tests; bring it under the ignore.
Signed-off-by Anand Jain <[email protected]>--- .gitignore | 1 + 1 file changed, 1 insertion(+).gitignore +0
-0
.gitignore tags · line 96
Quoted 4 lines
.gitignore +1
-0@@ -93,6 +93,7 @@ tags /src/fsync-err /src/fsync-tester /src/ftrunc +/src/fcntl_lock_corner_tests
I haven't merged this test[1], the author is still looking into it, due to some issues on cifs side. So this's an invalid patch.
But you remind me that patch forgot to do this change :) You can reply to it as a review point :)
Thanks,
Zorro
Quoted 7 lines
.gitignore +0
-0/src/genhashnames /src/getdevicesize /src/getpagesizeSignature · 1 line
2.39.3
Quoted 22 lines · Zorro Lang
Quoted 13 lines · Anand Jain
git status reports a stray src/fcntl_lock_corner_tests; bring it under the ignore.
Signed-off-by Anand Jain <[email protected]>--- .gitignore | 1 + 1 file changed, 1 insertion(+).gitignore +0
-0.gitignore tags · line 96
Quoted 4 lines
.gitignore +1
-0@@ -93,6 +93,7 @@ tags /src/fsync-err /src/fsync-tester /src/ftrunc +/src/fcntl_lock_corner_testsI haven't merged this test[1], the author is still looking into it, due to some issues on cifs side. So this's an invalid patch.
Quoted 3 lines
But you remind me that patch forgot to do this change :) You can reply to it as a review point :)
If not integrated, this change can be folded into it no need of a new patch. Adding a review comment to remain the author.
Thanks, Anand
Quoted 14 lines
Thanks,
ZorroQuoted 7 lines
.gitignore +0
-0/src/genhashnames /src/getdevicesize /src/getpagesizeSignature · 1 line
2.39.3
Re: [PATCH 2/3] common/rc: specify required device size
In reply to Zorro LangQuoted 38 lines · Zorro Lang
Quoted 5 lines · Anand Jain
The current
_notruncall states that the scratch device is too small but does not specify the required size. Simply update the_notrunmessages.Signed-off-by Anand Jain <[email protected]>---
OK, I think that makes sense to me.
Quoted 20 lines
common/rc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)common/rc +2
-1@@ -1834,7 +1834,8 @@ _require_scratch_size() _require_scratch local devsize=`_get_device_size $SCRATCH_DEV` - [ $devsize -lt $1 ] && _notrun "scratch dev too small" + [ $devsize -lt $1 ] && \ +_notrun "scratch device $SCRATCH_DEV should be minimum $1, currently $devsize" }# require a scratch dev of a minimum size (in kb) and should not be checkedcommon/rc _require_scratch_size_nocheck() · line 1850
Quoted 6 lines
common/rc +2
-1@@ -1845,7 +1846,8 @@ _require_scratch_size_nocheck() _require_scratch_nocheck local devsize=`_get_device_size $SCRATCH_DEV` - [ $devsize -lt $1 ] && _notrun "scratch dev too small" + [ $devsize -lt $1 ] && \ +_notrun "require scratch device $SCRATCH_DEV atleast $1, currently $devsize""at least"
Quoted 1 line
Why don't output same message with above ?
If the error messages are unique, it is easier to search for the line in the source code when it is required.
Quoted 1 line
And why not have indentation at here?
Is it ok to overshoot 80 char? we move the line left as much required so that line is possible fit within 80char.
I'm ok to follow any better ways if any.
Quoted 7 lines
I think the message is long enough, so the $SCRATCH_DEV maybe not necessary, how about
[ $devsize -lt $1 ] && \ _notrun "scratch device too small, $devsize < $1"
This is reasonable, I will use it.
Quoted 7 lines
(same above)
With this change:
Reviewed-by Zorro Lang <[email protected]>As I've given review points to patch 3/3, so I suppose you can change this patch with the 3rd one together :)
Yep.
Thanks, Anand
Quoted 13 lines
Thanks,
ZorroQuoted 7 lines
common/rc +0
-0} # Require scratch fs which supports >16T of filesystem size.Signature · 1 line
2.39.3
Re: [PATCH 3/3] btrfs: test mount fails on physical device with configured dm volume
In reply to Anand JainQuoted 4 lines · Anand Jain
When a flakey device is configured, we have access to both the physical device and the DM flaky device. Ensure that when the flakey device is configured, the physical device mount fails.
Does it need to be flakey? Can't it be any other DM type?
The way it's phrased, gives the idea that somehow this is all flakey specific.
Just be clear and mention any DM on top of the device.
Quoted 15 lines
Signed-off-by Anand Jain <[email protected]>--- tests/btrfs/318 | 45 +++++++++++++++++++++++++++++++++++++++++++++ tests/btrfs/318.out | 3 +++ 2 files changed, 48 insertions(+) create mode 100755 tests/btrfs/318 create mode 100644 tests/btrfs/318.outtests/btrfs/318 new file +0
-0
tests/btrfs/318 line 10
Quoted 10 lines
tests/btrfs/318 new file +10
-0@@ -0,0 +1,45 @@ +#! /bin/bash +# SPDX-License-Identifier: GPL-2.0 +# Copyright (c) 2024 Oracle. All Rights Reserved. +# +# FS QA Test 318 +# +# Create multiple device nodes with the same device try mount +# +. ./common/preamble +_begin_fstest auto volume tempfsid
Also 'quick' group.
Quoted 21 lines
tests/btrfs/318 new file +21
-0+ +# Override the default cleanup function. +_cleanup() +{ + umount $extra_mnt &> /dev/null + rm -rf $extra_mnt &> /dev/null + _unmount_flakey + _cleanup_flakey + cd / + rm -r -f $tmp.* +} + +# Import common functions. +. ./common/filter +. ./common/dmflakey + +# real QA test starts here +_supported_fs btrfs +_require_scratch +_require_dm_target flakey +
tests/btrfs/318 line 41
Quoted 10 lines
tests/btrfs/318 new file +10
-0+_scratch_mkfs >> $seqres.full +_init_flakey + +_mount_flakey +extra_mnt=$TEST_DIR/extra_mnt +rm -rf $extra_mnt +mkdir -p $extra_mnt +_mount $SCRATCH_DEV $extra_mnt 2>&1 | _filter_testdir_and_scratch + +_flakey_drop_and_remount
Why? Please add a comment.
Either this is a leftover from copy-paste from other tests, that exercise fsync and power failure, or the goal is to do an unmount followed by a mount and check that the mount succeeds.
If it's the latter case, then it's confusing to use _flakey_drop_and_remount, because that drops writes, unmounts, allows writes again and then mounts - i.e. we don't want to simulate power loss by silently dropping writes.
Just call _unmount_flakey and _mount_flakey and add a comment mentioning why we are doing it.
Finally, a link to the report that motivated this, due to a bug in a patch that ended not being sent to Linus, would be useful:
I'm also not convinced that we need this test, because the bug could be reliably reproduced by running all existing tests or just a subset of the tests as I reported there.
Thanks.
Quoted 17 lines
tests/btrfs/318 new file +4
-0+ +# success, all done +status=0 +exittests/btrfs/318.out new file +3
-1@@ -0,0 +1,3 @@ +QA output created by 318 +mount: TEST_DIR/extra_mnt: wrong fs type, bad option, bad superblock on SCRATCH_DEV, missing codepage or helper program, or other error. + dmesg(1) may have more information after failed mount system call. --2.39.3
Re: [PATCH 3/3] btrfs: test mount fails on physical device with configured dm volume
Quoted 4 lines
I'm also not convinced that we need this test, because the bug could be reliably reproduced by running all existing tests or just a subset of the tests as I reported there.
This test case was motivated by btrfs/159; and recent report; yep, most of the lines here are taken from btrfs/159. However, I wanted a test case in the tempfsid group which exercises multi-node-same-physical;
If there are no objections, I am going to add the tempfsid group to btrfs/159 for now.
Thanks, Anand
Re: [PATCH 3/3] btrfs: test mount fails on physical device with configured dm volume
In reply to Anand JainQuoted 36 lines · Anand Jain
When a flakey device is configured, we have access to both the physical device and the DM flaky device. Ensure that when the flakey device is configured, the physical device mount fails.
Signed-off-by Anand Jain <[email protected]>--- tests/btrfs/318 | 45 +++++++++++++++++++++++++++++++++++++++++++++ tests/btrfs/318.out | 3 +++ 2 files changed, 48 insertions(+) create mode 100755 tests/btrfs/318 create mode 100644 tests/btrfs/318.outtests/btrfs/318 new file +18
-0@@ -0,0 +1,45 @@ +#! /bin/bash +# SPDX-License-Identifier: GPL-2.0 +# Copyright (c) 2024 Oracle. All Rights Reserved. +# +# FS QA Test 318 +# +# Create multiple device nodes with the same device try mount +# +. ./common/preamble +_begin_fstest auto volume tempfsid + +# Override the default cleanup function. +_cleanup() +{ + umount $extra_mnt &> /dev/null + rm -rf $extra_mnt &> /dev/null + _unmount_flakey + _cleanup_flakey
tests/btrfs/318 line 28
Quoted 10 lines
tests/btrfs/318 new file +10
-0+ cd / + rm -r -f $tmp.* +} + +# Import common functions. +. ./common/filter +. ./common/dmflakey + +# real QA test starts here +_supported_fs btrfs
BTW, what cause it have to be a btrfs specific test case? I didn't any btrfs specific operations below, can you explain the reason?
Thanks,
Zorro
Quoted 30 lines
tests/btrfs/318 new file +17
-0+_require_scratch +_require_dm_target flakey + +_scratch_mkfs >> $seqres.full +_init_flakey + +_mount_flakey +extra_mnt=$TEST_DIR/extra_mnt +rm -rf $extra_mnt +mkdir -p $extra_mnt +_mount $SCRATCH_DEV $extra_mnt 2>&1 | _filter_testdir_and_scratch + +_flakey_drop_and_remount + +# success, all done +status=0 +exittests/btrfs/318.out new file +3
-0@@ -0,0 +1,3 @@ +QA output created by 318 +mount: TEST_DIR/extra_mnt: wrong fs type, bad option, bad superblock on SCRATCH_DEV, missing codepage or helper program, or other error. + dmesg(1) may have more information after failed mount system call.Signature · 1 line
2.39.3
Re: [PATCH 3/3] btrfs: test mount fails on physical device with configured dm volume
In reply to Anand JainQuoted 8 lines · Anand Jain
Quoted 5 lines
I'm also not convinced that we need this test, because the bug could be reliably reproduced by running all existing tests or just a subset of the tests as I reported there.
This test case was motivated by btrfs/159; and recent report; yep, most of the lines here are taken from btrfs/159.
Ok, so it's motivated by what I reported, triggered by btrfs/159 but only when other tests are run before it.
Quoted 2 lines
However, I wanted a test case in the tempfsid group which exercises multi-node-same-physical;
Sure. It's just that we could trigger the issue simply by running all existing tests, or just a subset as I reported before [1].
It was fully deterministic and David could reproduce it after the report too.
What surprises me is that no one noticed this before and at some stage the faulty patch was about to be sent to Linus.
Quoted 3 lines
If there are no objections, I am going to add the tempfsid group to btrfs/159 for now.
That is confusing, please don't.
btrfs/159 doesn't test tempfsid, it existed for many years before the tempfsid feature (introduced in the 6.7 kernel),
it just happens that it triggers the issue if other fstests are run before it.
That would also be pointless because running btrfs/159 alone doesn't trigger the bug, so running "./check -g tempfsid" wouldn't cause 159 to fail.
Between that and a new test case that is somewhat redundant, I'd rather have the new test case with proper documentation/comments.
Thanks.
Quoted 2 lines
Thanks, Anand
Re: [PATCH 3/3] btrfs: test mount fails on physical device with configured dm volume
Quoted 32 lines · Filipe Manana
Quoted 8 lines · Anand Jain
Quoted 5 lines
I'm also not convinced that we need this test, because the bug could be reliably reproduced by running all existing tests or just a subset of the tests as I reported there.
This test case was motivated by btrfs/159; and recent report; yep, most of the lines here are taken from btrfs/159.
Ok, so it's motivated by what I reported, triggered by btrfs/159 but only when other tests are run before it.
Quoted 2 lines
However, I wanted a test case in the tempfsid group which exercises multi-node-same-physical;
Sure. It's just that we could trigger the issue simply by running all existing tests, or just a subset as I reported before [1].
It was fully deterministic and David could reproduce it after the report too.What surprises me is that no one noticed this before and at some stage the faulty patch was about to be sent to Linus.
Quoted 3 lines
If there are no objections, I am going to add the tempfsid group to btrfs/159 for now.
That is confusing, please don't.
btrfs/159 doesn't test tempfsid, it existed for many years before the tempfsid feature (introduced in the 6.7 kernel),
it just happens that it triggers the issue if other fstests are run before it.
Quoted 7 lines
That would also be pointless because running btrfs/159 alone doesn't trigger the bug, so running "./check -g tempfsid" wouldn't cause 159 to fail.
Between that and a new test case that is somewhat redundant, I'd rather have the new test case with proper documentation/comments.
I have converted this test case into a generic one. Now, XFS, ext4, and Btrfs (after a patch) match the golden output. I'll be sending the btrfs kernel patch along with it.
Thanks, Anand
Quoted 6 lines
Thanks.
Quoted 2 lines
Thanks, Anand
Re: [PATCH 3/3] btrfs: test mount fails on physical device with configured dm volume
In reply to Zorro LangQuoted 42 lines · Zorro Lang
Quoted 41 lines · Anand Jain
When a flakey device is configured, we have access to both the physical device and the DM flaky device. Ensure that when the flakey device is configured, the physical device mount fails.
Signed-off-by Anand Jain <[email protected]>--- tests/btrfs/318 | 45 +++++++++++++++++++++++++++++++++++++++++++++ tests/btrfs/318.out | 3 +++ 2 files changed, 48 insertions(+)create mode 100755 tests/btrfs/318
create mode 100644 tests/btrfs/318.outtests/btrfs/318 new file +23
-0@@ -0,0 +1,45 @@ +#! /bin/bash +# SPDX-License-Identifier: GPL-2.0 +# Copyright (c) 2024 Oracle. All Rights Reserved. +# +# FS QA Test 318 +# +# Create multiple device nodes with the same device try mount +# +. ./common/preamble +_begin_fstest auto volume tempfsid + +# Override the default cleanup function. +_cleanup() +{ + umount $extra_mnt &> /dev/null + rm -rf $extra_mnt &> /dev/null + _unmount_flakey + _cleanup_flakey + cd / + rm -r -f $tmp.* +} + +# Import common functions.
Quoted 9 lines
tests/btrfs/318 line 28
Quoted 5 lines
tests/btrfs/318 new file +5
-0+. ./common/filter +. ./common/dmflakey + +# real QA test starts here +_supported_fs btrfsBTW, what cause it have to be a btrfs specific test case? I didn't any btrfs specific operations below, can you explain the reason?
Right. Now I notice it can be made generic. I have converted this into a generic test case. I'll send it when the kernel patch is ready. For now, I have to withdraw this patch.
Thanks for the suggestion.
Anand