Skip to contentSkip to conversation

.gitignore: add src/fcntl_lock_corner_tests

PATCH In review Anand Jain 3 participants 14 messages Mar 7, 2024 – Mar 8, 2024 1 message not in the archive Btrfs file system

lore
Share & tools
lore

Anand Jain

author
#1 lore raw

PATCH 1/3 .gitignore: add src/fcntl_lock_corner_tests

In reply to a message not in the archive

git status reports a stray src/fcntl_lock_corner_tests; bring it under the ignore.

---
 .gitignore | 1 +
 1 file changed, 1 insertion(+)
.gitignore +1 -0
index 3b160209ac03..574aa9e8c1d1 100644
@@ -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
author
#4 lore raw

PATCH 2/3 common/rc: specify required device size

In reply to a message not in the archive

The 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
index 50dde313b851..5680995b2366 100644
@@ -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
author
#7 lore raw

PATCH 3/3 btrfs: test mount fails on physical device with configured dm volume

In reply to a message not in the archive

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.

---
 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
new file mode 100755
index 000000000000..015950fbd93c
@@ -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
new file mode 100644
index 000000000000..5cdbea8c4b2a
@@ -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
#8 lore raw

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.

---
 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 +0 -0
new file mode 100755
index 000000000000..015950fbd93c

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
+exit
tests/btrfs/318.out new file +3 -0
new file mode 100644
index 000000000000..5cdbea8c4b2a
@@ -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
Reviewed-by on v1 2/3
#5 lore raw

Re: [PATCH 2/3] common/rc: specify required device size

In reply to Anand Jain
Quoted 5 lines · Anand Jain

The current _notrun call states that the scratch device is too small but does not specify the required size. Simply update the _notrun messages.

---

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
index 50dde313b851..5680995b2366 100644
@@ -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
#2 lore raw
In reply to Anand Jain
Quoted 13 lines · Anand Jain

git status reports a stray src/fcntl_lock_corner_tests; bring it under the ignore.

---
 .gitignore | 1 +
 1 file changed, 1 insertion(+)
.gitignore +0 -0
index 3b160209ac03..574aa9e8c1d1 100644

.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

[1]
https://lore.kernel.org/fstests/20240303050853.f7wslqfkkgdfv37i@dell-per750-06-vm-08.rhts.eng.pek2.redhat.com/

Quoted 7 lines
.gitignore +0 -0
 /src/genhashnames
 /src/getdevicesize
 /src/getpagesize
Signature · 1 line
2.39.3
author
#3 lore raw
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.

---
  .gitignore | 1 +
  1 file changed, 1 insertion(+)
.gitignore +0 -0
index 3b160209ac03..574aa9e8c1d1 100644

.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.

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,
Zorro

[1]
https://lore.kernel.org/fstests/20240303050853.f7wslqfkkgdfv37i@dell-per750-06-vm-08.rhts.eng.pek2.redhat.com/

Quoted 7 lines
.gitignore +0 -0
  /src/genhashnames
  /src/getdevicesize
  /src/getpagesize
Signature · 1 line
2.39.3
author
#6 lore raw

Re: [PATCH 2/3] common/rc: specify required device size

In reply to Zorro Lang
Quoted 38 lines · Zorro Lang
Quoted 5 lines · Anand Jain

The current _notrun call states that the scratch device is too small but does not specify the required size. Simply update the _notrun messages.

---

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
index 50dde313b851..5680995b2366 100644
@@ -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"

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:

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,
Zorro

Quoted 7 lines
common/rc +0 -0
  }
 
  # Require scratch fs which supports >16T of filesystem size.
Signature · 1 line
2.39.3
#9 lore raw

Re: [PATCH 3/3] btrfs: test mount fails on physical device with configured dm volume

In reply to Anand Jain
Quoted 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
---
 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 +0 -0
new file mode 100755
index 000000000000..015950fbd93c

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:

https://lore.kernel.org/linux-btrfs/CAL3q7H5wx5rKmSzGWP7mRqaSfAY88g=35N4OBrbJB61rK0mt2w@mail.gmail.com/

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
+exit
tests/btrfs/318.out new file +3 -1
new file mode 100644
index 000000000000..5cdbea8c4b2a
@@ -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

author
#10 lore raw

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

#13 lore raw

Re: [PATCH 3/3] btrfs: test mount fails on physical device with configured dm volume

In reply to Anand Jain
Quoted 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.

---
 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 +18 -0
new file mode 100755
index 000000000000..015950fbd93c
@@ -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
+exit
tests/btrfs/318.out new file +3 -0
new file mode 100644
index 000000000000..5cdbea8c4b2a
@@ -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
#11 lore raw

Re: [PATCH 3/3] btrfs: test mount fails on physical device with configured dm volume

In reply to Anand Jain
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.

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.

[1] https://lore.kernel.org/linux-btrfs/CAL3q7H5wx5rKmSzGWP7mRqaSfAY88g=35N4OBrbJB61rK0mt2w@mail.gmail.com/

Quoted 2 lines

Thanks, Anand

author
#12 lore raw

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.

[1] https://lore.kernel.org/linux-btrfs/CAL3q7H5wx5rKmSzGWP7mRqaSfAY88g=35N4OBrbJB61rK0mt2w@mail.gmail.com/

Quoted 2 lines

Thanks, Anand

author
#14 lore raw

Re: [PATCH 3/3] btrfs: test mount fails on physical device with configured dm volume

In reply to Zorro Lang
Quoted 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.

---
  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 +23 -0
new file mode 100755
index 000000000000..015950fbd93c
@@ -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 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?

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