fstests: a couple fixes for btrfs/254
cover fstests: a couple fixes for btrfs/254
From: Filipe Manana <[email protected]>
Fixes for btrfs/254, details in the change logs.
Filipe Manana (2):
btrfs/254: don't leave mount on test fs in case of failure/interruption btrfs/254: fix test failure in case scratch devices are larger than 50G
tests/btrfs/254 | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-)
Signature · 1 line
2.45.2
PATCH 1/2 btrfs/254: don't leave mount on test fs in case of failure/interruption
From: Filipe Manana <[email protected]>
If the test fails or is interrupted after mounting $scratch_dev3 inside the test filesystem and before unmounting at test_add_device(), we leave without being unable to unmount the test filesystem since it has a mount inside it. This results in the need to manually unmount $scratch_dev3, otherwise a subsequent run of fstests fails since the unmount of the test device fails with -EBUSY.
Fix this by unmounting $scratch_dev3 ($seq_mnt) in the _cleanup() function.
--- tests/btrfs/254 | 1 + 1 file changed, 1 insertion(+)
tests/btrfs/254 +1 -0
@@ -21,6 +21,7 @@ _cleanup() { cd / rm -f $tmp.* + $UMOUNT_PROG $seq_mnt > /dev/null 2>&1 rm -rf $seq_mnt > /dev/null 2>&1 cleanup_dmdev }
Signature · 1 line
2.45.2
Re: [PATCH 1/2] btrfs/254: don't leave mount on test fs in case of failure/interruption
Quoted 22 lines · On 20/2/25 02:19, [email protected] wrote:
From: Filipe Manana <[email protected]>
If the test fails or is interrupted after mounting $scratch_dev3 inside the test filesystem and before unmounting at
test_add_device(), we leave without being unable to unmount the test filesystem since it has a mount inside it. This results in the need to manually unmount $scratch_dev3, otherwise a subsequent run of fstests fails since the unmount of the test device fails with-EBUSY.Fix this by unmounting $scratch_dev3 ($seq_mnt) in the
_cleanup()function.Signed-off-by Filipe Manana <[email protected]>--- tests/btrfs/254 | 1 + 1 file changed, 1 insertion(+)tests/btrfs/254 +0
-0
tests/btrfs/254 _cleanup() · line 27
Quoted 7 lines
tests/btrfs/254 +1
-0@@ -21,6 +21,7 @@ _cleanup() { cd / rm -f $tmp.* + $UMOUNT_PROG $seq_mnt > /dev/null 2>&1 rm -rf $seq_mnt > /dev/null 2>&1 cleanup_dmdev }
Re: [PATCH 1/2] btrfs/254: don't leave mount on test fs in case of failure/interruption
Quoted 18 lines · Anand Jain
Quoted 17 lines · On 20/2/25 02:19, [email protected] wrote:
From: Filipe Manana <[email protected]>
If the test fails or is interrupted after mounting $scratch_dev3 inside the test filesystem and before unmounting at
test_add_device(), we leave without being unable to unmount the test filesystem since it has a mount inside it. This results in the need to manually unmount $scratch_dev3, otherwise a subsequent run of fstests fails since the unmount of the test device fails with-EBUSY.Fix this by unmounting $scratch_dev3 ($seq_mnt) in the
_cleanup()function.Signed-off-by Filipe Manana <[email protected]>--- tests/btrfs/254 | 1 + 1 file changed, 1 insertion(+)
Quoted 9 lines
tests/btrfs/254 _cleanup() · line 24
Quoted 9 lines
tests/btrfs/254 +1
-0@@ -21,6 +21,7 @@ _cleanup() { cd / rm -f $tmp.* + $UMOUNT_PROG $seq_mnt > /dev/null 2>&1
This should use the _unmount helper that's in for-next.
--D
Quoted 9 lines
tests/btrfs/254 _cleanup() · line 27
Quoted 3 lines
tests/btrfs/254 +0
-0rm -rf $seq_mnt > /dev/null 2>&1 cleanup_dmdev }Reviewed-by Anand Jain <[email protected]>
Re: [PATCH 1/2] btrfs/254: don't leave mount on test fs in case of failure/interruption
Quoted 20 lines · Darrick J. Wong
Quoted 18 lines · Anand Jain
Quoted 17 lines · On 20/2/25 02:19, [email protected] wrote:
From: Filipe Manana <[email protected]>
If the test fails or is interrupted after mounting $scratch_dev3 inside the test filesystem and before unmounting at
test_add_device(), we leave without being unable to unmount the test filesystem since it has a mount inside it. This results in the need to manually unmount $scratch_dev3, otherwise a subsequent run of fstests fails since the unmount of the test device fails with-EBUSY.Fix this by unmounting $scratch_dev3 ($seq_mnt) in the
_cleanup()function.Signed-off-by Filipe Manana <[email protected]>--- tests/btrfs/254 | 1 + 1 file changed, 1 insertion(+)
Quoted 11 lines
Quoted 9 lines
tests/btrfs/254 _cleanup() · line 24
Quoted 9 lines
tests/btrfs/254 +1
-0@@ -21,6 +21,7 @@ _cleanup() { cd / rm -f $tmp.* + $UMOUNT_PROG $seq_mnt > /dev/null 2>&1This should use the
_unmounthelper that's in for-next.
Sure, it does the same, except that it redirects stdout and stderr to $seqres.full.
Some tests are still calling $UMOUNT_PROG directly. And that's often what we want, so that if umount fails we get a mismatch with the golden output instead of ignoring the failure.
But in this case it's fine.
Anand, since you've already merged this patch into your repo, can you please replace that line with the following?
_unmount $seq_mnt
Thanks.
Quoted 12 lines
--D
Quoted 9 lines
tests/btrfs/254 _cleanup() · line 27
Quoted 3 lines
tests/btrfs/254 +0
-0rm -rf $seq_mnt > /dev/null 2>&1 cleanup_dmdev }Reviewed-by Anand Jain <[email protected]>
Anand Jain
AppliedRe: [PATCH 1/2] btrfs/254: don't leave mount on test fs in case of failure/interruption
Quoted 41 lines · Filipe Manana
Quoted 20 lines · Darrick J. Wong
Quoted 18 lines · Anand Jain
Quoted 17 lines · On 20/2/25 02:19, [email protected] wrote:
From: Filipe Manana <[email protected]>
If the test fails or is interrupted after mounting $scratch_dev3 inside the test filesystem and before unmounting at
test_add_device(), we leave without being unable to unmount the test filesystem since it has a mount inside it. This results in the need to manually unmount $scratch_dev3, otherwise a subsequent run of fstests fails since the unmount of the test device fails with-EBUSY.Fix this by unmounting $scratch_dev3 ($seq_mnt) in the
_cleanup()function.Signed-off-by Filipe Manana <[email protected]>--- tests/btrfs/254 | 1 + 1 file changed, 1 insertion(+)Quoted 11 lines
Quoted 9 lines
tests/btrfs/254 _cleanup() · line 24
Quoted 9 lines
tests/btrfs/254 +1
-0@@ -21,6 +21,7 @@ _cleanup() { cd / rm -f $tmp.* + $UMOUNT_PROG $seq_mnt > /dev/null 2>&1This should use the
_unmounthelper that's in for-next.Sure, it does the same, except that it redirects stdout and stderr to $seqres.full.
Some tests are still calling $UMOUNT_PROG directly. And that's often what we want, so that if umount fails we get a mismatch with the golden output instead of ignoring the failure.
But in this case it's fine.
Quoted 5 lines
Anand, since you've already merged this patch into your repo, can you please replace that line with the following?
_unmount$seq_mnt
Applied.
Thanks.
Zorro,
Just checked, and it looks like you haven’t pulled in patches from my for-next yet.
I went ahead and force-updated it to keep unnecessary noise off the ML.
If you're pulling this weekend, there are three patches in for-next ready to merge.
( https://github.com/asj/fstests.git for-next.)
Thanks!
Anand
Quoted 14 lines
Thanks.
Quoted 12 lines
--D
Quoted 9 lines
tests/btrfs/254 _cleanup() · line 27
Quoted 3 lines
tests/btrfs/254 +0
-0rm -rf $seq_mnt > /dev/null 2>&1 cleanup_dmdev }Reviewed-by Anand Jain <[email protected]>
Re: [PATCH 1/2] btrfs/254: don't leave mount on test fs in case of failure/interruption
Quoted 53 lines · Anand Jain
Quoted 41 lines · Filipe Manana
Quoted 20 lines · Darrick J. Wong
Quoted 18 lines · Anand Jain
Quoted 17 lines · On 20/2/25 02:19, [email protected] wrote:
From: Filipe Manana <[email protected]>
If the test fails or is interrupted after mounting $scratch_dev3 inside the test filesystem and before unmounting at
test_add_device(), we leave without being unable to unmount the test filesystem since it has a mount inside it. This results in the need to manually unmount $scratch_dev3, otherwise a subsequent run of fstests fails since the unmount of the test device fails with-EBUSY.Fix this by unmounting $scratch_dev3 ($seq_mnt) in the
_cleanup()function.Signed-off-by Filipe Manana <[email protected]>--- tests/btrfs/254 | 1 + 1 file changed, 1 insertion(+)Quoted 11 lines
Quoted 9 lines
tests/btrfs/254 _cleanup() · line 24
Quoted 9 lines
tests/btrfs/254 +1
-0@@ -21,6 +21,7 @@ _cleanup() { cd / rm -f $tmp.* + $UMOUNT_PROG $seq_mnt > /dev/null 2>&1This should use the
_unmounthelper that's in for-next.Sure, it does the same, except that it redirects stdout and stderr to $seqres.full.
Some tests are still calling $UMOUNT_PROG directly. And that's often what we want, so that if umount fails we get a mismatch with the golden output instead of ignoring the failure.
But in this case it's fine.Quoted 5 lines
Anand, since you've already merged this patch into your repo, can you please replace that line with the following?
_unmount$seq_mntApplied.
Thanks.Zorro,
Quoted 7 lines
Just checked, and it looks like you haven’t pulled in patches from my for-next yet.
I went ahead and force-updated it to keep unnecessary noise off the ML.If you're pulling this weekend, there are three patches in for-next ready to merge.
Actually I've pulled, just haven't pushed :) Then I saw this conversation, so I'm going to reset and re-pull. The next release is nearly done, I'll pick up more simple patches with RVB today, then prepare to release it. Thanks!
Thanks,
Zorro
Quoted 22 lines
( https://github.com/asj/fstests.git for-next.)
Thanks!
AnandQuoted 14 lines
Thanks.
Quoted 12 lines
--D
Quoted 9 lines
tests/btrfs/254 _cleanup() · line 27
Quoted 3 lines
tests/btrfs/254 +0
-0rm -rf $seq_mnt > /dev/null 2>&1 cleanup_dmdev }Reviewed-by Anand Jain <[email protected]>
Re: [PATCH 1/2] btrfs/254: don't leave mount on test fs in case of failure/interruption
In reply to Filipe MananaQuoted 33 lines · Filipe Manana
Quoted 20 lines · Darrick J. Wong
Quoted 18 lines · Anand Jain
Quoted 17 lines · On 20/2/25 02:19, [email protected] wrote:
From: Filipe Manana <[email protected]>
If the test fails or is interrupted after mounting $scratch_dev3 inside the test filesystem and before unmounting at
test_add_device(), we leave without being unable to unmount the test filesystem since it has a mount inside it. This results in the need to manually unmount $scratch_dev3, otherwise a subsequent run of fstests fails since the unmount of the test device fails with-EBUSY.Fix this by unmounting $scratch_dev3 ($seq_mnt) in the
_cleanup()function.Signed-off-by Filipe Manana <[email protected]>--- tests/btrfs/254 | 1 + 1 file changed, 1 insertion(+)Quoted 11 lines
Quoted 9 lines
tests/btrfs/254 _cleanup() · line 24
Quoted 9 lines
tests/btrfs/254 +1
-0@@ -21,6 +21,7 @@ _cleanup() { cd / rm -f $tmp.* + $UMOUNT_PROG $seq_mnt > /dev/null 2>&1This should use the
_unmounthelper that's in for-next.
Quoted 7 lines
Sure, it does the same, except that it redirects stdout and stderr to $seqres.full.
Some tests are still calling $UMOUNT_PROG directly. And that's often what we want, so that if umount fails we get a mismatch with the golden output instead of ignoring the failure.
But in this case it's fine.
<groan> You're right, I'd repressed that Chinner decided to introduce _unmount so that he could improve logging of unmount failures but then he only bothered converting tests/{generic,xfs} because he didn't give a damn about anyone else.
Now fstests is stuck with a half finished conversion and no clarity about whether the rest of the $UMOUNT_PROG invocations should be converted to _umount or if those are somehow intentional.
Hey Zorro, do you have any opinion on this? Should someone just finish the $UMOUNT_PROG -> _unmount conversion next week?
--D
Quoted 20 lines
Anand, since you've already merged this patch into your repo, can you please replace that line with the following?
_unmount$seq_mntThanks.
Quoted 12 lines
--D
Quoted 9 lines
tests/btrfs/254 _cleanup() · line 27
Quoted 3 lines
tests/btrfs/254 +0
-0rm -rf $seq_mnt > /dev/null 2>&1 cleanup_dmdev }Reviewed-by Anand Jain <[email protected]>
Re: [PATCH 1/2] btrfs/254: don't leave mount on test fs in case of failure/interruption
Quoted 47 lines · Darrick J. Wong
Quoted 33 lines · Filipe Manana
Quoted 20 lines · Darrick J. Wong
Quoted 18 lines · Anand Jain
Quoted 17 lines · On 20/2/25 02:19, [email protected] wrote:
From: Filipe Manana <[email protected]>
If the test fails or is interrupted after mounting $scratch_dev3 inside the test filesystem and before unmounting at
test_add_device(), we leave without being unable to unmount the test filesystem since it has a mount inside it. This results in the need to manually unmount $scratch_dev3, otherwise a subsequent run of fstests fails since the unmount of the test device fails with-EBUSY.Fix this by unmounting $scratch_dev3 ($seq_mnt) in the
_cleanup()function.Signed-off-by Filipe Manana <[email protected]>--- tests/btrfs/254 | 1 + 1 file changed, 1 insertion(+)Quoted 11 lines
Quoted 9 lines
tests/btrfs/254 _cleanup() · line 24
Quoted 9 lines
tests/btrfs/254 +1
-0@@ -21,6 +21,7 @@ _cleanup() { cd / rm -f $tmp.* + $UMOUNT_PROG $seq_mnt > /dev/null 2>&1This should use the
_unmounthelper that's in for-next.Quoted 7 lines
Sure, it does the same, except that it redirects stdout and stderr to $seqres.full.
Some tests are still calling $UMOUNT_PROG directly. And that's often what we want, so that if umount fails we get a mismatch with the golden output instead of ignoring the failure.
But in this case it's fine.<groan> You're right, I'd repressed that Chinner decided to introduce
_unmountso that he could improve logging of unmount failures but then he only bothered converting tests/{generic,xfs} because he didn't give a damn about anyone else.
Quoted 6 lines
Now fstests is stuck with a half finished conversion and no clarity about whether the rest of the $UMOUNT_PROG invocations should be converted to
_umountor if those are somehow intentional.Hey Zorro, do you have any opinion on this? Should someone just finish the $UMOUNT_PROG ->
_unmountconversion next week?
The release of this week will have your big randome-fixes. Next release will deal with your 10 PRs mainly :) So I'll deal with the "$UMOUNT_PROG -> _unmount conversion" after that. Anyway, we still can review the "conversion" patch at first.
Thanks,
Zorro
Quoted 24 lines
--D
Quoted 20 lines
Anand, since you've already merged this patch into your repo, can you please replace that line with the following?
_unmount$seq_mntThanks.
Quoted 12 lines
--D
Quoted 9 lines
tests/btrfs/254 _cleanup() · line 27
Quoted 3 lines
tests/btrfs/254 +0
-0rm -rf $seq_mnt > /dev/null 2>&1 cleanup_dmdev }Reviewed-by Anand Jain <[email protected]>
Re: [PATCH 1/2] btrfs/254: don't leave mount on test fs in case of failure/interruption
Quoted 52 lines · Zorro Lang
Quoted 51 lines · Darrick J. Wong
Quoted 33 lines · Filipe Manana
Quoted 20 lines · Darrick J. Wong
Quoted 18 lines · Anand Jain
Quoted 17 lines · On 20/2/25 02:19, [email protected] wrote:
From: Filipe Manana <[email protected]>
If the test fails or is interrupted after mounting $scratch_dev3 inside the test filesystem and before unmounting at
test_add_device(), we leave without being unable to unmount the test filesystem since it has a mount inside it. This results in the need to manually unmount $scratch_dev3, otherwise a subsequent run of fstests fails since the unmount of the test device fails with-EBUSY.Fix this by unmounting $scratch_dev3 ($seq_mnt) in the
_cleanup()function.Signed-off-by Filipe Manana <[email protected]>--- tests/btrfs/254 | 1 + 1 file changed, 1 insertion(+)Quoted 11 lines
Quoted 9 lines
tests/btrfs/254 _cleanup() · line 24
Quoted 9 lines
tests/btrfs/254 +1
-0@@ -21,6 +21,7 @@ _cleanup() { cd / rm -f $tmp.* + $UMOUNT_PROG $seq_mnt > /dev/null 2>&1This should use the
_unmounthelper that's in for-next.Quoted 7 lines
Sure, it does the same, except that it redirects stdout and stderr to $seqres.full.
Some tests are still calling $UMOUNT_PROG directly. And that's often what we want, so that if umount fails we get a mismatch with the golden output instead of ignoring the failure.
But in this case it's fine.<groan> You're right, I'd repressed that Chinner decided to introduce
_unmountso that he could improve logging of unmount failures but then he only bothered converting tests/{generic,xfs} because he didn't give a damn about anyone else.Now fstests is stuck with a half finished conversion and no clarity about whether the rest of the $UMOUNT_PROG invocations should be converted to
_umountor if those are somehow intentional.
Quoted 7 lines
Quoted 2 lines
Hey Zorro, do you have any opinion on this? Should someone just finish the $UMOUNT_PROG ->
_unmountconversion next week?The release of this week will have your big randome-fixes. Next release will deal with your 10 PRs mainly :) So I'll deal with the "$UMOUNT_PROG ->
_unmountconversion" after that. Anyway, we still can review the "conversion" patch at first.
Ok. Let's do that next week.
--D
Quoted 29 lines
Thanks,
ZorroQuoted 24 lines
--D
Quoted 20 lines
Anand, since you've already merged this patch into your repo, can you please replace that line with the following?
_unmount$seq_mntThanks.
Quoted 12 lines
--D
Quoted 9 lines
tests/btrfs/254 _cleanup() · line 27
Quoted 3 lines
tests/btrfs/254 +0
-0rm -rf $seq_mnt > /dev/null 2>&1 cleanup_dmdev }Reviewed-by Anand Jain <[email protected]>
PATCH 1/1 fstests: finish UMOUNT_PROG to _unmount conversion
In reply to Darrick J. WongQuoted 42 lines · Darrick J. Wong
Quoted 33 lines · Filipe Manana
Quoted 20 lines · Darrick J. Wong
Quoted 18 lines · Anand Jain
Quoted 17 lines · On 20/2/25 02:19, [email protected] wrote:
From: Filipe Manana <[email protected]>
If the test fails or is interrupted after mounting $scratch_dev3 inside the test filesystem and before unmounting at
test_add_device(), we leave without being unable to unmount the test filesystem since it has a mount inside it. This results in the need to manually unmount $scratch_dev3, otherwise a subsequent run of fstests fails since the unmount of the test device fails with-EBUSY.Fix this by unmounting $scratch_dev3 ($seq_mnt) in the
_cleanup()function.Signed-off-by Filipe Manana <[email protected]>--- tests/btrfs/254 | 1 + 1 file changed, 1 insertion(+)Quoted 11 lines
Quoted 9 lines
tests/btrfs/254 _cleanup() · line 24
Quoted 9 lines
tests/btrfs/254 +1
-0@@ -21,6 +21,7 @@ _cleanup() { cd / rm -f $tmp.* + $UMOUNT_PROG $seq_mnt > /dev/null 2>&1This should use the
_unmounthelper that's in for-next.Quoted 7 lines
Sure, it does the same, except that it redirects stdout and stderr to $seqres.full.
Some tests are still calling $UMOUNT_PROG directly. And that's often what we want, so that if umount fails we get a mismatch with the golden output instead of ignoring the failure.
But in this case it's fine.
Quoted 4 lines
<groan> You're right, I'd repressed that Chinner decided to introduce
_unmountso that he could improve logging of unmount failures but then he only bothered converting tests/{generic,xfs} because he didn't give a damn about anyone else.
That's uncalled for, Darrick.
You know very well that I posted an incomplete RFC that I was asking for reveiw on, not for it to be merged. The maintainer decided to merge it and did not wait for me to finish the conversions.
Quoted 6 lines
Now fstests is stuck with a half finished conversion and no clarity about whether the rest of the $UMOUNT_PROG invocations should be converted to
_umountor if those are somehow intentional.Hey Zorro, do you have any opinion on this? Should someone just finish the $UMOUNT_PROG ->
_unmountconversion next week?
Why put it off? With the logging fixes to _unmount() that are already merged, it's a purely mechanical change using sed. Patch below.
-Dave.
Signature · 90 lines
Dave Chinner [email protected] fstests: finish UMOUNT_PROG to _unmount conversion From: Dave Chinner <[email protected]> Because only tests/generic and tests/xfs have been converted so far and the conversion needs finishing. _unmount is a drop-in replacement for $UMOUNT_PROG, so we can simply do a mechanical conversion like so: $ sed -i s/\$UMOUNT_PROG/_unmount/g tests/*/* Signed-off-by: Dave Chinner <[email protected]> --- tests/btrfs/020 | 2 +- tests/btrfs/029 | 2 +- tests/btrfs/031 | 2 +- tests/btrfs/060 | 2 +- tests/btrfs/065 | 2 +- tests/btrfs/066 | 2 +- tests/btrfs/067 | 2 +- tests/btrfs/068 | 2 +- tests/btrfs/075 | 2 +- tests/btrfs/089 | 2 +- tests/btrfs/124 | 2 +- tests/btrfs/125 | 2 +- tests/btrfs/185 | 4 ++-- tests/btrfs/197 | 4 ++-- tests/btrfs/219 | 12 ++++++------ tests/btrfs/254 | 2 +- tests/btrfs/311 | 2 +- tests/btrfs/313 | 2 +- tests/btrfs/314 | 2 +- tests/btrfs/315 | 2 +- tests/btrfs/318 | 6 +++--- tests/btrfs/326 | 10 +++++----- tests/btrfs/330 | 4 ++-- tests/ext4/032 | 4 ++-- tests/ext4/052 | 4 ++-- tests/ext4/053 | 32 ++++++++++++++++---------------- tests/ext4/056 | 2 +- tests/overlay/003 | 2 +- tests/overlay/004 | 2 +- tests/overlay/005 | 6 +++--- tests/overlay/014 | 4 ++-- tests/overlay/022 | 2 +- tests/overlay/025 | 4 ++-- tests/overlay/029 | 6 +++--- tests/overlay/031 | 8 ++++---- tests/overlay/035 | 2 +- tests/overlay/036 | 8 ++++---- tests/overlay/037 | 6 +++--- tests/overlay/040 | 2 +- tests/overlay/041 | 2 +- tests/overlay/042 | 2 +- tests/overlay/043 | 2 +- tests/overlay/044 | 2 +- tests/overlay/048 | 4 ++-- tests/overlay/049 | 2 +- tests/overlay/050 | 2 +- tests/overlay/051 | 4 ++-- tests/overlay/052 | 2 +- tests/overlay/053 | 4 ++-- tests/overlay/054 | 2 +- tests/overlay/055 | 4 ++-- tests/overlay/056 | 2 +- tests/overlay/057 | 4 ++-- tests/overlay/059 | 2 +- tests/overlay/060 | 2 +- tests/overlay/062 | 2 +- tests/overlay/063 | 2 +- tests/overlay/065 | 22 +++++++++++----------- tests/overlay/067 | 2 +- tests/overlay/068 | 4 ++-- tests/overlay/069 | 6 +++--- tests/overlay/070 | 6 +++--- tests/overlay/071 | 6 +++--- tests/overlay/076 | 2 +- tests/overlay/077 | 2 +- tests/overlay/078 | 2 +- tests/overlay/079 | 2 +- tests/overlay/080 | 2 +- tests/overlay/081 | 14 +++++++------- tests/overlay/083 | 2 +- tests/overlay/084 | 10 +++++----- tests/overlay/085 | 2 +- tests/overlay/086 | 8 ++++---- 73 files changed, 153 insertions(+), 153 deletions(-)
tests/btrfs/020 +1 -1
@@ -17,7 +17,7 @@ _cleanup() { cd / rm -f $tmp.* - $UMOUNT_PROG $loop_mnt + _unmount $loop_mnt _destroy_loop_device $loop_dev1 losetup -d $loop_dev2 >/dev/null 2>&1 _destroy_loop_device $loop_dev3
tests/btrfs/029 +1 -1
@@ -74,7 +74,7 @@ cp --reflink=always $orig_file $copy_file >> $seqres.full 2>&1 || echo "cp refli md5sum $orig_file | _filter_testdir_and_scratch md5sum $copy_file | _filter_testdir_and_scratch -$UMOUNT_PROG $reflink_test_dir +_unmount $reflink_test_dir # success, all done status=0
tests/btrfs/031 +1 -1
@@ -99,7 +99,7 @@ mv $testdir2/file* $subvol2/ echo "Verify the file contents:" _checksum_files -$UMOUNT_PROG $cross_mount_test_dir +_unmount $cross_mount_test_dir # success, all done status=0
tests/btrfs/060 +1 -1
@@ -76,7 +76,7 @@ run_test() fi # in case the subvolume is still mounted - $UMOUNT_PROG $subvol_mnt >/dev/null 2>&1 + _unmount $subvol_mnt >/dev/null 2>&1 _scratch_unmount # we called _require_scratch_nocheck instead of _require_scratch # do check after test for each profile config
tests/btrfs/065 +1 -1
@@ -84,7 +84,7 @@ run_test() fi # in case the subvolume is still mounted - $UMOUNT_PROG $subvol_mnt >/dev/null 2>&1 + _unmount $subvol_mnt >/dev/null 2>&1 _scratch_unmount # we called _require_scratch_nocheck instead of _require_scratch # do check after test for each profile config
tests/btrfs/066 +1 -1
@@ -76,7 +76,7 @@ run_test() fi # in case the subvolume is still mounted - $UMOUNT_PROG $subvol_mnt >/dev/null 2>&1 + _unmount $subvol_mnt >/dev/null 2>&1 _scratch_unmount # we called _require_scratch_nocheck instead of _require_scratch # do check after test for each profile config
tests/btrfs/067 +1 -1
@@ -77,7 +77,7 @@ run_test() fi # in case the subvolume is still mounted - $UMOUNT_PROG $subvol_mnt >/dev/null 2>&1 + _unmount $subvol_mnt >/dev/null 2>&1 _scratch_unmount # we called _require_scratch_nocheck instead of _require_scratch # do check after test for each profile config
tests/btrfs/068 +1 -1
@@ -77,7 +77,7 @@ run_test() fi # in case the subvolume is still mounted - $UMOUNT_PROG $subvol_mnt >/dev/null 2>&1 + _unmount $subvol_mnt >/dev/null 2>&1 _scratch_unmount # we called _require_scratch_nocheck instead of _require_scratch # do check after test for each profile config
tests/btrfs/075 +1 -1
@@ -15,7 +15,7 @@ _cleanup() { cd / rm -f $tmp.* - $UMOUNT_PROG $subvol_mnt >/dev/null 2>&1 + _unmount $subvol_mnt >/dev/null 2>&1 } . ./common/filter
tests/btrfs/089 +1 -1
@@ -35,7 +35,7 @@ mount --bind "$SCRATCH_MNT/testvol/testdir" "$SCRATCH_MNT/testvol/mnt" $BTRFS_UTIL_PROG subvolume delete "$SCRATCH_MNT/testvol" >>$seqres.full 2>&1 # Unmount the bind mount, which should still be alive. -$UMOUNT_PROG "$SCRATCH_MNT/testvol/mnt" +_unmount "$SCRATCH_MNT/testvol/mnt" echo "Silence is golden" status=0
tests/btrfs/124 +1 -1
@@ -132,7 +132,7 @@ if [ "$checkpoint1" != "$checkpoint3" ]; then echo "Inital sum does not match with data on dev2 written by balance" fi -$UMOUNT_PROG $dev2 +_unmount $dev2 _scratch_dev_pool_put _btrfs_rescan_devices _test_mount
tests/btrfs/125 +1 -1
@@ -144,7 +144,7 @@ if [ "$checkpoint1" != "$checkpoint3" ]; then echo "Inital sum does not match with data on dev2 written by balance" fi -$UMOUNT_PROG $dev2 +_unmount $dev2 _scratch_dev_pool_put _btrfs_rescan_devices _test_mount
tests/btrfs/185 +2 -2
@@ -15,7 +15,7 @@ mnt=$TEST_DIR/$seq.mnt # Override the default cleanup function. _cleanup() { - $UMOUNT_PROG $mnt > /dev/null 2>&1 + _unmount $mnt > /dev/null 2>&1 rm -rf $mnt > /dev/null 2>&1 cd / rm -f $tmp.*
@@ -62,7 +62,7 @@ $BTRFS_UTIL_PROG device scan $device_1 >> $seqres.full 2>&1 _fail "if it fails here, then it means subvolume mount at boot may fail "\ "in some configs." -$UMOUNT_PROG $mnt > /dev/null 2>&1 +_unmount $mnt > /dev/null 2>&1 _scratch_dev_pool_put # success, all done
tests/btrfs/197 +2 -2
@@ -15,7 +15,7 @@ _begin_fstest auto quick volume # Override the default cleanup function. _cleanup() { - $UMOUNT_PROG $TEST_DIR/$seq.mnt >/dev/null 2>&1 + _unmount $TEST_DIR/$seq.mnt >/dev/null 2>&1 rm -rf $TEST_DIR/$seq.mnt cd / rm -f $tmp.*
@@ -67,7 +67,7 @@ workout() grep -q "${SCRATCH_DEV_NAME[1]}" $tmp.output && _fail "found stale device" $BTRFS_UTIL_PROG device remove "${SCRATCH_DEV_NAME[1]}" "$TEST_DIR/$seq.mnt" - $UMOUNT_PROG $TEST_DIR/$seq.mnt + _unmount $TEST_DIR/$seq.mnt _scratch_unmount _spare_dev_put _scratch_dev_pool_put
tests/btrfs/219 +6 -6
@@ -21,8 +21,8 @@ _cleanup() rm -f $tmp.* # The variables are set before the test case can fail. - $UMOUNT_PROG ${loop_mnt1} &> /dev/null - $UMOUNT_PROG ${loop_mnt2} &> /dev/null + _unmount ${loop_mnt1} &> /dev/null + _unmount ${loop_mnt2} &> /dev/null rm -rf $loop_mnt1 rm -rf $loop_mnt2
@@ -66,7 +66,7 @@ loop_dev2=`_create_loop_device $fs_img2` # Normal single device case, should pass just fine _mount $loop_dev1 $loop_mnt1 > /dev/null 2>&1 || \ _fail "Couldn't do initial mount" -$UMOUNT_PROG $loop_mnt1 +_unmount $loop_mnt1 _btrfs_forget_or_module_reload
@@ -75,15 +75,15 @@ _btrfs_forget_or_module_reload # measure. _mount $loop_dev1 $loop_mnt1 > /dev/null 2>&1 || \ _fail "Failed to mount the second time" -$UMOUNT_PROG $loop_mnt1 +_unmount $loop_mnt1 _mount $loop_dev2 $loop_mnt2 > /dev/null 2>&1 || \ _fail "We couldn't mount the old generation" -$UMOUNT_PROG $loop_mnt2 +_unmount $loop_mnt2 _mount $loop_dev1 $loop_mnt1 > /dev/null 2>&1 || \ _fail "Failed to mount the second time" -$UMOUNT_PROG $loop_mnt1 +_unmount $loop_mnt1 # Now try mount them at the same time, if kernel does not support # temp-fsid feature then mount will fail.
tests/btrfs/254 +1 -1
@@ -96,7 +96,7 @@ test_add_device() $BTRFS_UTIL_PROG filesystem show -m $SCRATCH_MNT | \ _filter_btrfs_filesystem_show - $UMOUNT_PROG $seq_mnt + _unmount $seq_mnt _scratch_unmount cleanup_dmdev }
tests/btrfs/311 +1 -1
@@ -14,7 +14,7 @@ _begin_fstest auto quick subvol tempfsid _cleanup() { cd / - $UMOUNT_PROG $mnt1 > /dev/null 2>&1 + _unmount $mnt1 > /dev/null 2>&1 rm -r -f $tmp.* rm -r -f $mnt1 }
tests/btrfs/313 +1 -1
@@ -12,7 +12,7 @@ _begin_fstest auto quick clone tempfsid _cleanup() { cd / - $UMOUNT_PROG $mnt1 > /dev/null 2>&1 + _unmount $mnt1 > /dev/null 2>&1 rm -r -f $tmp.* rm -r -f $mnt1 }
tests/btrfs/314 +1 -1
@@ -13,7 +13,7 @@ _begin_fstest auto quick snapshot send tempfsid _cleanup() { cd / - $UMOUNT_PROG $tempfsid_mnt 2>/dev/null + _unmount $tempfsid_mnt 2>/dev/null rm -r -f $tmp.* rm -r -f $sendfile rm -r -f $tempfsid_mnt
tests/btrfs/315 +1 -1
@@ -13,7 +13,7 @@ _begin_fstest auto quick volume seed balance tempfsid _cleanup() { cd / - $UMOUNT_PROG $tempfsid_mnt 2>/dev/null + _unmount $tempfsid_mnt 2>/dev/null rm -r -f $tmp.* rm -r -f $tempfsid_mnt }
tests/btrfs/318 +3 -3
@@ -22,8 +22,8 @@ _require_loop _cleanup() { cd / - $UMOUNT_PROG $MNT - $UMOUNT_PROG $BIND + _unmount $MNT + _unmount $BIND losetup -d $DEV0 $DEV1 $DEV2 rm -f $IMG0 $IMG1 $IMG2 rm -rf $MNT $BIND
@@ -58,7 +58,7 @@ $MKFS_BTRFS_PROG -f -msingle -dsingle $D0P1 $DEV2 >>$seqres.full 2>&1 || _fail " rm -rf $MNT mkdir -p $MNT _mount $D0P1 $MNT -$UMOUNT_PROG $MNT +_unmount $MNT # Swap the partition dev_ts. This leaves the dev_t in the cache out of date. $PARTED_PROG $DEV0 'rm 1' --script
tests/btrfs/326 +5 -5
@@ -25,8 +25,8 @@ _cleanup() [ -n "$mount_pid" ] && kill $mount_pid &> /dev/null [ -n "$remount_pid" ] && kill $remount_pid &> /dev/null wait - $UMOUNT_PROG "$subv1_mount" &> /dev/null - $UMOUNT_PROG "$subv2_mount" &> /dev/null + _unmount "$subv1_mount" &> /dev/null + _unmount "$subv2_mount" &> /dev/null rm -rf -- "$subv1_mount" "$subv2_mount" }
@@ -80,7 +80,7 @@ mount_workload() trap "wait; exit" SIGTERM while true; do _mount "$SCRATCH_DEV" "$subv2_mount" - $UMOUNT_PROG "$subv2_mount" + _unmount "$subv2_mount" done }
@@ -94,12 +94,12 @@ wait unset remount_pid mount_pid # Subv1 is always mounted, thus the umount should never fail. -$UMOUNT_PROG "$subv1_mount" +_unmount "$subv1_mount" # Subv2 may have already been unmounted, so here we ignore all output. # This may hide some errors like -EBUSY, but the next rm line would # detect any still mounted subvolume so we're still safe. -$UMOUNT_PROG "$subv2_mount" &> /dev/null +_unmount "$subv2_mount" &> /dev/null # If above unmount, especially subv2 is not properly unmounted, # the rm should fail with some error message
tests/btrfs/330 +2 -2
@@ -48,7 +48,7 @@ echo "making sure bar allows writes" touch $TEST_DIR/$seq/bar/qux ls $TEST_DIR/$seq/bar -$UMOUNT_PROG $TEST_DIR/$seq/foo -$UMOUNT_PROG $TEST_DIR/$seq/bar +_unmount $TEST_DIR/$seq/foo +_unmount $TEST_DIR/$seq/bar status=0 ; exit
tests/ext4/032 +2 -2
@@ -63,7 +63,7 @@ ext4_online_resize() fi cat $tmp.resize2fs >> $seqres.full echo "+++ umount fs" | tee -a $seqres.full - $UMOUNT_PROG ${IMG_MNT} + _unmount ${IMG_MNT} echo "+++ check fs" | tee -a $seqres.full _check_generic_filesystem $LOOP_DEVICE >> $seqres.full 2>&1 || \
@@ -77,7 +77,7 @@ _cleanup() cd / [ -n "$LOOP_DEVICE" ] && _destroy_loop_device $LOOP_DEVICE > /dev/null 2>&1 rm -f $tmp.* - $UMOUNT_PROG ${IMG_MNT} > /dev/null 2>&1 + _unmount ${IMG_MNT} > /dev/null 2>&1 rm -f ${IMG_FILE} > /dev/null 2>&1 }
tests/ext4/052 +2 -2
@@ -18,7 +18,7 @@ _cleanup() cd / rm -r -f $tmp.* if [ ! -z "$loop_mnt" ]; then - $UMOUNT_PROG $loop_mnt + _unmount $loop_mnt rm -rf $loop_mnt fi [ ! -z "$fs_img" ] && rm -rf $fs_img
@@ -64,7 +64,7 @@ then status=1 fi -$UMOUNT_PROG $loop_mnt || _fail "umount failed" +_unmount $loop_mnt || _fail "umount failed" loop_mnt= $E2FSCK_PROG -fn $fs_img >> $seqres.full 2>&1 || _fail "file system corrupted"
tests/ext4/053 +16 -16
@@ -20,7 +20,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 _cleanup() { cd / - $UMOUNT_PROG $SCRATCH_MNT > /dev/null 2>&1 + _unmount $SCRATCH_MNT > /dev/null 2>&1 if [ -n "$LOOP_LOGDEV" ];then _destroy_loop_device $LOOP_LOGDEV 2>/dev/null fi
@@ -236,7 +236,7 @@ not_mnt() { if simple_mount -o $1 $SCRATCH_DEV $SCRATCH_MNT; then print_log "(mount unexpectedly succeeded)" fail - $UMOUNT_PROG $SCRATCH_MNT + _unmount $SCRATCH_MNT return fi ok
@@ -247,7 +247,7 @@ not_mnt() { return fi not_remount $1 - $UMOUNT_PROG $SCRATCH_MNT + _unmount $SCRATCH_MNT } mnt_only() {
@@ -269,7 +269,7 @@ mnt() { fi mnt_only $* - $UMOUNT_PROG $SCRATCH_MNT 2> /dev/null + _unmount $SCRATCH_MNT 2> /dev/null [ "$t2fs" -eq 0 ] && return
@@ -288,7 +288,7 @@ mnt() { -e 's/data=writeback/journal_data_writeback/') $TUNE2FS_PROG -o $op_set $SCRATCH_DEV > /dev/null 2>&1 mnt_only "defaults" $check - $UMOUNT_PROG $SCRATCH_MNT 2> /dev/null + _unmount $SCRATCH_MNT 2> /dev/null if [ "$op_set" = ^* ]; then op_set=${op_set#^} else
@@ -308,12 +308,12 @@ remount() { do_mnt remount,$2 $3 if [ $? -ne 0 ]; then fail - $UMOUNT_PROG $SCRATCH_MNT 2> /dev/null + _unmount $SCRATCH_MNT 2> /dev/null return else ok fi - $UMOUNT_PROG $SCRATCH_MNT 2> /dev/null + _unmount $SCRATCH_MNT 2> /dev/null # Now just specify mnt print_log "mounting $fstype \"$1\" "
@@ -327,7 +327,7 @@ remount() { ok fi - $UMOUNT_PROG $SCRATCH_MNT 2> /dev/null + _unmount $SCRATCH_MNT 2> /dev/null } # Test that the filesystem cannot be remounted with option(s) $1 (meaning that
@@ -363,7 +363,7 @@ mnt_then_not_remount() { return fi not_remount $2 - $UMOUNT_PROG $SCRATCH_MNT + _unmount $SCRATCH_MNT }
@@ -399,8 +399,8 @@ LOGDEV_DEVNUM=`echo "${majmin%:*}*2^8 + ${majmin#*:}" | bc` fstype= for fstype in ext2 ext3 ext4; do - $UMOUNT_PROG $SCRATCH_MNT 2> /dev/null - $UMOUNT_PROG $SCRATCH_DEV 2> /dev/null + _unmount $SCRATCH_MNT 2> /dev/null + _unmount $SCRATCH_DEV 2> /dev/null do_mkfs $SCRATCH_DEV ${SIZE}k
@@ -417,7 +417,7 @@ for fstype in ext2 ext3 ext4; do continue fi - $UMOUNT_PROG $SCRATCH_MNT 2> /dev/null + _unmount $SCRATCH_MNT 2> /dev/null not_mnt failme mnt
@@ -551,7 +551,7 @@ for fstype in ext2 ext3 ext4; do # dax mount options simple_mount -o dax=always $SCRATCH_DEV $SCRATCH_MNT > /dev/null 2>&1 if [ $? -eq 0 ]; then - $UMOUNT_PROG $SCRATCH_MNT 2> /dev/null + _unmount $SCRATCH_MNT 2> /dev/null mnt dax mnt dax=always mnt dax=never
@@ -632,7 +632,7 @@ for fstype in ext2 ext3 ext4; do not_remount jqfmt=vfsv1 not_remount noquota mnt_only remount,usrquota,grpquota ^usrquota,^grpquota - $UMOUNT_PROG $SCRATCH_MNT > /dev/null 2>&1 + _unmount $SCRATCH_MNT > /dev/null 2>&1 # test clearing/changing quota when enabled do_mkfs -E quotatype=^prjquota $SCRATCH_DEV ${SIZE}k
@@ -653,7 +653,7 @@ for fstype in ext2 ext3 ext4; do mnt_only remount,usrquota,grpquota usrquota,grpquota quotaoff -f $SCRATCH_MNT >> $seqres.full 2>&1 mnt_only remount,noquota ^usrquota,^grpquota,quota - $UMOUNT_PROG $SCRATCH_MNT > /dev/null 2>&1 + _unmount $SCRATCH_MNT > /dev/null 2>&1 # Quota feature echo "== Testing quota feature " >> $seqres.full
@@ -695,7 +695,7 @@ for fstype in ext2 ext3 ext4; do done #for fstype in ext2 ext3 ext4; do -$UMOUNT_PROG $SCRATCH_MNT > /dev/null 2>&1 +_unmount $SCRATCH_MNT > /dev/null 2>&1 echo "$ERR errors encountered" >> $seqres.full status=$ERR
tests/ext4/056 +1 -1
@@ -72,7 +72,7 @@ do_resize() # delay sleep 0.2 _scratch_unmount >> $seqres.full 2>&1 \ - || _fail "$UMOUNT_PROG failed. Exiting" + || _fail "_unmount failed. Exiting" } run_test()
tests/overlay/003 +1 -1
@@ -56,7 +56,7 @@ rm -rf ${SCRATCH_MNT}/* ls ${SCRATCH_MNT}/ # unmount overlayfs but not base fs -$UMOUNT_PROG $SCRATCH_MNT +_unmount $SCRATCH_MNT echo "Silence is golden" # success, all done
tests/overlay/004 +1 -1
@@ -53,7 +53,7 @@ _user_do "chmod u-X ${SCRATCH_MNT}/attr_file2 > /dev/null 2>&1" stat -c %a ${SCRATCH_MNT}/attr_file2 # unmount overlayfs but not base fs -$UMOUNT_PROG $SCRATCH_MNT +_unmount $SCRATCH_MNT # check mode bits of the file that has been copied up, and # the file that should not have been copied up.
tests/overlay/005 +3 -3
@@ -75,14 +75,14 @@ $XFS_IO_PROG -f -c "o" ${SCRATCH_MNT}/test_file \ >>$seqres.full 2>&1 # unmount overlayfs -$UMOUNT_PROG $SCRATCH_MNT +_unmount $SCRATCH_MNT # check overlayfs _overlay_check_scratch_dirs $lowerd $upperd $workd # unmount undelying xfs, this tiggers panic if memleak happens -$UMOUNT_PROG ${OVL_BASE_SCRATCH_MNT}/uppermnt -$UMOUNT_PROG ${OVL_BASE_SCRATCH_MNT}/lowermnt +_unmount ${OVL_BASE_SCRATCH_MNT}/uppermnt +_unmount ${OVL_BASE_SCRATCH_MNT}/lowermnt # success, all done echo "Silence is golden"
tests/overlay/014 +2 -2
@@ -46,7 +46,7 @@ _overlay_scratch_mount_dirs $lowerdir1 $lowerdir2 $workdir2 rm -rf $SCRATCH_MNT/testdir mkdir -p $SCRATCH_MNT/testdir/visibledir # unmount overlayfs but not base fs -$UMOUNT_PROG $SCRATCH_MNT +_unmount $SCRATCH_MNT # check overlayfs _overlay_check_scratch_dirs $lowerdir1 $lowerdir2 $workdir2
@@ -59,7 +59,7 @@ touch $SCRATCH_MNT/testdir/visiblefile # umount and mount overlay again, buggy kernel treats the copied-up dir as # opaque, visibledir is not seen in merged dir. -$UMOUNT_PROG $SCRATCH_MNT +_unmount $SCRATCH_MNT _overlay_scratch_mount_dirs "$lowerdir2:$lowerdir1" $upperdir $workdir ls $SCRATCH_MNT/testdir
tests/overlay/022 +1 -1
@@ -17,7 +17,7 @@ _begin_fstest auto quick mount nested _cleanup() { cd / - $UMOUNT_PROG $tmp/mnt > /dev/null 2>&1 + _unmount $tmp/mnt > /dev/null 2>&1 rm -rf $tmp rm -f $tmp.* }
tests/overlay/025 +2 -2
@@ -19,8 +19,8 @@ _begin_fstest auto quick attr _cleanup() { cd / - $UMOUNT_PROG $tmpfsdir/mnt - $UMOUNT_PROG $tmpfsdir + _unmount $tmpfsdir/mnt + _unmount $tmpfsdir rm -rf $tmpfsdir rm -f $tmp.* }
tests/overlay/029 +3 -3
@@ -22,7 +22,7 @@ _begin_fstest auto quick nested _cleanup() { cd / - $UMOUNT_PROG $tmp/mnt + _unmount $tmp/mnt rm -rf $tmp rm -f $tmp.* }
@@ -56,7 +56,7 @@ _overlay_mount_dirs $SCRATCH_MNT/up $tmp/{upper,work} \ overlay $tmp/mnt # accessing file in the second mount cat $tmp/mnt/foo -$UMOUNT_PROG $tmp/mnt +_unmount $tmp/mnt # re-create upper/work to avoid ovl_verify_origin() mount failure # when index is enabled
@@ -66,7 +66,7 @@ mkdir -p $tmp/{upper,work} _overlay_mount_dirs $SCRATCH_MNT/low $tmp/{upper,work} \ overlay $tmp/mnt cat $tmp/mnt/bar -$UMOUNT_PROG $tmp/mnt +_unmount $tmp/mnt rm -rf $tmp/{upper,work} mkdir -p $tmp/{upper,work}
tests/overlay/031 +4 -4
@@ -28,7 +28,7 @@ create_whiteout() rm -f $SCRATCH_MNT/testdir/$file - $UMOUNT_PROG $SCRATCH_MNT + _unmount $SCRATCH_MNT } # Import common functions.
@@ -68,7 +68,7 @@ rm -rf $SCRATCH_MNT/testdir 2>&1 | _filter_scratch # umount overlay again, create a new file with the same name and # mount overlay again. -$UMOUNT_PROG $SCRATCH_MNT +_unmount $SCRATCH_MNT touch $lowerdir1/testdir _overlay_scratch_mount_dirs $lowerdir1 $upperdir $workdir
@@ -77,7 +77,7 @@ _overlay_scratch_mount_dirs $lowerdir1 $upperdir $workdir # it will not clean up the dir and lead to residue. rm -rf $SCRATCH_MNT/testdir 2>&1 | _filter_scratch -$UMOUNT_PROG $SCRATCH_MNT +_unmount $SCRATCH_MNT # let lower dir have invalid whiteouts, repeat ls and rmdir test again. rm -rf $lowerdir1/testdir
@@ -92,7 +92,7 @@ _overlay_scratch_mount_dirs "$lowerdir1:$lowerdir2" $upperdir $workdir ls $SCRATCH_MNT/testdir rm -rf $SCRATCH_MNT/testdir 2>&1 | _filter_scratch -$UMOUNT_PROG $SCRATCH_MNT +_unmount $SCRATCH_MNT # let lower dir and upper dir both have invalid whiteouts, repeat ls and rmdir again. rm -rf $lowerdir1/testdir
tests/overlay/035 +1 -1
@@ -43,7 +43,7 @@ mkdir -p $lowerdir1 $lowerdir2 $upperdir $workdir _overlay_scratch_mount_opts -o"lowerdir=$lowerdir2:$lowerdir1" touch $SCRATCH_MNT/foo 2>&1 | _filter_scratch $MOUNT_PROG -o remount,rw $SCRATCH_MNT 2>&1 | _filter_ro_mount -$UMOUNT_PROG $SCRATCH_MNT +_unmount $SCRATCH_MNT # Make workdir immutable to prevent workdir re-create on mount $CHATTR_PROG +i $workdir
tests/overlay/036 +4 -4
@@ -34,8 +34,8 @@ _cleanup() cd / rm -f $tmp.* # unmount the two extra mounts in case they did not fail - $UMOUNT_PROG $SCRATCH_MNT 2>/dev/null - $UMOUNT_PROG $SCRATCH_MNT 2>/dev/null + _unmount $SCRATCH_MNT 2>/dev/null + _unmount $SCRATCH_MNT 2>/dev/null } # Import common functions.
@@ -66,13 +66,13 @@ _overlay_mount_dirs $lowerdir $upperdir $workdir \ # with index=off - expect success _overlay_mount_dirs $lowerdir $upperdir $workdir2 \ overlay0 $SCRATCH_MNT -oindex=off && \ - $UMOUNT_PROG $SCRATCH_MNT + _unmount $SCRATCH_MNT # Try to mount another overlay with the same workdir # with index=off - expect success _overlay_mount_dirs $lowerdir2 $upperdir2 $workdir \ overlay1 $SCRATCH_MNT -oindex=off && \ - $UMOUNT_PROG $SCRATCH_MNT + _unmount $SCRATCH_MNT # Try to mount another overlay with the same upperdir # with index=on - expect EBUSY
tests/overlay/037 +3 -3
@@ -39,17 +39,17 @@ mkdir -p $lowerdir $lowerdir2 $upperdir $upperdir2 $workdir # Mount overlay with lowerdir, upperdir, workdir and index=on # to store the file handles of lowerdir and upperdir in overlay.origin xattr _overlay_scratch_mount_dirs $lowerdir $upperdir $workdir -oindex=on -$UMOUNT_PROG $SCRATCH_MNT +_unmount $SCRATCH_MNT # Try to mount an overlay with the same upperdir and different lowerdir - expect ESTALE _overlay_scratch_mount_dirs $lowerdir2 $upperdir $workdir -oindex=on \ 2>&1 | _filter_error_mount -$UMOUNT_PROG $SCRATCH_MNT 2>/dev/null +_unmount $SCRATCH_MNT 2>/dev/null # Try to mount an overlay with the same workdir and different upperdir - expect ESTALE _overlay_scratch_mount_dirs $lowerdir $upperdir2 $workdir -oindex=on \ 2>&1 | _filter_error_mount -$UMOUNT_PROG $SCRATCH_MNT 2>/dev/null +_unmount $SCRATCH_MNT 2>/dev/null # Mount overlay with original lowerdir, upperdir, workdir and index=on - expect success _overlay_scratch_mount_dirs $lowerdir $upperdir $workdir -oindex=on
tests/overlay/040 +1 -1
@@ -48,7 +48,7 @@ _scratch_mount # modify lower origin file. $CHATTR_PROG +i $SCRATCH_MNT/foo > /dev/null 2>&1 -$UMOUNT_PROG $SCRATCH_MNT +_unmount $SCRATCH_MNT # touching origin file in lower, should succeed touch $lowerdir/foo
tests/overlay/041 +1 -1
@@ -142,7 +142,7 @@ subdir_d=$($here/src/t_dir_type $pure_lower_dir $pure_lower_subdir_st_ino) [[ $subdir_d == "subdir d" ]] || \ echo "Merged dir: Invalid d_ino reported for subdir" -$UMOUNT_PROG $SCRATCH_MNT +_unmount $SCRATCH_MNT # check overlayfs _overlay_check_scratch_dirs $lowerdir $upperdir $workdir -o xino=on
tests/overlay/042 +1 -1
@@ -45,7 +45,7 @@ _scratch_mount -o index=off # Copy up lower and create upper hardlink with no index ln $SCRATCH_MNT/0 $SCRATCH_MNT/1 -$UMOUNT_PROG $SCRATCH_MNT +_unmount $SCRATCH_MNT # Add lower hardlinks while overlay is offline ln $lowerdir/0 $lowerdir/2
tests/overlay/043 +1 -1
@@ -126,7 +126,7 @@ echo 3 > /proc/sys/vm/drop_caches check_inode_numbers $testdir $tmp.after_copyup $tmp.after_move # Verify that the inode numbers survive a mount cycle -$UMOUNT_PROG $SCRATCH_MNT +_unmount $SCRATCH_MNT _overlay_scratch_mount_dirs $lowerdir $upperdir $workdir -o redirect_dir=on,xino=on # Compare inode numbers before/after mount cycle
tests/overlay/044 +1 -1
@@ -99,7 +99,7 @@ cat $FILES check_ino_nlink $SCRATCH_MNT $tmp.before $tmp.after_one # Verify that the hardlinks survive a mount cycle -$UMOUNT_PROG $SCRATCH_MNT +_unmount $SCRATCH_MNT _overlay_check_scratch_dirs $lowerdir $upperdir $workdir -o index=on,xino=on _overlay_scratch_mount_dirs $lowerdir $upperdir $workdir -o index=on,xino=on
tests/overlay/048 +2 -2
@@ -32,7 +32,7 @@ report_nlink() _ls_l $SCRATCH_MNT/$f | awk '{ print $2, $9 }' | _filter_scratch done - $UMOUNT_PROG $SCRATCH_MNT + _unmount $SCRATCH_MNT } # Create lower hardlinks
@@ -101,7 +101,7 @@ touch $SCRATCH_MNT/1 touch $SCRATCH_MNT/2 # Perform the rest of the changes offline -$UMOUNT_PROG $SCRATCH_MNT +_unmount $SCRATCH_MNT test_hardlinks_offline
tests/overlay/049 +1 -1
@@ -32,7 +32,7 @@ create_redirect() touch $SCRATCH_MNT/origin/file mv $SCRATCH_MNT/origin $SCRATCH_MNT/$redirect - $UMOUNT_PROG $SCRATCH_MNT + _unmount $SCRATCH_MNT } # Import common functions.
tests/overlay/050 +1 -1
@@ -76,7 +76,7 @@ mount_dirs() # Unmount the overlay without unmounting base fs unmount_dirs() { - $UMOUNT_PROG $SCRATCH_MNT + _unmount $SCRATCH_MNT } # Check non-stale file handles of lower/upper files and verify
tests/overlay/051 +2 -2
@@ -28,7 +28,7 @@ _cleanup() # Cleanup overlay scratch mount that is holding base test mount # to prevent _check_test_fs and _test_umount from failing before # _check_scratch_fs _scratch_umount - $UMOUNT_PROG $SCRATCH_MNT 2>/dev/null + _unmount $SCRATCH_MNT 2>/dev/null } # Import common functions.
@@ -103,7 +103,7 @@ mount_dirs() # underlying dirs unmount_dirs() { - $UMOUNT_PROG $SCRATCH_MNT + _unmount $SCRATCH_MNT _overlay_check_scratch_dirs $middle:$lower $upper $work \ -o "index=on,nfs_export=on"
tests/overlay/052 +1 -1
@@ -73,7 +73,7 @@ mount_dirs() # Unmount the overlay without unmounting base fs unmount_dirs() { - $UMOUNT_PROG $SCRATCH_MNT + _unmount $SCRATCH_MNT } # Check non-stale file handles of lower/upper moved files
tests/overlay/053 +2 -2
@@ -30,7 +30,7 @@ _cleanup() # Cleanup overlay scratch mount that is holding base test mount # to prevent _check_test_fs and _test_umount from failing before # _check_scratch_fs _scratch_umount - $UMOUNT_PROG $SCRATCH_MNT 2>/dev/null + _unmount $SCRATCH_MNT 2>/dev/null } # Import common functions.
@@ -99,7 +99,7 @@ mount_dirs() # underlying dirs unmount_dirs() { - $UMOUNT_PROG $SCRATCH_MNT + _unmount $SCRATCH_MNT _overlay_check_scratch_dirs $middle:$lower $upper $work \ -o "index=on,nfs_export=on,redirect_dir=on"
tests/overlay/054 +1 -1
@@ -87,7 +87,7 @@ mount_dirs() # Unmount the overlay without unmounting base fs unmount_dirs() { - $UMOUNT_PROG $SCRATCH_MNT + _unmount $SCRATCH_MNT } # Check encode/decode/read file handles of dir with non-indexed ancestor
tests/overlay/055 +2 -2
@@ -37,7 +37,7 @@ _cleanup() # Cleanup overlay scratch mount that is holding base test mount # to prevent _check_test_fs and _test_umount from failing before # _check_scratch_fs _scratch_umount - $UMOUNT_PROG $SCRATCH_MNT 2>/dev/null + _unmount $SCRATCH_MNT 2>/dev/null } # Import common functions.
@@ -109,7 +109,7 @@ mount_dirs() # underlying dirs unmount_dirs() { - $UMOUNT_PROG $SCRATCH_MNT + _unmount $SCRATCH_MNT _overlay_check_scratch_dirs $middle:$lower $upper $work \ -o "index=on,nfs_export=on,redirect_dir=on"
tests/overlay/056 +1 -1
@@ -73,7 +73,7 @@ mkdir $lowerdir/testdir2/subdir _overlay_scratch_mount_dirs $lowerdir $upperdir $workdir touch $SCRATCH_MNT/testdir1/foo touch $SCRATCH_MNT/testdir2/subdir -$UMOUNT_PROG $SCRATCH_MNT +_unmount $SCRATCH_MNT remove_impure $upperdir/testdir1 remove_impure $upperdir/testdir2
tests/overlay/057 +2 -2
@@ -48,7 +48,7 @@ _overlay_scratch_mount_dirs $lowerdir $lowerdir2 $workdir2 -o redirect_dir=on # Create opaque parent with absolute redirect child in middle layer mkdir $SCRATCH_MNT/pure mv $SCRATCH_MNT/origin $SCRATCH_MNT/pure/redirect -$UMOUNT_PROG $SCRATCH_MNT +_unmount $SCRATCH_MNT _overlay_scratch_mount_dirs $lowerdir2:$lowerdir $upperdir $workdir -o redirect_dir=on mv $SCRATCH_MNT/pure/redirect $SCRATCH_MNT/redirect # List content of renamed merge dir before mount cycle
@@ -56,7 +56,7 @@ ls $SCRATCH_MNT/redirect/ # Verify that redirects are followed by listing content of renamed merge dir # after mount cycle -$UMOUNT_PROG $SCRATCH_MNT +_unmount $SCRATCH_MNT _overlay_scratch_mount_dirs $lowerdir2:$lowerdir $upperdir $workdir -o redirect_dir=on ls $SCRATCH_MNT/redirect/
tests/overlay/059 +1 -1
@@ -33,7 +33,7 @@ create_origin_ref() _scratch_mount -o redirect_dir=on mv $SCRATCH_MNT/origin $SCRATCH_MNT/$ref - $UMOUNT_PROG $SCRATCH_MNT + _unmount $SCRATCH_MNT } # Import common functions.
tests/overlay/060 +1 -1
@@ -130,7 +130,7 @@ mount_ro_overlay() umount_overlay() { - $UMOUNT_PROG $SCRATCH_MNT + _unmount $SCRATCH_MNT } # Assumes it is called with overlay mounted.
tests/overlay/062 +1 -1
@@ -18,7 +18,7 @@ _cleanup() { cd / rm -f $tmp.* - $UMOUNT_PROG $lowertestdir + _unmount $lowertestdir } # Import common functions.
tests/overlay/063 +1 -1
@@ -40,7 +40,7 @@ rm ${upperdir}/file mkdir ${SCRATCH_MNT}/file > /dev/null 2>&1 # unmount overlayfs -$UMOUNT_PROG $SCRATCH_MNT +_unmount $SCRATCH_MNT echo "Silence is golden" # success, all done
tests/overlay/065 +11 -11
@@ -30,7 +30,7 @@ _cleanup() { cd / rm -f $tmp.* - $UMOUNT_PROG $mnt2 2>/dev/null + _unmount $mnt2 2>/dev/null } # Import common functions.
@@ -63,7 +63,7 @@ mkdir -p $lowerdir/lower $upperdir $workdir echo Conflicting upperdir/lowerdir _overlay_scratch_mount_dirs $upperdir $upperdir $workdir \ 2>&1 | _filter_error_mount -$UMOUNT_PROG $SCRATCH_MNT 2>/dev/null +_unmount $SCRATCH_MNT 2>/dev/null # Use new upper/work dirs for each test to avoid ESTALE errors # on mismatch lowerdir/upperdir (see test overlay/037)
@@ -75,7 +75,7 @@ mkdir $upperdir $workdir echo Conflicting workdir/lowerdir _overlay_scratch_mount_dirs $workdir $upperdir $workdir \ -oindex=off 2>&1 | _filter_error_mount -$UMOUNT_PROG $SCRATCH_MNT 2>/dev/null +_unmount $SCRATCH_MNT 2>/dev/null rm -rf $upperdir $workdir mkdir -p $upperdir/lower $workdir
@@ -85,7 +85,7 @@ mkdir -p $upperdir/lower $workdir echo Overlapping upperdir/lowerdir _overlay_scratch_mount_dirs $upperdir/lower $upperdir $workdir \ 2>&1 | _filter_error_mount -$UMOUNT_PROG $SCRATCH_MNT 2>/dev/null +_unmount $SCRATCH_MNT 2>/dev/null rm -rf $upperdir $workdir mkdir $upperdir $workdir
@@ -94,7 +94,7 @@ mkdir $upperdir $workdir echo Conflicting lower layers _overlay_scratch_mount_dirs $lowerdir:$lowerdir $upperdir $workdir \ 2>&1 | _filter_error_mount -$UMOUNT_PROG $SCRATCH_MNT 2>/dev/null +_unmount $SCRATCH_MNT 2>/dev/null rm -rf $upperdir $workdir mkdir $upperdir $workdir
@@ -103,7 +103,7 @@ mkdir $upperdir $workdir echo Overlapping lower layers below _overlay_scratch_mount_dirs $lowerdir:$lowerdir/lower $upperdir $workdir \ 2>&1 | _filter_error_mount -$UMOUNT_PROG $SCRATCH_MNT 2>/dev/null +_unmount $SCRATCH_MNT 2>/dev/null rm -rf $upperdir $workdir mkdir $upperdir $workdir
@@ -112,7 +112,7 @@ mkdir $upperdir $workdir echo Overlapping lower layers above _overlay_scratch_mount_dirs $lowerdir/lower:$lowerdir $upperdir $workdir \ 2>&1 | _filter_error_mount -$UMOUNT_PROG $SCRATCH_MNT 2>/dev/null +_unmount $SCRATCH_MNT 2>/dev/null rm -rf $upperdir $workdir mkdir -p $upperdir/upper $workdir $mnt2
@@ -129,14 +129,14 @@ mkdir -p $upperdir2 $workdir2 $mnt2 echo "Overlapping with upperdir of another instance (index=on)" _overlay_scratch_mount_dirs $upperdir/upper $upperdir2 $workdir2 \ -oindex=on 2>&1 | _filter_busy_mount -$UMOUNT_PROG $SCRATCH_MNT 2>/dev/null +_unmount $SCRATCH_MNT 2>/dev/null rm -rf $upperdir2 $workdir2 mkdir -p $upperdir2 $workdir2 echo "Overlapping with upperdir of another instance (index=off)" _overlay_scratch_mount_dirs $upperdir/upper $upperdir2 $workdir2 \ - -oindex=off && $UMOUNT_PROG $SCRATCH_MNT + -oindex=off && _unmount $SCRATCH_MNT rm -rf $upperdir2 $workdir2 mkdir -p $upperdir2 $workdir2
@@ -146,14 +146,14 @@ mkdir -p $upperdir2 $workdir2 echo "Overlapping with workdir of another instance (index=on)" _overlay_scratch_mount_dirs $workdir/work $upperdir2 $workdir2 \ -oindex=on 2>&1 | _filter_busy_mount -$UMOUNT_PROG $SCRATCH_MNT 2>/dev/null +_unmount $SCRATCH_MNT 2>/dev/null rm -rf $upperdir2 $workdir2 mkdir -p $upperdir2 $workdir2 echo "Overlapping with workdir of another instance (index=off)" _overlay_scratch_mount_dirs $workdir/work $upperdir2 $workdir2 \ - -oindex=off && $UMOUNT_PROG $SCRATCH_MNT + -oindex=off && _unmount $SCRATCH_MNT # Move upper layer root into lower layer after mount echo Overlapping upperdir/lowerdir after mount
tests/overlay/067 +1 -1
@@ -70,7 +70,7 @@ stat $testfile >>$seqres.full diff -q $realfile $testfile >>$seqres.full && echo "diff with middle layer file doesn't know right from wrong! (cold cache)" -$UMOUNT_PROG $SCRATCH_MNT +_unmount $SCRATCH_MNT # check overlayfs _overlay_check_scratch_dirs $middle:$lower $upper $work -o xino=off
tests/overlay/068 +2 -2
@@ -28,7 +28,7 @@ _cleanup() cd / rm -f $tmp.* # Unmount the nested overlay mount - $UMOUNT_PROG $mnt2 2>/dev/null + _unmount $mnt2 2>/dev/null } # Import common functions.
@@ -100,7 +100,7 @@ mount_dirs() unmount_dirs() { # unmount & check nested overlay - $UMOUNT_PROG $mnt2 + _unmount $mnt2 _overlay_check_dirs $SCRATCH_MNT $upper2 $work2 \ -o "index=on,nfs_export=on,redirect_dir=on"
tests/overlay/069 +3 -3
@@ -28,7 +28,7 @@ _cleanup() cd / rm -f $tmp.* # Unmount the nested overlay mount - $UMOUNT_PROG $mnt2 2>/dev/null + _unmount $mnt2 2>/dev/null } # Import common functions.
@@ -108,12 +108,12 @@ mount_dirs() unmount_dirs() { # unmount & check nested overlay - $UMOUNT_PROG $mnt2 + _unmount $mnt2 _overlay_check_dirs $SCRATCH_MNT $upper2 $work2 \ -o "index=on,nfs_export=on,redirect_dir=on" # unmount & check underlying overlay - $UMOUNT_PROG $SCRATCH_MNT + _unmount $SCRATCH_MNT _overlay_check_dirs $lower $upper $work \ -o "index=on,nfs_export=on,redirect_dir=on" }
tests/overlay/070 +3 -3
@@ -26,7 +26,7 @@ _cleanup() cd / rm -f $tmp.* # Unmount the nested overlay mount - $UMOUNT_PROG $mnt2 2>/dev/null + _unmount $mnt2 2>/dev/null [ -z "$loopdev" ] || _destroy_loop_device $loopdev }
@@ -93,12 +93,12 @@ mount_dirs() unmount_dirs() { # unmount & check nested overlay - $UMOUNT_PROG $mnt2 + _unmount $mnt2 _overlay_check_dirs $SCRATCH_MNT $upper2 $work2 \ -o "redirect_dir=on,index=on,xino=on" # unmount & check underlying overlay - $UMOUNT_PROG $SCRATCH_MNT + _unmount $SCRATCH_MNT _overlay_check_scratch_dirs $lower $upper $work \ -o "index=on,nfs_export=on" }
tests/overlay/071 +3 -3
@@ -29,7 +29,7 @@ _cleanup() cd / rm -f $tmp.* # Unmount the nested overlay mount - $UMOUNT_PROG $mnt2 2>/dev/null + _unmount $mnt2 2>/dev/null [ -z "$loopdev" ] || _destroy_loop_device $loopdev }
@@ -103,12 +103,12 @@ mount_dirs() unmount_dirs() { # unmount & check nested overlay - $UMOUNT_PROG $mnt2 + _unmount $mnt2 _overlay_check_dirs $SCRATCH_MNT $upper2 $work2 \ -o "redirect_dir=on,index=on,xino=on" # unmount & check underlying overlay - $UMOUNT_PROG $SCRATCH_MNT + _unmount $SCRATCH_MNT _overlay_check_dirs $lower $upper $work \ -o "index=on,nfs_export=on" }
tests/overlay/076 +1 -1
@@ -47,7 +47,7 @@ _scratch_mount # on kernel v5.10..v5.10.14. Anything but hang is considered a test success. $CHATTR_PROG +i $SCRATCH_MNT/foo > /dev/null 2>&1 -$UMOUNT_PROG $SCRATCH_MNT +_unmount $SCRATCH_MNT # success, all done echo "Silence is golden"
tests/overlay/077 +1 -1
@@ -65,7 +65,7 @@ mv $SCRATCH_MNT/f100 $SCRATCH_MNT/former/ # Remove the lower directory and mount overlay again to create # a "former merge dir" -$UMOUNT_PROG $SCRATCH_MNT +_unmount $SCRATCH_MNT rm -rf $lowerdir/former _scratch_mount
tests/overlay/078 +1 -1
@@ -61,7 +61,7 @@ do_check() echo "Test chattr +$1 $2" >> $seqres.full - $UMOUNT_PROG $SCRATCH_MNT + _unmount $SCRATCH_MNT # Add attribute to lower file $CHATTR_PROG +$attr $lowertestfile
tests/overlay/079 +1 -1
@@ -156,7 +156,7 @@ mount_ro_overlay() umount_overlay() { - $UMOUNT_PROG $SCRATCH_MNT + _unmount $SCRATCH_MNT } test_no_access()
tests/overlay/080 +1 -1
@@ -264,7 +264,7 @@ mount_overlay() umount_overlay() { - $UMOUNT_PROG $SCRATCH_MNT + _unmount $SCRATCH_MNT }
tests/overlay/081 +7 -7
@@ -46,7 +46,7 @@ ovl_fsid=$(stat -f -c '%i' $test_dir) echo "Overlayfs (uuid=null) and upper fs fsid differ" # Keep base fs mounted in case it has a volatile fsid (e.g. tmpfs) -$UMOUNT_PROG $SCRATCH_MNT +_unmount $SCRATCH_MNT # Test legacy behavior is preserved by default for existing "impure" overlayfs _scratch_mount
@@ -55,7 +55,7 @@ ovl_fsid=$(stat -f -c '%i' $test_dir) [[ "$ovl_fsid" == "$upper_fsid" ]] || \ echo "Overlayfs (after uuid=null) and upper fs fsid differ" -$UMOUNT_PROG $SCRATCH_MNT +_unmount $SCRATCH_MNT # Test unique fsid on explicit opt-in for existing "impure" overlayfs _scratch_mount -o uuid=on
@@ -65,7 +65,7 @@ ovl_unique_fsid=$ovl_fsid [[ "$ovl_fsid" != "$upper_fsid" ]] || \ echo "Overlayfs (uuid=on) and upper fs fsid are the same" -$UMOUNT_PROG $SCRATCH_MNT +_unmount $SCRATCH_MNT # Test unique fsid is persistent by default after it was created _scratch_mount
@@ -74,7 +74,7 @@ ovl_fsid=$(stat -f -c '%i' $test_dir) [[ "$ovl_fsid" == "$ovl_unique_fsid" ]] || \ echo "Overlayfs (after uuid=on) unique fsid is not persistent" -$UMOUNT_PROG $SCRATCH_MNT +_unmount $SCRATCH_MNT # Test ignore existing persistent fsid on explicit opt-out _scratch_mount -o uuid=null
@@ -83,7 +83,7 @@ ovl_fsid=$(stat -f -c '%i' $test_dir) [[ "$ovl_fsid" == "$upper_fsid" ]] || \ echo "Overlayfs (uuid=null) and upper fs fsid differ" -$UMOUNT_PROG $SCRATCH_MNT +_unmount $SCRATCH_MNT # Test fallback to uuid=null with non-upper ovelray _overlay_scratch_mount_dirs "$upperdir:$lowerdir" "-" "-" -o ro,uuid=on
@@ -110,7 +110,7 @@ ovl_unique_fsid=$ovl_fsid [[ "$ovl_fsid" != "$upper_fsid" ]] || \ echo "Overlayfs (new) and upper fs fsid are the same" -$UMOUNT_PROG $SCRATCH_MNT +_unmount $SCRATCH_MNT # Test unique fsid is persistent by default after it was created _scratch_mount -o uuid=on
@@ -119,7 +119,7 @@ ovl_fsid=$(stat -f -c '%i' $test_dir) [[ "$ovl_fsid" == "$ovl_unique_fsid" ]] || \ echo "Overlayfs (uuid=on) unique fsid is not persistent" -$UMOUNT_PROG $SCRATCH_MNT +_unmount $SCRATCH_MNT echo "Silence is golden" status=0
tests/overlay/083 +1 -1
@@ -52,7 +52,7 @@ $MOUNT_PROG -t overlay | grep ovl_esc_test | tee -a $seqres.full | grep -v spac # Re-create the upper/work dirs to mount them with a different lower # This is required in case index feature is enabled -$UMOUNT_PROG $SCRATCH_MNT +_unmount $SCRATCH_MNT rm -rf "$upperdir" "$workdir" mkdir -p "$upperdir" "$workdir"
tests/overlay/084 +5 -5
@@ -15,7 +15,7 @@ _cleanup() { cd / # Unmount nested mounts if things fail - $UMOUNT_PROG $OVL_BASE_SCRATCH_MNT/nested 2>/dev/null + _unmount $OVL_BASE_SCRATCH_MNT/nested 2>/dev/null rm -rf $tmp }
@@ -44,7 +44,7 @@ nesteddir=$OVL_BASE_SCRATCH_MNT/nested umount_overlay() { - $UMOUNT_PROG $SCRATCH_MNT + _unmount $SCRATCH_MNT } test_escape()
@@ -88,12 +88,12 @@ test_escape() echo "nested xattr mount with trusted.overlay" _overlay_mount_dirs $SCRATCH_MNT/layer2:$SCRATCH_MNT/layer1 - - overlayfs $nesteddir stat $nesteddir/dir/file 2>&1 | _filter_scratch - $UMOUNT_PROG $nesteddir + _unmount $nesteddir echo "nested xattr mount with user.overlay" _overlay_mount_dirs $SCRATCH_MNT/layer2:$SCRATCH_MNT/layer1 - - -o userxattr overlayfs $nesteddir stat $nesteddir/dir/file 2>&1 | _filter_scratch - $UMOUNT_PROG $nesteddir + _unmount $nesteddir # Also ensure propagate the escaped xattr when we copy-up layer2/dir echo "copy-up of escaped xattrs"
@@ -164,7 +164,7 @@ test_escaped_xwhiteout() do_test_xwhiteout $prefix $nesteddir - $UMOUNT_PROG $nesteddir + _unmount $nesteddir } test_escaped_xwhiteout trusted
tests/overlay/085 +1 -1
@@ -157,7 +157,7 @@ mount_ro_overlay() umount_overlay() { - $UMOUNT_PROG $SCRATCH_MNT + _unmount $SCRATCH_MNT } test_no_access()
tests/overlay/086 +4 -4
@@ -38,21 +38,21 @@ $MOUNT_PROG -t overlay none $SCRATCH_MNT \ 2>> $seqres.full && \ echo "ERROR: invalid combination of lowerdir and lowerdir+ mount options" -$UMOUNT_PROG $SCRATCH_MNT 2>/dev/null +_unmount $SCRATCH_MNT 2>/dev/null $MOUNT_PROG -t overlay none $SCRATCH_MNT \ -o"lowerdir=$lowerdir,datadir+=$lowerdir_colons" \ -o redirect_dir=follow,metacopy=on 2>> $seqres.full && \ echo "ERROR: invalid combination of lowerdir and datadir+ mount options" -$UMOUNT_PROG $SCRATCH_MNT 2>/dev/null +_unmount $SCRATCH_MNT 2>/dev/null $MOUNT_PROG -t overlay none $SCRATCH_MNT \ -o"datadir+=$lowerdir,lowerdir+=$lowerdir_colons" \ -o redirect_dir=follow,metacopy=on 2>> $seqres.full && \ echo "ERROR: invalid order of lowerdir+ and datadir+ mount options" -$UMOUNT_PROG $SCRATCH_MNT 2>/dev/null +_unmount $SCRATCH_MNT 2>/dev/null # mount is expected to fail with escaped colons. $MOUNT_PROG -t overlay none $SCRATCH_MNT \
@@ -60,7 +60,7 @@ $MOUNT_PROG -t overlay none $SCRATCH_MNT \ 2>> $seqres.full && \ echo "ERROR: incorrect parsing of escaped colons in lowerdir+ mount option" -$UMOUNT_PROG $SCRATCH_MNT 2>/dev/null +_unmount $SCRATCH_MNT 2>/dev/null # mount is expected to succeed without escaped colons. $MOUNT_PROG -t overlay ovl_esc_test $SCRATCH_MNT \
Re: [PATCH] fstests: finish UMOUNT_PROG to _unmount conversion
Quoted 178 lines · Dave Chinner
Quoted 42 lines · Darrick J. Wong
Quoted 33 lines · Filipe Manana
Quoted 20 lines · Darrick J. Wong
Quoted 18 lines · Anand Jain
Quoted 17 lines · On 20/2/25 02:19, [email protected] wrote:
From: Filipe Manana <[email protected]>
If the test fails or is interrupted after mounting $scratch_dev3 inside the test filesystem and before unmounting at
test_add_device(), we leave without being unable to unmount the test filesystem since it has a mount inside it. This results in the need to manually unmount $scratch_dev3, otherwise a subsequent run of fstests fails since the unmount of the test device fails with-EBUSY.Fix this by unmounting $scratch_dev3 ($seq_mnt) in the
_cleanup()function.Signed-off-by Filipe Manana <[email protected]>--- tests/btrfs/254 | 1 + 1 file changed, 1 insertion(+)Quoted 11 lines
Quoted 9 lines
tests/btrfs/254 _cleanup() · line 24
Quoted 9 lines
tests/btrfs/254 +1
-0@@ -21,6 +21,7 @@ _cleanup() { cd / rm -f $tmp.* + $UMOUNT_PROG $seq_mnt > /dev/null 2>&1This should use the
_unmounthelper that's in for-next.Quoted 7 lines
Sure, it does the same, except that it redirects stdout and stderr to $seqres.full.
Some tests are still calling $UMOUNT_PROG directly. And that's often what we want, so that if umount fails we get a mismatch with the golden output instead of ignoring the failure.
But in this case it's fine.Quoted 4 lines
<groan> You're right, I'd repressed that Chinner decided to introduce
_unmountso that he could improve logging of unmount failures but then he only bothered converting tests/{generic,xfs} because he didn't give a damn about anyone else.That's uncalled for, Darrick.
You know very well that I posted an incomplete RFC that I was asking for reveiw on, not for it to be merged. The maintainer decided to merge it and did not wait for me to finish the conversions.
Quoted 6 lines
Now fstests is stuck with a half finished conversion and no clarity about whether the rest of the $UMOUNT_PROG invocations should be converted to
_umountor if those are somehow intentional.Hey Zorro, do you have any opinion on this? Should someone just finish the $UMOUNT_PROG ->
_unmountconversion next week?Why put it off? With the logging fixes to
_unmount()that are already merged, it's a purely mechanical change using sed. Patch below.-Dave.
--
Dave Chinner
[email protected]fstests: finish
UMOUNT_PROGto_unmountconversionFrom: Dave Chinner <[email protected]>
Because only tests/generic and tests/xfs have been converted so far and the conversion needs finishing.
_unmountis a drop-in replacement for $UMOUNT_PROG, so we can simply do a mechanical conversion like so:$ sed -i s/\$UMOUNT_PROG/_unmount/g tests/*/*Signed-off-by Dave Chinner <[email protected]>--- tests/btrfs/020 | 2 +- tests/btrfs/029 | 2 +- tests/btrfs/031 | 2 +- tests/btrfs/060 | 2 +- tests/btrfs/065 | 2 +- tests/btrfs/066 | 2 +- tests/btrfs/067 | 2 +- tests/btrfs/068 | 2 +- tests/btrfs/075 | 2 +- tests/btrfs/089 | 2 +- tests/btrfs/124 | 2 +- tests/btrfs/125 | 2 +- tests/btrfs/185 | 4 ++-- tests/btrfs/197 | 4 ++-- tests/btrfs/219 | 12 ++++++------ tests/btrfs/254 | 2 +- tests/btrfs/311 | 2 +- tests/btrfs/313 | 2 +- tests/btrfs/314 | 2 +- tests/btrfs/315 | 2 +- tests/btrfs/318 | 6 +++--- tests/btrfs/326 | 10 +++++----- tests/btrfs/330 | 4 ++-- tests/ext4/032 | 4 ++-- tests/ext4/052 | 4 ++-- tests/ext4/053 | 32 ++++++++++++++++---------------- tests/ext4/056 | 2 +- tests/overlay/003 | 2 +- tests/overlay/004 | 2 +- tests/overlay/005 | 6 +++--- tests/overlay/014 | 4 ++-- tests/overlay/022 | 2 +- tests/overlay/025 | 4 ++-- tests/overlay/029 | 6 +++--- tests/overlay/031 | 8 ++++---- tests/overlay/035 | 2 +- tests/overlay/036 | 8 ++++---- tests/overlay/037 | 6 +++--- tests/overlay/040 | 2 +- tests/overlay/041 | 2 +- tests/overlay/042 | 2 +- tests/overlay/043 | 2 +- tests/overlay/044 | 2 +- tests/overlay/048 | 4 ++-- tests/overlay/049 | 2 +- tests/overlay/050 | 2 +- tests/overlay/051 | 4 ++-- tests/overlay/052 | 2 +- tests/overlay/053 | 4 ++-- tests/overlay/054 | 2 +- tests/overlay/055 | 4 ++-- tests/overlay/056 | 2 +- tests/overlay/057 | 4 ++-- tests/overlay/059 | 2 +- tests/overlay/060 | 2 +- tests/overlay/062 | 2 +- tests/overlay/063 | 2 +- tests/overlay/065 | 22 +++++++++++----------- tests/overlay/067 | 2 +- tests/overlay/068 | 4 ++-- tests/overlay/069 | 6 +++--- tests/overlay/070 | 6 +++--- tests/overlay/071 | 6 +++--- tests/overlay/076 | 2 +- tests/overlay/077 | 2 +- tests/overlay/078 | 2 +- tests/overlay/079 | 2 +- tests/overlay/080 | 2 +- tests/overlay/081 | 14 +++++++------- tests/overlay/083 | 2 +- tests/overlay/084 | 10 +++++----- tests/overlay/085 | 2 +- tests/overlay/086 | 8 ++++---- 73 files changed, 153 insertions(+), 153 deletions(-)tests/btrfs/020 +1
-1@@ -17,7 +17,7 @@ _cleanup() { cd / rm -f $tmp.* - $UMOUNT_PROG $loop_mnt + _unmount $loop_mnt _destroy_loop_device $loop_dev1 losetup -d $loop_dev2 >/dev/null 2>&1 _destroy_loop_device $loop_dev3tests/btrfs/029 +0
-0
tests/btrfs/029 cp --reflink=always $orig_file $copy_file >> $seqres.full 2>&1 || echo "cp refli · line 77
Quoted 5 lines
tests/btrfs/029 +1
-1@@ -74,7 +74,7 @@ cp --reflink=always $orig_file $copy_file >> $seqres.full 2>&1 || echo "cp refli md5sum $orig_file | _filter_testdir_and_scratch md5sum $copy_file | _filter_testdir_and_scratch -$UMOUNT_PROG $reflink_test_dir +_unmount $reflink_test_dir
This isn't equivalent to directly calling UMOUNT_PROG since the _unmount helper always redirects stdout and stderr to $seqres.full. Meaning failures may often be ignored or not immediately obvious as before.
This applies to many other places, just picking the first to comment.
Quoted 21 lines
tests/btrfs/029 +0
-0# success, all done status=0tests/btrfs/031 +1
-1@@ -99,7 +99,7 @@ mv $testdir2/file* $subvol2/ echo "Verify the file contents:" _checksum_files -$UMOUNT_PROG $cross_mount_test_dir +_unmount $cross_mount_test_dir # success, all done status=0tests/btrfs/060 +0
-0
tests/btrfs/060 run_test() · line 79
Quoted 5 lines
tests/btrfs/060 +1
-1@@ -76,7 +76,7 @@ run_test() fi # in case the subvolume is still mounted - $UMOUNT_PROG $subvol_mnt >/dev/null 2>&1 + _unmount $subvol_mnt >/dev/null 2>&1
And here there's no point of having the redirections, since the helper always redirects stdout/stderr to $seqres.full.
So it could be removed to make things more readable.
This also applies to many other places, just picking the first to comment.
Thanks.
Quoted 1,523 lines
tests/btrfs/060 +0
-0_scratch_unmount # we called _require_scratch_nocheck instead of _require_scratch # do check after test for each profile configtests/btrfs/065 +1
-1@@ -84,7 +84,7 @@ run_test() fi # in case the subvolume is still mounted - $UMOUNT_PROG $subvol_mnt >/dev/null 2>&1 + _unmount $subvol_mnt >/dev/null 2>&1 _scratch_unmount # we called _require_scratch_nocheck instead of _require_scratch # do check after test for each profile configtests/btrfs/066 +1
-1@@ -76,7 +76,7 @@ run_test() fi # in case the subvolume is still mounted - $UMOUNT_PROG $subvol_mnt >/dev/null 2>&1 + _unmount $subvol_mnt >/dev/null 2>&1 _scratch_unmount # we called _require_scratch_nocheck instead of _require_scratch # do check after test for each profile configtests/btrfs/067 +1
-1@@ -77,7 +77,7 @@ run_test() fi # in case the subvolume is still mounted - $UMOUNT_PROG $subvol_mnt >/dev/null 2>&1 + _unmount $subvol_mnt >/dev/null 2>&1 _scratch_unmount # we called _require_scratch_nocheck instead of _require_scratch # do check after test for each profile configtests/btrfs/068 +1
-1@@ -77,7 +77,7 @@ run_test() fi # in case the subvolume is still mounted - $UMOUNT_PROG $subvol_mnt >/dev/null 2>&1 + _unmount $subvol_mnt >/dev/null 2>&1 _scratch_unmount # we called _require_scratch_nocheck instead of _require_scratch # do check after test for each profile configtests/btrfs/075 +1
-1@@ -15,7 +15,7 @@ _cleanup() { cd / rm -f $tmp.* - $UMOUNT_PROG $subvol_mnt >/dev/null 2>&1 + _unmount $subvol_mnt >/dev/null 2>&1 } . ./common/filtertests/btrfs/089 +1
-1@@ -35,7 +35,7 @@ mount --bind "$SCRATCH_MNT/testvol/testdir" "$SCRATCH_MNT/testvol/mnt" $BTRFS_UTIL_PROG subvolume delete "$SCRATCH_MNT/testvol" >>$seqres.full 2>&1 # Unmount the bind mount, which should still be alive. -$UMOUNT_PROG "$SCRATCH_MNT/testvol/mnt" +_unmount "$SCRATCH_MNT/testvol/mnt" echo "Silence is golden" status=0tests/btrfs/124 +1
-1@@ -132,7 +132,7 @@ if [ "$checkpoint1" != "$checkpoint3" ]; then echo "Inital sum does not match with data on dev2 written by balance" fi -$UMOUNT_PROG $dev2 +_unmount $dev2 _scratch_dev_pool_put _btrfs_rescan_devices _test_mounttests/btrfs/125 +1
-1@@ -144,7 +144,7 @@ if [ "$checkpoint1" != "$checkpoint3" ]; then echo "Inital sum does not match with data on dev2 written by balance" fi -$UMOUNT_PROG $dev2 +_unmount $dev2 _scratch_dev_pool_put _btrfs_rescan_devices _test_mounttests/btrfs/185 +2
-2@@ -15,7 +15,7 @@ mnt=$TEST_DIR/$seq.mnt # Override the default cleanup function. _cleanup() { - $UMOUNT_PROG $mnt > /dev/null 2>&1 + _unmount $mnt > /dev/null 2>&1 rm -rf $mnt > /dev/null 2>&1 cd / rm -f $tmp.*@@ -62,7 +62,7 @@ $BTRFS_UTIL_PROG device scan $device_1 >> $seqres.full 2>&1 _fail "if it fails here, then it means subvolume mount at boot may fail "\ "in some configs." -$UMOUNT_PROG $mnt > /dev/null 2>&1 +_unmount $mnt > /dev/null 2>&1 _scratch_dev_pool_put # success, all donetests/btrfs/197 +2
-2@@ -15,7 +15,7 @@ _begin_fstest auto quick volume # Override the default cleanup function. _cleanup() { - $UMOUNT_PROG $TEST_DIR/$seq.mnt >/dev/null 2>&1 + _unmount $TEST_DIR/$seq.mnt >/dev/null 2>&1 rm -rf $TEST_DIR/$seq.mnt cd / rm -f $tmp.*@@ -67,7 +67,7 @@ workout() grep -q "${SCRATCH_DEV_NAME[1]}" $tmp.output && _fail "found stale device" $BTRFS_UTIL_PROG device remove "${SCRATCH_DEV_NAME[1]}" "$TEST_DIR/$seq.mnt" - $UMOUNT_PROG $TEST_DIR/$seq.mnt + _unmount $TEST_DIR/$seq.mnt _scratch_unmount _spare_dev_put _scratch_dev_pool_puttests/btrfs/219 +6
-6@@ -21,8 +21,8 @@ _cleanup() rm -f $tmp.* # The variables are set before the test case can fail. - $UMOUNT_PROG ${loop_mnt1} &> /dev/null - $UMOUNT_PROG ${loop_mnt2} &> /dev/null + _unmount ${loop_mnt1} &> /dev/null + _unmount ${loop_mnt2} &> /dev/null rm -rf $loop_mnt1 rm -rf $loop_mnt2@@ -66,7 +66,7 @@ loop_dev2=`_create_loop_device $fs_img2` # Normal single device case, should pass just fine _mount $loop_dev1 $loop_mnt1 > /dev/null 2>&1 || \ _fail "Couldn't do initial mount" -$UMOUNT_PROG $loop_mnt1 +_unmount $loop_mnt1 _btrfs_forget_or_module_reload@@ -75,15 +75,15 @@ _btrfs_forget_or_module_reload # measure. _mount $loop_dev1 $loop_mnt1 > /dev/null 2>&1 || \ _fail "Failed to mount the second time" -$UMOUNT_PROG $loop_mnt1 +_unmount $loop_mnt1 _mount $loop_dev2 $loop_mnt2 > /dev/null 2>&1 || \ _fail "We couldn't mount the old generation" -$UMOUNT_PROG $loop_mnt2 +_unmount $loop_mnt2 _mount $loop_dev1 $loop_mnt1 > /dev/null 2>&1 || \ _fail "Failed to mount the second time" -$UMOUNT_PROG $loop_mnt1 +_unmount $loop_mnt1 # Now try mount them at the same time, if kernel does not support # temp-fsid feature then mount will fail.tests/btrfs/254 +1
-1@@ -96,7 +96,7 @@ test_add_device() $BTRFS_UTIL_PROG filesystem show -m $SCRATCH_MNT | \ _filter_btrfs_filesystem_show - $UMOUNT_PROG $seq_mnt + _unmount $seq_mnt _scratch_unmount cleanup_dmdev }tests/btrfs/311 +1
-1@@ -14,7 +14,7 @@ _begin_fstest auto quick subvol tempfsid _cleanup() { cd / - $UMOUNT_PROG $mnt1 > /dev/null 2>&1 + _unmount $mnt1 > /dev/null 2>&1 rm -r -f $tmp.* rm -r -f $mnt1 }tests/btrfs/313 +1
-1@@ -12,7 +12,7 @@ _begin_fstest auto quick clone tempfsid _cleanup() { cd / - $UMOUNT_PROG $mnt1 > /dev/null 2>&1 + _unmount $mnt1 > /dev/null 2>&1 rm -r -f $tmp.* rm -r -f $mnt1 }tests/btrfs/314 +1
-1@@ -13,7 +13,7 @@ _begin_fstest auto quick snapshot send tempfsid _cleanup() { cd / - $UMOUNT_PROG $tempfsid_mnt 2>/dev/null + _unmount $tempfsid_mnt 2>/dev/null rm -r -f $tmp.* rm -r -f $sendfile rm -r -f $tempfsid_mnttests/btrfs/315 +1
-1@@ -13,7 +13,7 @@ _begin_fstest auto quick volume seed balance tempfsid _cleanup() { cd / - $UMOUNT_PROG $tempfsid_mnt 2>/dev/null + _unmount $tempfsid_mnt 2>/dev/null rm -r -f $tmp.* rm -r -f $tempfsid_mnt }tests/btrfs/318 +3
-3@@ -22,8 +22,8 @@ _require_loop _cleanup() { cd / - $UMOUNT_PROG $MNT - $UMOUNT_PROG $BIND + _unmount $MNT + _unmount $BIND losetup -d $DEV0 $DEV1 $DEV2 rm -f $IMG0 $IMG1 $IMG2 rm -rf $MNT $BIND@@ -58,7 +58,7 @@ $MKFS_BTRFS_PROG -f -msingle -dsingle $D0P1 $DEV2 >>$seqres.full 2>&1 || _fail " rm -rf $MNT mkdir -p $MNT _mount $D0P1 $MNT -$UMOUNT_PROG $MNT +_unmount $MNT # Swap the partition dev_ts. This leaves the dev_t in the cache out of date. $PARTED_PROG $DEV0 'rm 1' --scripttests/btrfs/326 +5
-5@@ -25,8 +25,8 @@ _cleanup() [ -n "$mount_pid" ] && kill $mount_pid &> /dev/null [ -n "$remount_pid" ] && kill $remount_pid &> /dev/null wait - $UMOUNT_PROG "$subv1_mount" &> /dev/null - $UMOUNT_PROG "$subv2_mount" &> /dev/null + _unmount "$subv1_mount" &> /dev/null + _unmount "$subv2_mount" &> /dev/null rm -rf -- "$subv1_mount" "$subv2_mount" }@@ -80,7 +80,7 @@ mount_workload() trap "wait; exit" SIGTERM while true; do _mount "$SCRATCH_DEV" "$subv2_mount" - $UMOUNT_PROG "$subv2_mount" + _unmount "$subv2_mount" done }@@ -94,12 +94,12 @@ wait unset remount_pid mount_pid # Subv1 is always mounted, thus the umount should never fail. -$UMOUNT_PROG "$subv1_mount" +_unmount "$subv1_mount" # Subv2 may have already been unmounted, so here we ignore all output. # This may hide some errors like -EBUSY, but the next rm line would # detect any still mounted subvolume so we're still safe. -$UMOUNT_PROG "$subv2_mount" &> /dev/null +_unmount "$subv2_mount" &> /dev/null # If above unmount, especially subv2 is not properly unmounted, # the rm should fail with some error messagetests/btrfs/330 +2
-2@@ -48,7 +48,7 @@ echo "making sure bar allows writes" touch $TEST_DIR/$seq/bar/qux ls $TEST_DIR/$seq/bar -$UMOUNT_PROG $TEST_DIR/$seq/foo -$UMOUNT_PROG $TEST_DIR/$seq/bar +_unmount $TEST_DIR/$seq/foo +_unmount $TEST_DIR/$seq/bar status=0 ; exittests/ext4/032 +2
-2@@ -63,7 +63,7 @@ ext4_online_resize() fi cat $tmp.resize2fs >> $seqres.full echo "+++ umount fs" | tee -a $seqres.full - $UMOUNT_PROG ${IMG_MNT} + _unmount ${IMG_MNT} echo "+++ check fs" | tee -a $seqres.full _check_generic_filesystem $LOOP_DEVICE >> $seqres.full 2>&1 || \@@ -77,7 +77,7 @@ _cleanup() cd / [ -n "$LOOP_DEVICE" ] && _destroy_loop_device $LOOP_DEVICE > /dev/null 2>&1 rm -f $tmp.* - $UMOUNT_PROG ${IMG_MNT} > /dev/null 2>&1 + _unmount ${IMG_MNT} > /dev/null 2>&1 rm -f ${IMG_FILE} > /dev/null 2>&1 }tests/ext4/052 +2
-2@@ -18,7 +18,7 @@ _cleanup() cd / rm -r -f $tmp.* if [ ! -z "$loop_mnt" ]; then - $UMOUNT_PROG $loop_mnt + _unmount $loop_mnt rm -rf $loop_mnt fi [ ! -z "$fs_img" ] && rm -rf $fs_img@@ -64,7 +64,7 @@ then status=1 fi -$UMOUNT_PROG $loop_mnt || _fail "umount failed" +_unmount $loop_mnt || _fail "umount failed" loop_mnt= $E2FSCK_PROG -fn $fs_img >> $seqres.full 2>&1 || _fail "file system corrupted"tests/ext4/053 +16
-16@@ -20,7 +20,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 _cleanup() { cd / - $UMOUNT_PROG $SCRATCH_MNT > /dev/null 2>&1 + _unmount $SCRATCH_MNT > /dev/null 2>&1 if [ -n "$LOOP_LOGDEV" ];then _destroy_loop_device $LOOP_LOGDEV 2>/dev/null fi@@ -236,7 +236,7 @@ not_mnt() { if simple_mount -o $1 $SCRATCH_DEV $SCRATCH_MNT; then print_log "(mount unexpectedly succeeded)" fail - $UMOUNT_PROG $SCRATCH_MNT + _unmount $SCRATCH_MNT return fi ok@@ -247,7 +247,7 @@ not_mnt() { return fi not_remount $1 - $UMOUNT_PROG $SCRATCH_MNT + _unmount $SCRATCH_MNT } mnt_only() {@@ -269,7 +269,7 @@ mnt() { fi mnt_only $* - $UMOUNT_PROG $SCRATCH_MNT 2> /dev/null + _unmount $SCRATCH_MNT 2> /dev/null [ "$t2fs" -eq 0 ] && return@@ -288,7 +288,7 @@ mnt() { -e 's/data=writeback/journal_data_writeback/') $TUNE2FS_PROG -o $op_set $SCRATCH_DEV > /dev/null 2>&1 mnt_only "defaults" $check - $UMOUNT_PROG $SCRATCH_MNT 2> /dev/null + _unmount $SCRATCH_MNT 2> /dev/null if [ "$op_set" = ^* ]; then op_set=${op_set#^} else@@ -308,12 +308,12 @@ remount() { do_mnt remount,$2 $3 if [ $? -ne 0 ]; then fail - $UMOUNT_PROG $SCRATCH_MNT 2> /dev/null + _unmount $SCRATCH_MNT 2> /dev/null return else ok fi - $UMOUNT_PROG $SCRATCH_MNT 2> /dev/null + _unmount $SCRATCH_MNT 2> /dev/null # Now just specify mnt print_log "mounting $fstype \"$1\" "@@ -327,7 +327,7 @@ remount() { ok fi - $UMOUNT_PROG $SCRATCH_MNT 2> /dev/null + _unmount $SCRATCH_MNT 2> /dev/null } # Test that the filesystem cannot be remounted with option(s) $1 (meaning that@@ -363,7 +363,7 @@ mnt_then_not_remount() { return fi not_remount $2 - $UMOUNT_PROG $SCRATCH_MNT + _unmount $SCRATCH_MNT }@@ -399,8 +399,8 @@ LOGDEV_DEVNUM=`echo "${majmin%:*}*2^8 + ${majmin#*:}" | bc` fstype= for fstype in ext2 ext3 ext4; do - $UMOUNT_PROG $SCRATCH_MNT 2> /dev/null - $UMOUNT_PROG $SCRATCH_DEV 2> /dev/null + _unmount $SCRATCH_MNT 2> /dev/null + _unmount $SCRATCH_DEV 2> /dev/null do_mkfs $SCRATCH_DEV ${SIZE}k@@ -417,7 +417,7 @@ for fstype in ext2 ext3 ext4; do continue fi - $UMOUNT_PROG $SCRATCH_MNT 2> /dev/null + _unmount $SCRATCH_MNT 2> /dev/null not_mnt failme mnt@@ -551,7 +551,7 @@ for fstype in ext2 ext3 ext4; do # dax mount options simple_mount -o dax=always $SCRATCH_DEV $SCRATCH_MNT > /dev/null 2>&1 if [ $? -eq 0 ]; then - $UMOUNT_PROG $SCRATCH_MNT 2> /dev/null + _unmount $SCRATCH_MNT 2> /dev/null mnt dax mnt dax=always mnt dax=never@@ -632,7 +632,7 @@ for fstype in ext2 ext3 ext4; do not_remount jqfmt=vfsv1 not_remount noquota mnt_only remount,usrquota,grpquota ^usrquota,^grpquota - $UMOUNT_PROG $SCRATCH_MNT > /dev/null 2>&1 + _unmount $SCRATCH_MNT > /dev/null 2>&1 # test clearing/changing quota when enabled do_mkfs -E quotatype=^prjquota $SCRATCH_DEV ${SIZE}k@@ -653,7 +653,7 @@ for fstype in ext2 ext3 ext4; do mnt_only remount,usrquota,grpquota usrquota,grpquota quotaoff -f $SCRATCH_MNT >> $seqres.full 2>&1 mnt_only remount,noquota ^usrquota,^grpquota,quota - $UMOUNT_PROG $SCRATCH_MNT > /dev/null 2>&1 + _unmount $SCRATCH_MNT > /dev/null 2>&1 # Quota feature echo "== Testing quota feature " >> $seqres.full@@ -695,7 +695,7 @@ for fstype in ext2 ext3 ext4; do done #for fstype in ext2 ext3 ext4; do -$UMOUNT_PROG $SCRATCH_MNT > /dev/null 2>&1 +_unmount $SCRATCH_MNT > /dev/null 2>&1 echo "$ERR errors encountered" >> $seqres.full status=$ERRtests/ext4/056 +1
-1@@ -72,7 +72,7 @@ do_resize() # delay sleep 0.2 _scratch_unmount >> $seqres.full 2>&1 \ - || _fail "$UMOUNT_PROG failed. Exiting" + || _fail "_unmount failed. Exiting" } run_test()tests/overlay/003 +1
-1@@ -56,7 +56,7 @@ rm -rf ${SCRATCH_MNT}/* ls ${SCRATCH_MNT}/ # unmount overlayfs but not base fs -$UMOUNT_PROG $SCRATCH_MNT +_unmount $SCRATCH_MNT echo "Silence is golden" # success, all donetests/overlay/004 +1
-1@@ -53,7 +53,7 @@ _user_do "chmod u-X ${SCRATCH_MNT}/attr_file2 > /dev/null 2>&1" stat -c %a ${SCRATCH_MNT}/attr_file2 # unmount overlayfs but not base fs -$UMOUNT_PROG $SCRATCH_MNT +_unmount $SCRATCH_MNT # check mode bits of the file that has been copied up, and # the file that should not have been copied up.tests/overlay/005 +3
-3@@ -75,14 +75,14 @@ $XFS_IO_PROG -f -c "o" ${SCRATCH_MNT}/test_file \ >>$seqres.full 2>&1 # unmount overlayfs -$UMOUNT_PROG $SCRATCH_MNT +_unmount $SCRATCH_MNT # check overlayfs _overlay_check_scratch_dirs $lowerd $upperd $workd # unmount undelying xfs, this tiggers panic if memleak happens -$UMOUNT_PROG ${OVL_BASE_SCRATCH_MNT}/uppermnt -$UMOUNT_PROG ${OVL_BASE_SCRATCH_MNT}/lowermnt +_unmount ${OVL_BASE_SCRATCH_MNT}/uppermnt +_unmount ${OVL_BASE_SCRATCH_MNT}/lowermnt # success, all done echo "Silence is golden"tests/overlay/014 +2
-2@@ -46,7 +46,7 @@ _overlay_scratch_mount_dirs $lowerdir1 $lowerdir2 $workdir2 rm -rf $SCRATCH_MNT/testdir mkdir -p $SCRATCH_MNT/testdir/visibledir # unmount overlayfs but not base fs -$UMOUNT_PROG $SCRATCH_MNT +_unmount $SCRATCH_MNT # check overlayfs _overlay_check_scratch_dirs $lowerdir1 $lowerdir2 $workdir2@@ -59,7 +59,7 @@ touch $SCRATCH_MNT/testdir/visiblefile # umount and mount overlay again, buggy kernel treats the copied-up dir as # opaque, visibledir is not seen in merged dir. -$UMOUNT_PROG $SCRATCH_MNT +_unmount $SCRATCH_MNT _overlay_scratch_mount_dirs "$lowerdir2:$lowerdir1" $upperdir $workdir ls $SCRATCH_MNT/testdirtests/overlay/022 +1
-1@@ -17,7 +17,7 @@ _begin_fstest auto quick mount nested _cleanup() { cd / - $UMOUNT_PROG $tmp/mnt > /dev/null 2>&1 + _unmount $tmp/mnt > /dev/null 2>&1 rm -rf $tmp rm -f $tmp.* }tests/overlay/025 +2
-2@@ -19,8 +19,8 @@ _begin_fstest auto quick attr _cleanup() { cd / - $UMOUNT_PROG $tmpfsdir/mnt - $UMOUNT_PROG $tmpfsdir + _unmount $tmpfsdir/mnt + _unmount $tmpfsdir rm -rf $tmpfsdir rm -f $tmp.* }tests/overlay/029 +3
-3@@ -22,7 +22,7 @@ _begin_fstest auto quick nested _cleanup() { cd / - $UMOUNT_PROG $tmp/mnt + _unmount $tmp/mnt rm -rf $tmp rm -f $tmp.* }@@ -56,7 +56,7 @@ _overlay_mount_dirs $SCRATCH_MNT/up $tmp/{upper,work} \ overlay $tmp/mnt # accessing file in the second mount cat $tmp/mnt/foo -$UMOUNT_PROG $tmp/mnt +_unmount $tmp/mnt # re-create upper/work to avoid ovl_verify_origin() mount failure # when index is enabled@@ -66,7 +66,7 @@ mkdir -p $tmp/{upper,work} _overlay_mount_dirs $SCRATCH_MNT/low $tmp/{upper,work} \ overlay $tmp/mnt cat $tmp/mnt/bar -$UMOUNT_PROG $tmp/mnt +_unmount $tmp/mnt rm -rf $tmp/{upper,work} mkdir -p $tmp/{upper,work}tests/overlay/031 +4
-4@@ -28,7 +28,7 @@ create_whiteout() rm -f $SCRATCH_MNT/testdir/$file - $UMOUNT_PROG $SCRATCH_MNT + _unmount $SCRATCH_MNT } # Import common functions.@@ -68,7 +68,7 @@ rm -rf $SCRATCH_MNT/testdir 2>&1 | _filter_scratch # umount overlay again, create a new file with the same name and # mount overlay again. -$UMOUNT_PROG $SCRATCH_MNT +_unmount $SCRATCH_MNT touch $lowerdir1/testdir _overlay_scratch_mount_dirs $lowerdir1 $upperdir $workdir@@ -77,7 +77,7 @@ _overlay_scratch_mount_dirs $lowerdir1 $upperdir $workdir # it will not clean up the dir and lead to residue. rm -rf $SCRATCH_MNT/testdir 2>&1 | _filter_scratch -$UMOUNT_PROG $SCRATCH_MNT +_unmount $SCRATCH_MNT # let lower dir have invalid whiteouts, repeat ls and rmdir test again. rm -rf $lowerdir1/testdir@@ -92,7 +92,7 @@ _overlay_scratch_mount_dirs "$lowerdir1:$lowerdir2" $upperdir $workdir ls $SCRATCH_MNT/testdir rm -rf $SCRATCH_MNT/testdir 2>&1 | _filter_scratch -$UMOUNT_PROG $SCRATCH_MNT +_unmount $SCRATCH_MNT # let lower dir and upper dir both have invalid whiteouts, repeat ls and rmdir again. rm -rf $lowerdir1/testdirtests/overlay/035 +1
-1@@ -43,7 +43,7 @@ mkdir -p $lowerdir1 $lowerdir2 $upperdir $workdir _overlay_scratch_mount_opts -o"lowerdir=$lowerdir2:$lowerdir1" touch $SCRATCH_MNT/foo 2>&1 | _filter_scratch $MOUNT_PROG -o remount,rw $SCRATCH_MNT 2>&1 | _filter_ro_mount -$UMOUNT_PROG $SCRATCH_MNT +_unmount $SCRATCH_MNT # Make workdir immutable to prevent workdir re-create on mount $CHATTR_PROG +i $workdirtests/overlay/036 +4
-4@@ -34,8 +34,8 @@ _cleanup() cd / rm -f $tmp.* # unmount the two extra mounts in case they did not fail - $UMOUNT_PROG $SCRATCH_MNT 2>/dev/null - $UMOUNT_PROG $SCRATCH_MNT 2>/dev/null + _unmount $SCRATCH_MNT 2>/dev/null + _unmount $SCRATCH_MNT 2>/dev/null } # Import common functions.@@ -66,13 +66,13 @@ _overlay_mount_dirs $lowerdir $upperdir $workdir \ # with index=off - expect success _overlay_mount_dirs $lowerdir $upperdir $workdir2 \ overlay0 $SCRATCH_MNT -oindex=off && \ - $UMOUNT_PROG $SCRATCH_MNT + _unmount $SCRATCH_MNT # Try to mount another overlay with the same workdir # with index=off - expect success _overlay_mount_dirs $lowerdir2 $upperdir2 $workdir \ overlay1 $SCRATCH_MNT -oindex=off && \ - $UMOUNT_PROG $SCRATCH_MNT + _unmount $SCRATCH_MNT # Try to mount another overlay with the same upperdir # with index=on - expect EBUSYtests/overlay/037 +3
-3@@ -39,17 +39,17 @@ mkdir -p $lowerdir $lowerdir2 $upperdir $upperdir2 $workdir # Mount overlay with lowerdir, upperdir, workdir and index=on # to store the file handles of lowerdir and upperdir in overlay.origin xattr _overlay_scratch_mount_dirs $lowerdir $upperdir $workdir -oindex=on -$UMOUNT_PROG $SCRATCH_MNT +_unmount $SCRATCH_MNT # Try to mount an overlay with the same upperdir and different lowerdir - expect ESTALE _overlay_scratch_mount_dirs $lowerdir2 $upperdir $workdir -oindex=on \ 2>&1 | _filter_error_mount -$UMOUNT_PROG $SCRATCH_MNT 2>/dev/null +_unmount $SCRATCH_MNT 2>/dev/null # Try to mount an overlay with the same workdir and different upperdir - expect ESTALE _overlay_scratch_mount_dirs $lowerdir $upperdir2 $workdir -oindex=on \ 2>&1 | _filter_error_mount -$UMOUNT_PROG $SCRATCH_MNT 2>/dev/null +_unmount $SCRATCH_MNT 2>/dev/null # Mount overlay with original lowerdir, upperdir, workdir and index=on - expect success _overlay_scratch_mount_dirs $lowerdir $upperdir $workdir -oindex=ontests/overlay/040 +1
-1@@ -48,7 +48,7 @@ _scratch_mount # modify lower origin file. $CHATTR_PROG +i $SCRATCH_MNT/foo > /dev/null 2>&1 -$UMOUNT_PROG $SCRATCH_MNT +_unmount $SCRATCH_MNT # touching origin file in lower, should succeed touch $lowerdir/footests/overlay/041 +1
-1@@ -142,7 +142,7 @@ subdir_d=$($here/src/t_dir_type $pure_lower_dir $pure_lower_subdir_st_ino) [[ $subdir_d == "subdir d" ]] || \ echo "Merged dir: Invalid d_ino reported for subdir" -$UMOUNT_PROG $SCRATCH_MNT +_unmount $SCRATCH_MNT # check overlayfs _overlay_check_scratch_dirs $lowerdir $upperdir $workdir -o xino=ontests/overlay/042 +1
-1@@ -45,7 +45,7 @@ _scratch_mount -o index=off # Copy up lower and create upper hardlink with no index ln $SCRATCH_MNT/0 $SCRATCH_MNT/1 -$UMOUNT_PROG $SCRATCH_MNT +_unmount $SCRATCH_MNT # Add lower hardlinks while overlay is offline ln $lowerdir/0 $lowerdir/2tests/overlay/043 +1
-1@@ -126,7 +126,7 @@ echo 3 > /proc/sys/vm/drop_caches check_inode_numbers $testdir $tmp.after_copyup $tmp.after_move # Verify that the inode numbers survive a mount cycle -$UMOUNT_PROG $SCRATCH_MNT +_unmount $SCRATCH_MNT _overlay_scratch_mount_dirs $lowerdir $upperdir $workdir -o redirect_dir=on,xino=on # Compare inode numbers before/after mount cycletests/overlay/044 +1
-1@@ -99,7 +99,7 @@ cat $FILES check_ino_nlink $SCRATCH_MNT $tmp.before $tmp.after_one # Verify that the hardlinks survive a mount cycle -$UMOUNT_PROG $SCRATCH_MNT +_unmount $SCRATCH_MNT _overlay_check_scratch_dirs $lowerdir $upperdir $workdir -o index=on,xino=on _overlay_scratch_mount_dirs $lowerdir $upperdir $workdir -o index=on,xino=ontests/overlay/048 +2
-2@@ -32,7 +32,7 @@ report_nlink() _ls_l $SCRATCH_MNT/$f | awk '{ print $2, $9 }' | _filter_scratch done - $UMOUNT_PROG $SCRATCH_MNT + _unmount $SCRATCH_MNT } # Create lower hardlinks@@ -101,7 +101,7 @@ touch $SCRATCH_MNT/1 touch $SCRATCH_MNT/2 # Perform the rest of the changes offline -$UMOUNT_PROG $SCRATCH_MNT +_unmount $SCRATCH_MNT test_hardlinks_offlinetests/overlay/049 +1
-1@@ -32,7 +32,7 @@ create_redirect() touch $SCRATCH_MNT/origin/file mv $SCRATCH_MNT/origin $SCRATCH_MNT/$redirect - $UMOUNT_PROG $SCRATCH_MNT + _unmount $SCRATCH_MNT } # Import common functions.tests/overlay/050 +1
-1@@ -76,7 +76,7 @@ mount_dirs() # Unmount the overlay without unmounting base fs unmount_dirs() { - $UMOUNT_PROG $SCRATCH_MNT + _unmount $SCRATCH_MNT } # Check non-stale file handles of lower/upper files and verifytests/overlay/051 +2
-2@@ -28,7 +28,7 @@ _cleanup() # Cleanup overlay scratch mount that is holding base test mount # to prevent _check_test_fs and _test_umount from failing before # _check_scratch_fs _scratch_umount - $UMOUNT_PROG $SCRATCH_MNT 2>/dev/null + _unmount $SCRATCH_MNT 2>/dev/null } # Import common functions.@@ -103,7 +103,7 @@ mount_dirs() # underlying dirs unmount_dirs() { - $UMOUNT_PROG $SCRATCH_MNT + _unmount $SCRATCH_MNT _overlay_check_scratch_dirs $middle:$lower $upper $work \ -o "index=on,nfs_export=on"tests/overlay/052 +1
-1@@ -73,7 +73,7 @@ mount_dirs() # Unmount the overlay without unmounting base fs unmount_dirs() { - $UMOUNT_PROG $SCRATCH_MNT + _unmount $SCRATCH_MNT } # Check non-stale file handles of lower/upper moved filestests/overlay/053 +2
-2@@ -30,7 +30,7 @@ _cleanup() # Cleanup overlay scratch mount that is holding base test mount # to prevent _check_test_fs and _test_umount from failing before # _check_scratch_fs _scratch_umount - $UMOUNT_PROG $SCRATCH_MNT 2>/dev/null + _unmount $SCRATCH_MNT 2>/dev/null } # Import common functions.@@ -99,7 +99,7 @@ mount_dirs() # underlying dirs unmount_dirs() { - $UMOUNT_PROG $SCRATCH_MNT + _unmount $SCRATCH_MNT _overlay_check_scratch_dirs $middle:$lower $upper $work \ -o "index=on,nfs_export=on,redirect_dir=on"tests/overlay/054 +1
-1@@ -87,7 +87,7 @@ mount_dirs() # Unmount the overlay without unmounting base fs unmount_dirs() { - $UMOUNT_PROG $SCRATCH_MNT + _unmount $SCRATCH_MNT } # Check encode/decode/read file handles of dir with non-indexed ancestortests/overlay/055 +2
-2@@ -37,7 +37,7 @@ _cleanup() # Cleanup overlay scratch mount that is holding base test mount # to prevent _check_test_fs and _test_umount from failing before # _check_scratch_fs _scratch_umount - $UMOUNT_PROG $SCRATCH_MNT 2>/dev/null + _unmount $SCRATCH_MNT 2>/dev/null } # Import common functions.@@ -109,7 +109,7 @@ mount_dirs() # underlying dirs unmount_dirs() { - $UMOUNT_PROG $SCRATCH_MNT + _unmount $SCRATCH_MNT _overlay_check_scratch_dirs $middle:$lower $upper $work \ -o "index=on,nfs_export=on,redirect_dir=on"tests/overlay/056 +1
-1@@ -73,7 +73,7 @@ mkdir $lowerdir/testdir2/subdir _overlay_scratch_mount_dirs $lowerdir $upperdir $workdir touch $SCRATCH_MNT/testdir1/foo touch $SCRATCH_MNT/testdir2/subdir -$UMOUNT_PROG $SCRATCH_MNT +_unmount $SCRATCH_MNT remove_impure $upperdir/testdir1 remove_impure $upperdir/testdir2tests/overlay/057 +2
-2@@ -48,7 +48,7 @@ _overlay_scratch_mount_dirs $lowerdir $lowerdir2 $workdir2 -o redirect_dir=on # Create opaque parent with absolute redirect child in middle layer mkdir $SCRATCH_MNT/pure mv $SCRATCH_MNT/origin $SCRATCH_MNT/pure/redirect -$UMOUNT_PROG $SCRATCH_MNT +_unmount $SCRATCH_MNT _overlay_scratch_mount_dirs $lowerdir2:$lowerdir $upperdir $workdir -o redirect_dir=on mv $SCRATCH_MNT/pure/redirect $SCRATCH_MNT/redirect # List content of renamed merge dir before mount cycle@@ -56,7 +56,7 @@ ls $SCRATCH_MNT/redirect/ # Verify that redirects are followed by listing content of renamed merge dir # after mount cycle -$UMOUNT_PROG $SCRATCH_MNT +_unmount $SCRATCH_MNT _overlay_scratch_mount_dirs $lowerdir2:$lowerdir $upperdir $workdir -o redirect_dir=on ls $SCRATCH_MNT/redirect/tests/overlay/059 +1
-1@@ -33,7 +33,7 @@ create_origin_ref() _scratch_mount -o redirect_dir=on mv $SCRATCH_MNT/origin $SCRATCH_MNT/$ref - $UMOUNT_PROG $SCRATCH_MNT + _unmount $SCRATCH_MNT } # Import common functions.tests/overlay/060 +1
-1@@ -130,7 +130,7 @@ mount_ro_overlay() umount_overlay() { - $UMOUNT_PROG $SCRATCH_MNT + _unmount $SCRATCH_MNT } # Assumes it is called with overlay mounted.tests/overlay/062 +1
-1@@ -18,7 +18,7 @@ _cleanup() { cd / rm -f $tmp.* - $UMOUNT_PROG $lowertestdir + _unmount $lowertestdir } # Import common functions.tests/overlay/063 +1
-1@@ -40,7 +40,7 @@ rm ${upperdir}/file mkdir ${SCRATCH_MNT}/file > /dev/null 2>&1 # unmount overlayfs -$UMOUNT_PROG $SCRATCH_MNT +_unmount $SCRATCH_MNT echo "Silence is golden" # success, all donetests/overlay/065 +11
-11@@ -30,7 +30,7 @@ _cleanup() { cd / rm -f $tmp.* - $UMOUNT_PROG $mnt2 2>/dev/null + _unmount $mnt2 2>/dev/null } # Import common functions.@@ -63,7 +63,7 @@ mkdir -p $lowerdir/lower $upperdir $workdir echo Conflicting upperdir/lowerdir _overlay_scratch_mount_dirs $upperdir $upperdir $workdir \ 2>&1 | _filter_error_mount -$UMOUNT_PROG $SCRATCH_MNT 2>/dev/null +_unmount $SCRATCH_MNT 2>/dev/null # Use new upper/work dirs for each test to avoid ESTALE errors # on mismatch lowerdir/upperdir (see test overlay/037)@@ -75,7 +75,7 @@ mkdir $upperdir $workdir echo Conflicting workdir/lowerdir _overlay_scratch_mount_dirs $workdir $upperdir $workdir \ -oindex=off 2>&1 | _filter_error_mount -$UMOUNT_PROG $SCRATCH_MNT 2>/dev/null +_unmount $SCRATCH_MNT 2>/dev/null rm -rf $upperdir $workdir mkdir -p $upperdir/lower $workdir@@ -85,7 +85,7 @@ mkdir -p $upperdir/lower $workdir echo Overlapping upperdir/lowerdir _overlay_scratch_mount_dirs $upperdir/lower $upperdir $workdir \ 2>&1 | _filter_error_mount -$UMOUNT_PROG $SCRATCH_MNT 2>/dev/null +_unmount $SCRATCH_MNT 2>/dev/null rm -rf $upperdir $workdir mkdir $upperdir $workdir@@ -94,7 +94,7 @@ mkdir $upperdir $workdir echo Conflicting lower layers _overlay_scratch_mount_dirs $lowerdir:$lowerdir $upperdir $workdir \ 2>&1 | _filter_error_mount -$UMOUNT_PROG $SCRATCH_MNT 2>/dev/null +_unmount $SCRATCH_MNT 2>/dev/null rm -rf $upperdir $workdir mkdir $upperdir $workdir@@ -103,7 +103,7 @@ mkdir $upperdir $workdir echo Overlapping lower layers below _overlay_scratch_mount_dirs $lowerdir:$lowerdir/lower $upperdir $workdir \ 2>&1 | _filter_error_mount -$UMOUNT_PROG $SCRATCH_MNT 2>/dev/null +_unmount $SCRATCH_MNT 2>/dev/null rm -rf $upperdir $workdir mkdir $upperdir $workdir@@ -112,7 +112,7 @@ mkdir $upperdir $workdir echo Overlapping lower layers above _overlay_scratch_mount_dirs $lowerdir/lower:$lowerdir $upperdir $workdir \ 2>&1 | _filter_error_mount -$UMOUNT_PROG $SCRATCH_MNT 2>/dev/null +_unmount $SCRATCH_MNT 2>/dev/null rm -rf $upperdir $workdir mkdir -p $upperdir/upper $workdir $mnt2@@ -129,14 +129,14 @@ mkdir -p $upperdir2 $workdir2 $mnt2 echo "Overlapping with upperdir of another instance (index=on)" _overlay_scratch_mount_dirs $upperdir/upper $upperdir2 $workdir2 \ -oindex=on 2>&1 | _filter_busy_mount -$UMOUNT_PROG $SCRATCH_MNT 2>/dev/null +_unmount $SCRATCH_MNT 2>/dev/null rm -rf $upperdir2 $workdir2 mkdir -p $upperdir2 $workdir2 echo "Overlapping with upperdir of another instance (index=off)" _overlay_scratch_mount_dirs $upperdir/upper $upperdir2 $workdir2 \ - -oindex=off && $UMOUNT_PROG $SCRATCH_MNT + -oindex=off && _unmount $SCRATCH_MNT rm -rf $upperdir2 $workdir2 mkdir -p $upperdir2 $workdir2@@ -146,14 +146,14 @@ mkdir -p $upperdir2 $workdir2 echo "Overlapping with workdir of another instance (index=on)" _overlay_scratch_mount_dirs $workdir/work $upperdir2 $workdir2 \ -oindex=on 2>&1 | _filter_busy_mount -$UMOUNT_PROG $SCRATCH_MNT 2>/dev/null +_unmount $SCRATCH_MNT 2>/dev/null rm -rf $upperdir2 $workdir2 mkdir -p $upperdir2 $workdir2 echo "Overlapping with workdir of another instance (index=off)" _overlay_scratch_mount_dirs $workdir/work $upperdir2 $workdir2 \ - -oindex=off && $UMOUNT_PROG $SCRATCH_MNT + -oindex=off && _unmount $SCRATCH_MNT # Move upper layer root into lower layer after mount echo Overlapping upperdir/lowerdir after mounttests/overlay/067 +1
-1@@ -70,7 +70,7 @@ stat $testfile >>$seqres.full diff -q $realfile $testfile >>$seqres.full && echo "diff with middle layer file doesn't know right from wrong! (cold cache)" -$UMOUNT_PROG $SCRATCH_MNT +_unmount $SCRATCH_MNT # check overlayfs _overlay_check_scratch_dirs $middle:$lower $upper $work -o xino=offtests/overlay/068 +2
-2@@ -28,7 +28,7 @@ _cleanup() cd / rm -f $tmp.* # Unmount the nested overlay mount - $UMOUNT_PROG $mnt2 2>/dev/null + _unmount $mnt2 2>/dev/null } # Import common functions.@@ -100,7 +100,7 @@ mount_dirs() unmount_dirs() { # unmount & check nested overlay - $UMOUNT_PROG $mnt2 + _unmount $mnt2 _overlay_check_dirs $SCRATCH_MNT $upper2 $work2 \ -o "index=on,nfs_export=on,redirect_dir=on"tests/overlay/069 +3
-3@@ -28,7 +28,7 @@ _cleanup() cd / rm -f $tmp.* # Unmount the nested overlay mount - $UMOUNT_PROG $mnt2 2>/dev/null + _unmount $mnt2 2>/dev/null } # Import common functions.@@ -108,12 +108,12 @@ mount_dirs() unmount_dirs() { # unmount & check nested overlay - $UMOUNT_PROG $mnt2 + _unmount $mnt2 _overlay_check_dirs $SCRATCH_MNT $upper2 $work2 \ -o "index=on,nfs_export=on,redirect_dir=on" # unmount & check underlying overlay - $UMOUNT_PROG $SCRATCH_MNT + _unmount $SCRATCH_MNT _overlay_check_dirs $lower $upper $work \ -o "index=on,nfs_export=on,redirect_dir=on" }tests/overlay/070 +3
-3@@ -26,7 +26,7 @@ _cleanup() cd / rm -f $tmp.* # Unmount the nested overlay mount - $UMOUNT_PROG $mnt2 2>/dev/null + _unmount $mnt2 2>/dev/null [ -z "$loopdev" ] || _destroy_loop_device $loopdev }@@ -93,12 +93,12 @@ mount_dirs() unmount_dirs() { # unmount & check nested overlay - $UMOUNT_PROG $mnt2 + _unmount $mnt2 _overlay_check_dirs $SCRATCH_MNT $upper2 $work2 \ -o "redirect_dir=on,index=on,xino=on" # unmount & check underlying overlay - $UMOUNT_PROG $SCRATCH_MNT + _unmount $SCRATCH_MNT _overlay_check_scratch_dirs $lower $upper $work \ -o "index=on,nfs_export=on" }tests/overlay/071 +3
-3@@ -29,7 +29,7 @@ _cleanup() cd / rm -f $tmp.* # Unmount the nested overlay mount - $UMOUNT_PROG $mnt2 2>/dev/null + _unmount $mnt2 2>/dev/null [ -z "$loopdev" ] || _destroy_loop_device $loopdev }@@ -103,12 +103,12 @@ mount_dirs() unmount_dirs() { # unmount & check nested overlay - $UMOUNT_PROG $mnt2 + _unmount $mnt2 _overlay_check_dirs $SCRATCH_MNT $upper2 $work2 \ -o "redirect_dir=on,index=on,xino=on" # unmount & check underlying overlay - $UMOUNT_PROG $SCRATCH_MNT + _unmount $SCRATCH_MNT _overlay_check_dirs $lower $upper $work \ -o "index=on,nfs_export=on" }tests/overlay/076 +1
-1@@ -47,7 +47,7 @@ _scratch_mount # on kernel v5.10..v5.10.14. Anything but hang is considered a test success. $CHATTR_PROG +i $SCRATCH_MNT/foo > /dev/null 2>&1 -$UMOUNT_PROG $SCRATCH_MNT +_unmount $SCRATCH_MNT # success, all done echo "Silence is golden"tests/overlay/077 +1
-1@@ -65,7 +65,7 @@ mv $SCRATCH_MNT/f100 $SCRATCH_MNT/former/ # Remove the lower directory and mount overlay again to create # a "former merge dir" -$UMOUNT_PROG $SCRATCH_MNT +_unmount $SCRATCH_MNT rm -rf $lowerdir/former _scratch_mounttests/overlay/078 +1
-1@@ -61,7 +61,7 @@ do_check() echo "Test chattr +$1 $2" >> $seqres.full - $UMOUNT_PROG $SCRATCH_MNT + _unmount $SCRATCH_MNT # Add attribute to lower file $CHATTR_PROG +$attr $lowertestfiletests/overlay/079 +1
-1@@ -156,7 +156,7 @@ mount_ro_overlay() umount_overlay() { - $UMOUNT_PROG $SCRATCH_MNT + _unmount $SCRATCH_MNT } test_no_access()tests/overlay/080 +1
-1@@ -264,7 +264,7 @@ mount_overlay() umount_overlay() { - $UMOUNT_PROG $SCRATCH_MNT + _unmount $SCRATCH_MNT }tests/overlay/081 +7
-7@@ -46,7 +46,7 @@ ovl_fsid=$(stat -f -c '%i' $test_dir) echo "Overlayfs (uuid=null) and upper fs fsid differ" # Keep base fs mounted in case it has a volatile fsid (e.g. tmpfs) -$UMOUNT_PROG $SCRATCH_MNT +_unmount $SCRATCH_MNT # Test legacy behavior is preserved by default for existing "impure" overlayfs _scratch_mount@@ -55,7 +55,7 @@ ovl_fsid=$(stat -f -c '%i' $test_dir) [[ "$ovl_fsid" == "$upper_fsid" ]] || \ echo "Overlayfs (after uuid=null) and upper fs fsid differ" -$UMOUNT_PROG $SCRATCH_MNT +_unmount $SCRATCH_MNT # Test unique fsid on explicit opt-in for existing "impure" overlayfs _scratch_mount -o uuid=on@@ -65,7 +65,7 @@ ovl_unique_fsid=$ovl_fsid [[ "$ovl_fsid" != "$upper_fsid" ]] || \ echo "Overlayfs (uuid=on) and upper fs fsid are the same" -$UMOUNT_PROG $SCRATCH_MNT +_unmount $SCRATCH_MNT # Test unique fsid is persistent by default after it was created _scratch_mount@@ -74,7 +74,7 @@ ovl_fsid=$(stat -f -c '%i' $test_dir) [[ "$ovl_fsid" == "$ovl_unique_fsid" ]] || \ echo "Overlayfs (after uuid=on) unique fsid is not persistent" -$UMOUNT_PROG $SCRATCH_MNT +_unmount $SCRATCH_MNT # Test ignore existing persistent fsid on explicit opt-out _scratch_mount -o uuid=null@@ -83,7 +83,7 @@ ovl_fsid=$(stat -f -c '%i' $test_dir) [[ "$ovl_fsid" == "$upper_fsid" ]] || \ echo "Overlayfs (uuid=null) and upper fs fsid differ" -$UMOUNT_PROG $SCRATCH_MNT +_unmount $SCRATCH_MNT # Test fallback to uuid=null with non-upper ovelray _overlay_scratch_mount_dirs "$upperdir:$lowerdir" "-" "-" -o ro,uuid=on@@ -110,7 +110,7 @@ ovl_unique_fsid=$ovl_fsid [[ "$ovl_fsid" != "$upper_fsid" ]] || \ echo "Overlayfs (new) and upper fs fsid are the same" -$UMOUNT_PROG $SCRATCH_MNT +_unmount $SCRATCH_MNT # Test unique fsid is persistent by default after it was created _scratch_mount -o uuid=on@@ -119,7 +119,7 @@ ovl_fsid=$(stat -f -c '%i' $test_dir) [[ "$ovl_fsid" == "$ovl_unique_fsid" ]] || \ echo "Overlayfs (uuid=on) unique fsid is not persistent" -$UMOUNT_PROG $SCRATCH_MNT +_unmount $SCRATCH_MNT echo "Silence is golden" status=0tests/overlay/083 +1
-1@@ -52,7 +52,7 @@ $MOUNT_PROG -t overlay | grep ovl_esc_test | tee -a $seqres.full | grep -v spac # Re-create the upper/work dirs to mount them with a different lower # This is required in case index feature is enabled -$UMOUNT_PROG $SCRATCH_MNT +_unmount $SCRATCH_MNT rm -rf "$upperdir" "$workdir" mkdir -p "$upperdir" "$workdir"tests/overlay/084 +5
-5@@ -15,7 +15,7 @@ _cleanup() { cd / # Unmount nested mounts if things fail - $UMOUNT_PROG $OVL_BASE_SCRATCH_MNT/nested 2>/dev/null + _unmount $OVL_BASE_SCRATCH_MNT/nested 2>/dev/null rm -rf $tmp }@@ -44,7 +44,7 @@ nesteddir=$OVL_BASE_SCRATCH_MNT/nested umount_overlay() { - $UMOUNT_PROG $SCRATCH_MNT + _unmount $SCRATCH_MNT } test_escape()@@ -88,12 +88,12 @@ test_escape() echo "nested xattr mount with trusted.overlay" _overlay_mount_dirs $SCRATCH_MNT/layer2:$SCRATCH_MNT/layer1 - - overlayfs $nesteddir stat $nesteddir/dir/file 2>&1 | _filter_scratch - $UMOUNT_PROG $nesteddir + _unmount $nesteddir echo "nested xattr mount with user.overlay" _overlay_mount_dirs $SCRATCH_MNT/layer2:$SCRATCH_MNT/layer1 - - -o userxattr overlayfs $nesteddir stat $nesteddir/dir/file 2>&1 | _filter_scratch - $UMOUNT_PROG $nesteddir + _unmount $nesteddir # Also ensure propagate the escaped xattr when we copy-up layer2/dir echo "copy-up of escaped xattrs"@@ -164,7 +164,7 @@ test_escaped_xwhiteout() do_test_xwhiteout $prefix $nesteddir - $UMOUNT_PROG $nesteddir + _unmount $nesteddir } test_escaped_xwhiteout trustedtests/overlay/085 +1
-1@@ -157,7 +157,7 @@ mount_ro_overlay() umount_overlay() { - $UMOUNT_PROG $SCRATCH_MNT + _unmount $SCRATCH_MNT } test_no_access()tests/overlay/086 +4
-4@@ -38,21 +38,21 @@ $MOUNT_PROG -t overlay none $SCRATCH_MNT \ 2>> $seqres.full && \ echo "ERROR: invalid combination of lowerdir and lowerdir+ mount options" -$UMOUNT_PROG $SCRATCH_MNT 2>/dev/null +_unmount $SCRATCH_MNT 2>/dev/null $MOUNT_PROG -t overlay none $SCRATCH_MNT \ -o"lowerdir=$lowerdir,datadir+=$lowerdir_colons" \ -o redirect_dir=follow,metacopy=on 2>> $seqres.full && \ echo "ERROR: invalid combination of lowerdir and datadir+ mount options" -$UMOUNT_PROG $SCRATCH_MNT 2>/dev/null +_unmount $SCRATCH_MNT 2>/dev/null $MOUNT_PROG -t overlay none $SCRATCH_MNT \ -o"datadir+=$lowerdir,lowerdir+=$lowerdir_colons" \ -o redirect_dir=follow,metacopy=on 2>> $seqres.full && \ echo "ERROR: invalid order of lowerdir+ and datadir+ mount options" -$UMOUNT_PROG $SCRATCH_MNT 2>/dev/null +_unmount $SCRATCH_MNT 2>/dev/null # mount is expected to fail with escaped colons. $MOUNT_PROG -t overlay none $SCRATCH_MNT \@@ -60,7 +60,7 @@ $MOUNT_PROG -t overlay none $SCRATCH_MNT \ 2>> $seqres.full && \ echo "ERROR: incorrect parsing of escaped colons in lowerdir+ mount option" -$UMOUNT_PROG $SCRATCH_MNT 2>/dev/null +_unmount $SCRATCH_MNT 2>/dev/null # mount is expected to succeed without escaped colons. $MOUNT_PROG -t overlay ovl_esc_test $SCRATCH_MNT \
Re: [PATCH] fstests: finish UMOUNT_PROG to _unmount conversion
Quoted 182 lines · Filipe Manana
Quoted 181 lines · Dave Chinner
Quoted 42 lines · Darrick J. Wong
Quoted 33 lines · Filipe Manana
Quoted 20 lines · Darrick J. Wong
Quoted 18 lines · Anand Jain
Quoted 17 lines · On 20/2/25 02:19, [email protected] wrote:
From: Filipe Manana <[email protected]>
If the test fails or is interrupted after mounting $scratch_dev3 inside the test filesystem and before unmounting at
test_add_device(), we leave without being unable to unmount the test filesystem since it has a mount inside it. This results in the need to manually unmount $scratch_dev3, otherwise a subsequent run of fstests fails since the unmount of the test device fails with-EBUSY.Fix this by unmounting $scratch_dev3 ($seq_mnt) in the
_cleanup()function.Signed-off-by Filipe Manana <[email protected]>--- tests/btrfs/254 | 1 + 1 file changed, 1 insertion(+)Quoted 11 lines
Quoted 9 lines
tests/btrfs/254 _cleanup() · line 24
Quoted 9 lines
tests/btrfs/254 +1
-0@@ -21,6 +21,7 @@ _cleanup() { cd / rm -f $tmp.* + $UMOUNT_PROG $seq_mnt > /dev/null 2>&1This should use the
_unmounthelper that's in for-next.Quoted 7 lines
Sure, it does the same, except that it redirects stdout and stderr to $seqres.full.
Some tests are still calling $UMOUNT_PROG directly. And that's often what we want, so that if umount fails we get a mismatch with the golden output instead of ignoring the failure.
But in this case it's fine.Quoted 4 lines
<groan> You're right, I'd repressed that Chinner decided to introduce
_unmountso that he could improve logging of unmount failures but then he only bothered converting tests/{generic,xfs} because he didn't give a damn about anyone else.That's uncalled for, Darrick.
You know very well that I posted an incomplete RFC that I was asking for reveiw on, not for it to be merged. The maintainer decided to merge it and did not wait for me to finish the conversions.
Quoted 6 lines
Now fstests is stuck with a half finished conversion and no clarity about whether the rest of the $UMOUNT_PROG invocations should be converted to
_umountor if those are somehow intentional.Hey Zorro, do you have any opinion on this? Should someone just finish the $UMOUNT_PROG ->
_unmountconversion next week?Why put it off? With the logging fixes to
_unmount()that are already merged, it's a purely mechanical change using sed. Patch below.-Dave.
--
Dave Chinner
[email protected]fstests: finish
UMOUNT_PROGto_unmountconversionFrom: Dave Chinner <[email protected]>
Because only tests/generic and tests/xfs have been converted so far and the conversion needs finishing.
_unmountis a drop-in replacement for $UMOUNT_PROG, so we can simply do a mechanical conversion like so:$ sed -i s/\$UMOUNT_PROG/_unmount/g tests/*/*Signed-off-by Dave Chinner <[email protected]>--- tests/btrfs/020 | 2 +- tests/btrfs/029 | 2 +- tests/btrfs/031 | 2 +- tests/btrfs/060 | 2 +- tests/btrfs/065 | 2 +- tests/btrfs/066 | 2 +- tests/btrfs/067 | 2 +- tests/btrfs/068 | 2 +- tests/btrfs/075 | 2 +- tests/btrfs/089 | 2 +- tests/btrfs/124 | 2 +- tests/btrfs/125 | 2 +- tests/btrfs/185 | 4 ++-- tests/btrfs/197 | 4 ++-- tests/btrfs/219 | 12 ++++++------ tests/btrfs/254 | 2 +- tests/btrfs/311 | 2 +- tests/btrfs/313 | 2 +- tests/btrfs/314 | 2 +- tests/btrfs/315 | 2 +- tests/btrfs/318 | 6 +++--- tests/btrfs/326 | 10 +++++----- tests/btrfs/330 | 4 ++-- tests/ext4/032 | 4 ++-- tests/ext4/052 | 4 ++-- tests/ext4/053 | 32 ++++++++++++++++---------------- tests/ext4/056 | 2 +- tests/overlay/003 | 2 +- tests/overlay/004 | 2 +- tests/overlay/005 | 6 +++--- tests/overlay/014 | 4 ++-- tests/overlay/022 | 2 +- tests/overlay/025 | 4 ++-- tests/overlay/029 | 6 +++--- tests/overlay/031 | 8 ++++---- tests/overlay/035 | 2 +- tests/overlay/036 | 8 ++++---- tests/overlay/037 | 6 +++--- tests/overlay/040 | 2 +- tests/overlay/041 | 2 +- tests/overlay/042 | 2 +- tests/overlay/043 | 2 +- tests/overlay/044 | 2 +- tests/overlay/048 | 4 ++-- tests/overlay/049 | 2 +- tests/overlay/050 | 2 +- tests/overlay/051 | 4 ++-- tests/overlay/052 | 2 +- tests/overlay/053 | 4 ++-- tests/overlay/054 | 2 +- tests/overlay/055 | 4 ++-- tests/overlay/056 | 2 +- tests/overlay/057 | 4 ++-- tests/overlay/059 | 2 +- tests/overlay/060 | 2 +- tests/overlay/062 | 2 +- tests/overlay/063 | 2 +- tests/overlay/065 | 22 +++++++++++----------- tests/overlay/067 | 2 +- tests/overlay/068 | 4 ++-- tests/overlay/069 | 6 +++--- tests/overlay/070 | 6 +++--- tests/overlay/071 | 6 +++--- tests/overlay/076 | 2 +- tests/overlay/077 | 2 +- tests/overlay/078 | 2 +- tests/overlay/079 | 2 +- tests/overlay/080 | 2 +- tests/overlay/081 | 14 +++++++------- tests/overlay/083 | 2 +- tests/overlay/084 | 10 +++++----- tests/overlay/085 | 2 +- tests/overlay/086 | 8 ++++---- 73 files changed, 153 insertions(+), 153 deletions(-)tests/btrfs/020 +1
-1@@ -17,7 +17,7 @@ _cleanup() { cd / rm -f $tmp.* - $UMOUNT_PROG $loop_mnt + _unmount $loop_mnt _destroy_loop_device $loop_dev1 losetup -d $loop_dev2 >/dev/null 2>&1 _destroy_loop_device $loop_dev3tests/btrfs/029 +0
-0@@ -74,7 +74,7 @@ cp --reflink=always $orig_file $copy_file >> $seqres.full 2>&1 || echo "cp refli md5sum $orig_file | _filter_testdir_and_scratch md5sum $copy_file | _filter_testdir_and_scratch
Quoted 8 lines
tests/btrfs/029 cp --reflink=always $orig_file $copy_file >> $seqres.full 2>&1 || echo "cp refli · line 77
Quoted 2 lines
tests/btrfs/029 +1
-1-$UMOUNT_PROG $reflink_test_dir +_unmount $reflink_test_dirThis isn't equivalent to directly calling
UMOUNT_PROGsince the_unmounthelper always redirects stdout and stderr to $seqres.full. Meaning failures may often be ignored or not immediately obvious as before.This applies to many other places, just picking the first to comment.
_unmount was restored to its old behavior of emitting stdout/stderr in this past Sunday's push to for-next because the forced redirection broke several tests.
--D
Quoted 1,559 lines
Quoted 21 lines
tests/btrfs/029 +0
-0# success, all done status=0tests/btrfs/031 +1
-1@@ -99,7 +99,7 @@ mv $testdir2/file* $subvol2/ echo "Verify the file contents:" _checksum_files -$UMOUNT_PROG $cross_mount_test_dir +_unmount $cross_mount_test_dir # success, all done status=0tests/btrfs/060 +0
-0tests/btrfs/060 run_test() · line 79
Quoted 5 lines
tests/btrfs/060 +1
-1@@ -76,7 +76,7 @@ run_test() fi # in case the subvolume is still mounted - $UMOUNT_PROG $subvol_mnt >/dev/null 2>&1 + _unmount $subvol_mnt >/dev/null 2>&1And here there's no point of having the redirections, since the helper always redirects stdout/stderr to $seqres.full.
So it could be removed to make things more readable.This also applies to many other places, just picking the first to comment.
Thanks.
Quoted 1,523 lines
tests/btrfs/060 +0
-0_scratch_unmount # we called _require_scratch_nocheck instead of _require_scratch # do check after test for each profile configtests/btrfs/065 +1
-1@@ -84,7 +84,7 @@ run_test() fi # in case the subvolume is still mounted - $UMOUNT_PROG $subvol_mnt >/dev/null 2>&1 + _unmount $subvol_mnt >/dev/null 2>&1 _scratch_unmount # we called _require_scratch_nocheck instead of _require_scratch # do check after test for each profile configtests/btrfs/066 +1
-1@@ -76,7 +76,7 @@ run_test() fi # in case the subvolume is still mounted - $UMOUNT_PROG $subvol_mnt >/dev/null 2>&1 + _unmount $subvol_mnt >/dev/null 2>&1 _scratch_unmount # we called _require_scratch_nocheck instead of _require_scratch # do check after test for each profile configtests/btrfs/067 +1
-1@@ -77,7 +77,7 @@ run_test() fi # in case the subvolume is still mounted - $UMOUNT_PROG $subvol_mnt >/dev/null 2>&1 + _unmount $subvol_mnt >/dev/null 2>&1 _scratch_unmount # we called _require_scratch_nocheck instead of _require_scratch # do check after test for each profile configtests/btrfs/068 +1
-1@@ -77,7 +77,7 @@ run_test() fi # in case the subvolume is still mounted - $UMOUNT_PROG $subvol_mnt >/dev/null 2>&1 + _unmount $subvol_mnt >/dev/null 2>&1 _scratch_unmount # we called _require_scratch_nocheck instead of _require_scratch # do check after test for each profile configtests/btrfs/075 +1
-1@@ -15,7 +15,7 @@ _cleanup() { cd / rm -f $tmp.* - $UMOUNT_PROG $subvol_mnt >/dev/null 2>&1 + _unmount $subvol_mnt >/dev/null 2>&1 } . ./common/filtertests/btrfs/089 +1
-1@@ -35,7 +35,7 @@ mount --bind "$SCRATCH_MNT/testvol/testdir" "$SCRATCH_MNT/testvol/mnt" $BTRFS_UTIL_PROG subvolume delete "$SCRATCH_MNT/testvol" >>$seqres.full 2>&1 # Unmount the bind mount, which should still be alive. -$UMOUNT_PROG "$SCRATCH_MNT/testvol/mnt" +_unmount "$SCRATCH_MNT/testvol/mnt" echo "Silence is golden" status=0tests/btrfs/124 +1
-1@@ -132,7 +132,7 @@ if [ "$checkpoint1" != "$checkpoint3" ]; then echo "Inital sum does not match with data on dev2 written by balance" fi -$UMOUNT_PROG $dev2 +_unmount $dev2 _scratch_dev_pool_put _btrfs_rescan_devices _test_mounttests/btrfs/125 +1
-1@@ -144,7 +144,7 @@ if [ "$checkpoint1" != "$checkpoint3" ]; then echo "Inital sum does not match with data on dev2 written by balance" fi -$UMOUNT_PROG $dev2 +_unmount $dev2 _scratch_dev_pool_put _btrfs_rescan_devices _test_mounttests/btrfs/185 +2
-2@@ -15,7 +15,7 @@ mnt=$TEST_DIR/$seq.mnt # Override the default cleanup function. _cleanup() { - $UMOUNT_PROG $mnt > /dev/null 2>&1 + _unmount $mnt > /dev/null 2>&1 rm -rf $mnt > /dev/null 2>&1 cd / rm -f $tmp.*@@ -62,7 +62,7 @@ $BTRFS_UTIL_PROG device scan $device_1 >> $seqres.full 2>&1 _fail "if it fails here, then it means subvolume mount at boot may fail "\ "in some configs." -$UMOUNT_PROG $mnt > /dev/null 2>&1 +_unmount $mnt > /dev/null 2>&1 _scratch_dev_pool_put # success, all donetests/btrfs/197 +2
-2@@ -15,7 +15,7 @@ _begin_fstest auto quick volume # Override the default cleanup function. _cleanup() { - $UMOUNT_PROG $TEST_DIR/$seq.mnt >/dev/null 2>&1 + _unmount $TEST_DIR/$seq.mnt >/dev/null 2>&1 rm -rf $TEST_DIR/$seq.mnt cd / rm -f $tmp.*@@ -67,7 +67,7 @@ workout() grep -q "${SCRATCH_DEV_NAME[1]}" $tmp.output && _fail "found stale device" $BTRFS_UTIL_PROG device remove "${SCRATCH_DEV_NAME[1]}" "$TEST_DIR/$seq.mnt" - $UMOUNT_PROG $TEST_DIR/$seq.mnt + _unmount $TEST_DIR/$seq.mnt _scratch_unmount _spare_dev_put _scratch_dev_pool_puttests/btrfs/219 +6
-6@@ -21,8 +21,8 @@ _cleanup() rm -f $tmp.* # The variables are set before the test case can fail. - $UMOUNT_PROG ${loop_mnt1} &> /dev/null - $UMOUNT_PROG ${loop_mnt2} &> /dev/null + _unmount ${loop_mnt1} &> /dev/null + _unmount ${loop_mnt2} &> /dev/null rm -rf $loop_mnt1 rm -rf $loop_mnt2@@ -66,7 +66,7 @@ loop_dev2=`_create_loop_device $fs_img2` # Normal single device case, should pass just fine _mount $loop_dev1 $loop_mnt1 > /dev/null 2>&1 || \ _fail "Couldn't do initial mount" -$UMOUNT_PROG $loop_mnt1 +_unmount $loop_mnt1 _btrfs_forget_or_module_reload@@ -75,15 +75,15 @@ _btrfs_forget_or_module_reload # measure. _mount $loop_dev1 $loop_mnt1 > /dev/null 2>&1 || \ _fail "Failed to mount the second time" -$UMOUNT_PROG $loop_mnt1 +_unmount $loop_mnt1 _mount $loop_dev2 $loop_mnt2 > /dev/null 2>&1 || \ _fail "We couldn't mount the old generation" -$UMOUNT_PROG $loop_mnt2 +_unmount $loop_mnt2 _mount $loop_dev1 $loop_mnt1 > /dev/null 2>&1 || \ _fail "Failed to mount the second time" -$UMOUNT_PROG $loop_mnt1 +_unmount $loop_mnt1 # Now try mount them at the same time, if kernel does not support # temp-fsid feature then mount will fail.tests/btrfs/254 +1
-1@@ -96,7 +96,7 @@ test_add_device() $BTRFS_UTIL_PROG filesystem show -m $SCRATCH_MNT | \ _filter_btrfs_filesystem_show - $UMOUNT_PROG $seq_mnt + _unmount $seq_mnt _scratch_unmount cleanup_dmdev }tests/btrfs/311 +1
-1@@ -14,7 +14,7 @@ _begin_fstest auto quick subvol tempfsid _cleanup() { cd / - $UMOUNT_PROG $mnt1 > /dev/null 2>&1 + _unmount $mnt1 > /dev/null 2>&1 rm -r -f $tmp.* rm -r -f $mnt1 }tests/btrfs/313 +1
-1@@ -12,7 +12,7 @@ _begin_fstest auto quick clone tempfsid _cleanup() { cd / - $UMOUNT_PROG $mnt1 > /dev/null 2>&1 + _unmount $mnt1 > /dev/null 2>&1 rm -r -f $tmp.* rm -r -f $mnt1 }tests/btrfs/314 +1
-1@@ -13,7 +13,7 @@ _begin_fstest auto quick snapshot send tempfsid _cleanup() { cd / - $UMOUNT_PROG $tempfsid_mnt 2>/dev/null + _unmount $tempfsid_mnt 2>/dev/null rm -r -f $tmp.* rm -r -f $sendfile rm -r -f $tempfsid_mnttests/btrfs/315 +1
-1@@ -13,7 +13,7 @@ _begin_fstest auto quick volume seed balance tempfsid _cleanup() { cd / - $UMOUNT_PROG $tempfsid_mnt 2>/dev/null + _unmount $tempfsid_mnt 2>/dev/null rm -r -f $tmp.* rm -r -f $tempfsid_mnt }tests/btrfs/318 +3
-3@@ -22,8 +22,8 @@ _require_loop _cleanup() { cd / - $UMOUNT_PROG $MNT - $UMOUNT_PROG $BIND + _unmount $MNT + _unmount $BIND losetup -d $DEV0 $DEV1 $DEV2 rm -f $IMG0 $IMG1 $IMG2 rm -rf $MNT $BIND@@ -58,7 +58,7 @@ $MKFS_BTRFS_PROG -f -msingle -dsingle $D0P1 $DEV2 >>$seqres.full 2>&1 || _fail " rm -rf $MNT mkdir -p $MNT _mount $D0P1 $MNT -$UMOUNT_PROG $MNT +_unmount $MNT # Swap the partition dev_ts. This leaves the dev_t in the cache out of date. $PARTED_PROG $DEV0 'rm 1' --scripttests/btrfs/326 +5
-5@@ -25,8 +25,8 @@ _cleanup() [ -n "$mount_pid" ] && kill $mount_pid &> /dev/null [ -n "$remount_pid" ] && kill $remount_pid &> /dev/null wait - $UMOUNT_PROG "$subv1_mount" &> /dev/null - $UMOUNT_PROG "$subv2_mount" &> /dev/null + _unmount "$subv1_mount" &> /dev/null + _unmount "$subv2_mount" &> /dev/null rm -rf -- "$subv1_mount" "$subv2_mount" }@@ -80,7 +80,7 @@ mount_workload() trap "wait; exit" SIGTERM while true; do _mount "$SCRATCH_DEV" "$subv2_mount" - $UMOUNT_PROG "$subv2_mount" + _unmount "$subv2_mount" done }@@ -94,12 +94,12 @@ wait unset remount_pid mount_pid # Subv1 is always mounted, thus the umount should never fail. -$UMOUNT_PROG "$subv1_mount" +_unmount "$subv1_mount" # Subv2 may have already been unmounted, so here we ignore all output. # This may hide some errors like -EBUSY, but the next rm line would # detect any still mounted subvolume so we're still safe. -$UMOUNT_PROG "$subv2_mount" &> /dev/null +_unmount "$subv2_mount" &> /dev/null # If above unmount, especially subv2 is not properly unmounted, # the rm should fail with some error messagetests/btrfs/330 +2
-2@@ -48,7 +48,7 @@ echo "making sure bar allows writes" touch $TEST_DIR/$seq/bar/qux ls $TEST_DIR/$seq/bar -$UMOUNT_PROG $TEST_DIR/$seq/foo -$UMOUNT_PROG $TEST_DIR/$seq/bar +_unmount $TEST_DIR/$seq/foo +_unmount $TEST_DIR/$seq/bar status=0 ; exittests/ext4/032 +2
-2@@ -63,7 +63,7 @@ ext4_online_resize() fi cat $tmp.resize2fs >> $seqres.full echo "+++ umount fs" | tee -a $seqres.full - $UMOUNT_PROG ${IMG_MNT} + _unmount ${IMG_MNT} echo "+++ check fs" | tee -a $seqres.full _check_generic_filesystem $LOOP_DEVICE >> $seqres.full 2>&1 || \@@ -77,7 +77,7 @@ _cleanup() cd / [ -n "$LOOP_DEVICE" ] && _destroy_loop_device $LOOP_DEVICE > /dev/null 2>&1 rm -f $tmp.* - $UMOUNT_PROG ${IMG_MNT} > /dev/null 2>&1 + _unmount ${IMG_MNT} > /dev/null 2>&1 rm -f ${IMG_FILE} > /dev/null 2>&1 }tests/ext4/052 +2
-2@@ -18,7 +18,7 @@ _cleanup() cd / rm -r -f $tmp.* if [ ! -z "$loop_mnt" ]; then - $UMOUNT_PROG $loop_mnt + _unmount $loop_mnt rm -rf $loop_mnt fi [ ! -z "$fs_img" ] && rm -rf $fs_img@@ -64,7 +64,7 @@ then status=1 fi -$UMOUNT_PROG $loop_mnt || _fail "umount failed" +_unmount $loop_mnt || _fail "umount failed" loop_mnt= $E2FSCK_PROG -fn $fs_img >> $seqres.full 2>&1 || _fail "file system corrupted"tests/ext4/053 +16
-16@@ -20,7 +20,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 _cleanup() { cd / - $UMOUNT_PROG $SCRATCH_MNT > /dev/null 2>&1 + _unmount $SCRATCH_MNT > /dev/null 2>&1 if [ -n "$LOOP_LOGDEV" ];then _destroy_loop_device $LOOP_LOGDEV 2>/dev/null fi@@ -236,7 +236,7 @@ not_mnt() { if simple_mount -o $1 $SCRATCH_DEV $SCRATCH_MNT; then print_log "(mount unexpectedly succeeded)" fail - $UMOUNT_PROG $SCRATCH_MNT + _unmount $SCRATCH_MNT return fi ok@@ -247,7 +247,7 @@ not_mnt() { return fi not_remount $1 - $UMOUNT_PROG $SCRATCH_MNT + _unmount $SCRATCH_MNT } mnt_only() {@@ -269,7 +269,7 @@ mnt() { fi mnt_only $* - $UMOUNT_PROG $SCRATCH_MNT 2> /dev/null + _unmount $SCRATCH_MNT 2> /dev/null [ "$t2fs" -eq 0 ] && return@@ -288,7 +288,7 @@ mnt() { -e 's/data=writeback/journal_data_writeback/') $TUNE2FS_PROG -o $op_set $SCRATCH_DEV > /dev/null 2>&1 mnt_only "defaults" $check - $UMOUNT_PROG $SCRATCH_MNT 2> /dev/null + _unmount $SCRATCH_MNT 2> /dev/null if [ "$op_set" = ^* ]; then op_set=${op_set#^} else@@ -308,12 +308,12 @@ remount() { do_mnt remount,$2 $3 if [ $? -ne 0 ]; then fail - $UMOUNT_PROG $SCRATCH_MNT 2> /dev/null + _unmount $SCRATCH_MNT 2> /dev/null return else ok fi - $UMOUNT_PROG $SCRATCH_MNT 2> /dev/null + _unmount $SCRATCH_MNT 2> /dev/null # Now just specify mnt print_log "mounting $fstype \"$1\" "@@ -327,7 +327,7 @@ remount() { ok fi - $UMOUNT_PROG $SCRATCH_MNT 2> /dev/null + _unmount $SCRATCH_MNT 2> /dev/null } # Test that the filesystem cannot be remounted with option(s) $1 (meaning that@@ -363,7 +363,7 @@ mnt_then_not_remount() { return fi not_remount $2 - $UMOUNT_PROG $SCRATCH_MNT + _unmount $SCRATCH_MNT }@@ -399,8 +399,8 @@ LOGDEV_DEVNUM=`echo "${majmin%:*}*2^8 + ${majmin#*:}" | bc` fstype= for fstype in ext2 ext3 ext4; do - $UMOUNT_PROG $SCRATCH_MNT 2> /dev/null - $UMOUNT_PROG $SCRATCH_DEV 2> /dev/null + _unmount $SCRATCH_MNT 2> /dev/null + _unmount $SCRATCH_DEV 2> /dev/null do_mkfs $SCRATCH_DEV ${SIZE}k@@ -417,7 +417,7 @@ for fstype in ext2 ext3 ext4; do continue fi - $UMOUNT_PROG $SCRATCH_MNT 2> /dev/null + _unmount $SCRATCH_MNT 2> /dev/null not_mnt failme mnt@@ -551,7 +551,7 @@ for fstype in ext2 ext3 ext4; do # dax mount options simple_mount -o dax=always $SCRATCH_DEV $SCRATCH_MNT > /dev/null 2>&1 if [ $? -eq 0 ]; then - $UMOUNT_PROG $SCRATCH_MNT 2> /dev/null + _unmount $SCRATCH_MNT 2> /dev/null mnt dax mnt dax=always mnt dax=never@@ -632,7 +632,7 @@ for fstype in ext2 ext3 ext4; do not_remount jqfmt=vfsv1 not_remount noquota mnt_only remount,usrquota,grpquota ^usrquota,^grpquota - $UMOUNT_PROG $SCRATCH_MNT > /dev/null 2>&1 + _unmount $SCRATCH_MNT > /dev/null 2>&1 # test clearing/changing quota when enabled do_mkfs -E quotatype=^prjquota $SCRATCH_DEV ${SIZE}k@@ -653,7 +653,7 @@ for fstype in ext2 ext3 ext4; do mnt_only remount,usrquota,grpquota usrquota,grpquota quotaoff -f $SCRATCH_MNT >> $seqres.full 2>&1 mnt_only remount,noquota ^usrquota,^grpquota,quota - $UMOUNT_PROG $SCRATCH_MNT > /dev/null 2>&1 + _unmount $SCRATCH_MNT > /dev/null 2>&1 # Quota feature echo "== Testing quota feature " >> $seqres.full@@ -695,7 +695,7 @@ for fstype in ext2 ext3 ext4; do done #for fstype in ext2 ext3 ext4; do -$UMOUNT_PROG $SCRATCH_MNT > /dev/null 2>&1 +_unmount $SCRATCH_MNT > /dev/null 2>&1 echo "$ERR errors encountered" >> $seqres.full status=$ERRtests/ext4/056 +1
-1@@ -72,7 +72,7 @@ do_resize() # delay sleep 0.2 _scratch_unmount >> $seqres.full 2>&1 \ - || _fail "$UMOUNT_PROG failed. Exiting" + || _fail "_unmount failed. Exiting" } run_test()tests/overlay/003 +1
-1@@ -56,7 +56,7 @@ rm -rf ${SCRATCH_MNT}/* ls ${SCRATCH_MNT}/ # unmount overlayfs but not base fs -$UMOUNT_PROG $SCRATCH_MNT +_unmount $SCRATCH_MNT echo "Silence is golden" # success, all donetests/overlay/004 +1
-1@@ -53,7 +53,7 @@ _user_do "chmod u-X ${SCRATCH_MNT}/attr_file2 > /dev/null 2>&1" stat -c %a ${SCRATCH_MNT}/attr_file2 # unmount overlayfs but not base fs -$UMOUNT_PROG $SCRATCH_MNT +_unmount $SCRATCH_MNT # check mode bits of the file that has been copied up, and # the file that should not have been copied up.tests/overlay/005 +3
-3@@ -75,14 +75,14 @@ $XFS_IO_PROG -f -c "o" ${SCRATCH_MNT}/test_file \ >>$seqres.full 2>&1 # unmount overlayfs -$UMOUNT_PROG $SCRATCH_MNT +_unmount $SCRATCH_MNT # check overlayfs _overlay_check_scratch_dirs $lowerd $upperd $workd # unmount undelying xfs, this tiggers panic if memleak happens -$UMOUNT_PROG ${OVL_BASE_SCRATCH_MNT}/uppermnt -$UMOUNT_PROG ${OVL_BASE_SCRATCH_MNT}/lowermnt +_unmount ${OVL_BASE_SCRATCH_MNT}/uppermnt +_unmount ${OVL_BASE_SCRATCH_MNT}/lowermnt # success, all done echo "Silence is golden"tests/overlay/014 +2
-2@@ -46,7 +46,7 @@ _overlay_scratch_mount_dirs $lowerdir1 $lowerdir2 $workdir2 rm -rf $SCRATCH_MNT/testdir mkdir -p $SCRATCH_MNT/testdir/visibledir # unmount overlayfs but not base fs -$UMOUNT_PROG $SCRATCH_MNT +_unmount $SCRATCH_MNT # check overlayfs _overlay_check_scratch_dirs $lowerdir1 $lowerdir2 $workdir2@@ -59,7 +59,7 @@ touch $SCRATCH_MNT/testdir/visiblefile # umount and mount overlay again, buggy kernel treats the copied-up dir as # opaque, visibledir is not seen in merged dir. -$UMOUNT_PROG $SCRATCH_MNT +_unmount $SCRATCH_MNT _overlay_scratch_mount_dirs "$lowerdir2:$lowerdir1" $upperdir $workdir ls $SCRATCH_MNT/testdirtests/overlay/022 +1
-1@@ -17,7 +17,7 @@ _begin_fstest auto quick mount nested _cleanup() { cd / - $UMOUNT_PROG $tmp/mnt > /dev/null 2>&1 + _unmount $tmp/mnt > /dev/null 2>&1 rm -rf $tmp rm -f $tmp.* }tests/overlay/025 +2
-2@@ -19,8 +19,8 @@ _begin_fstest auto quick attr _cleanup() { cd / - $UMOUNT_PROG $tmpfsdir/mnt - $UMOUNT_PROG $tmpfsdir + _unmount $tmpfsdir/mnt + _unmount $tmpfsdir rm -rf $tmpfsdir rm -f $tmp.* }tests/overlay/029 +3
-3@@ -22,7 +22,7 @@ _begin_fstest auto quick nested _cleanup() { cd / - $UMOUNT_PROG $tmp/mnt + _unmount $tmp/mnt rm -rf $tmp rm -f $tmp.* }@@ -56,7 +56,7 @@ _overlay_mount_dirs $SCRATCH_MNT/up $tmp/{upper,work} \ overlay $tmp/mnt # accessing file in the second mount cat $tmp/mnt/foo -$UMOUNT_PROG $tmp/mnt +_unmount $tmp/mnt # re-create upper/work to avoid ovl_verify_origin() mount failure # when index is enabled@@ -66,7 +66,7 @@ mkdir -p $tmp/{upper,work} _overlay_mount_dirs $SCRATCH_MNT/low $tmp/{upper,work} \ overlay $tmp/mnt cat $tmp/mnt/bar -$UMOUNT_PROG $tmp/mnt +_unmount $tmp/mnt rm -rf $tmp/{upper,work} mkdir -p $tmp/{upper,work}tests/overlay/031 +4
-4@@ -28,7 +28,7 @@ create_whiteout() rm -f $SCRATCH_MNT/testdir/$file - $UMOUNT_PROG $SCRATCH_MNT + _unmount $SCRATCH_MNT } # Import common functions.@@ -68,7 +68,7 @@ rm -rf $SCRATCH_MNT/testdir 2>&1 | _filter_scratch # umount overlay again, create a new file with the same name and # mount overlay again. -$UMOUNT_PROG $SCRATCH_MNT +_unmount $SCRATCH_MNT touch $lowerdir1/testdir _overlay_scratch_mount_dirs $lowerdir1 $upperdir $workdir@@ -77,7 +77,7 @@ _overlay_scratch_mount_dirs $lowerdir1 $upperdir $workdir # it will not clean up the dir and lead to residue. rm -rf $SCRATCH_MNT/testdir 2>&1 | _filter_scratch -$UMOUNT_PROG $SCRATCH_MNT +_unmount $SCRATCH_MNT # let lower dir have invalid whiteouts, repeat ls and rmdir test again. rm -rf $lowerdir1/testdir@@ -92,7 +92,7 @@ _overlay_scratch_mount_dirs "$lowerdir1:$lowerdir2" $upperdir $workdir ls $SCRATCH_MNT/testdir rm -rf $SCRATCH_MNT/testdir 2>&1 | _filter_scratch -$UMOUNT_PROG $SCRATCH_MNT +_unmount $SCRATCH_MNT # let lower dir and upper dir both have invalid whiteouts, repeat ls and rmdir again. rm -rf $lowerdir1/testdirtests/overlay/035 +1
-1@@ -43,7 +43,7 @@ mkdir -p $lowerdir1 $lowerdir2 $upperdir $workdir _overlay_scratch_mount_opts -o"lowerdir=$lowerdir2:$lowerdir1" touch $SCRATCH_MNT/foo 2>&1 | _filter_scratch $MOUNT_PROG -o remount,rw $SCRATCH_MNT 2>&1 | _filter_ro_mount -$UMOUNT_PROG $SCRATCH_MNT +_unmount $SCRATCH_MNT # Make workdir immutable to prevent workdir re-create on mount $CHATTR_PROG +i $workdirtests/overlay/036 +4
-4@@ -34,8 +34,8 @@ _cleanup() cd / rm -f $tmp.* # unmount the two extra mounts in case they did not fail - $UMOUNT_PROG $SCRATCH_MNT 2>/dev/null - $UMOUNT_PROG $SCRATCH_MNT 2>/dev/null + _unmount $SCRATCH_MNT 2>/dev/null + _unmount $SCRATCH_MNT 2>/dev/null } # Import common functions.@@ -66,13 +66,13 @@ _overlay_mount_dirs $lowerdir $upperdir $workdir \ # with index=off - expect success _overlay_mount_dirs $lowerdir $upperdir $workdir2 \ overlay0 $SCRATCH_MNT -oindex=off && \ - $UMOUNT_PROG $SCRATCH_MNT + _unmount $SCRATCH_MNT # Try to mount another overlay with the same workdir # with index=off - expect success _overlay_mount_dirs $lowerdir2 $upperdir2 $workdir \ overlay1 $SCRATCH_MNT -oindex=off && \ - $UMOUNT_PROG $SCRATCH_MNT + _unmount $SCRATCH_MNT # Try to mount another overlay with the same upperdir # with index=on - expect EBUSYtests/overlay/037 +3
-3@@ -39,17 +39,17 @@ mkdir -p $lowerdir $lowerdir2 $upperdir $upperdir2 $workdir # Mount overlay with lowerdir, upperdir, workdir and index=on # to store the file handles of lowerdir and upperdir in overlay.origin xattr _overlay_scratch_mount_dirs $lowerdir $upperdir $workdir -oindex=on -$UMOUNT_PROG $SCRATCH_MNT +_unmount $SCRATCH_MNT # Try to mount an overlay with the same upperdir and different lowerdir - expect ESTALE _overlay_scratch_mount_dirs $lowerdir2 $upperdir $workdir -oindex=on \ 2>&1 | _filter_error_mount -$UMOUNT_PROG $SCRATCH_MNT 2>/dev/null +_unmount $SCRATCH_MNT 2>/dev/null # Try to mount an overlay with the same workdir and different upperdir - expect ESTALE _overlay_scratch_mount_dirs $lowerdir $upperdir2 $workdir -oindex=on \ 2>&1 | _filter_error_mount -$UMOUNT_PROG $SCRATCH_MNT 2>/dev/null +_unmount $SCRATCH_MNT 2>/dev/null # Mount overlay with original lowerdir, upperdir, workdir and index=on - expect success _overlay_scratch_mount_dirs $lowerdir $upperdir $workdir -oindex=ontests/overlay/040 +1
-1@@ -48,7 +48,7 @@ _scratch_mount # modify lower origin file. $CHATTR_PROG +i $SCRATCH_MNT/foo > /dev/null 2>&1 -$UMOUNT_PROG $SCRATCH_MNT +_unmount $SCRATCH_MNT # touching origin file in lower, should succeed touch $lowerdir/footests/overlay/041 +1
-1@@ -142,7 +142,7 @@ subdir_d=$($here/src/t_dir_type $pure_lower_dir $pure_lower_subdir_st_ino) [[ $subdir_d == "subdir d" ]] || \ echo "Merged dir: Invalid d_ino reported for subdir" -$UMOUNT_PROG $SCRATCH_MNT +_unmount $SCRATCH_MNT # check overlayfs _overlay_check_scratch_dirs $lowerdir $upperdir $workdir -o xino=ontests/overlay/042 +1
-1@@ -45,7 +45,7 @@ _scratch_mount -o index=off # Copy up lower and create upper hardlink with no index ln $SCRATCH_MNT/0 $SCRATCH_MNT/1 -$UMOUNT_PROG $SCRATCH_MNT +_unmount $SCRATCH_MNT # Add lower hardlinks while overlay is offline ln $lowerdir/0 $lowerdir/2tests/overlay/043 +1
-1@@ -126,7 +126,7 @@ echo 3 > /proc/sys/vm/drop_caches check_inode_numbers $testdir $tmp.after_copyup $tmp.after_move # Verify that the inode numbers survive a mount cycle -$UMOUNT_PROG $SCRATCH_MNT +_unmount $SCRATCH_MNT _overlay_scratch_mount_dirs $lowerdir $upperdir $workdir -o redirect_dir=on,xino=on # Compare inode numbers before/after mount cycletests/overlay/044 +1
-1@@ -99,7 +99,7 @@ cat $FILES check_ino_nlink $SCRATCH_MNT $tmp.before $tmp.after_one # Verify that the hardlinks survive a mount cycle -$UMOUNT_PROG $SCRATCH_MNT +_unmount $SCRATCH_MNT _overlay_check_scratch_dirs $lowerdir $upperdir $workdir -o index=on,xino=on _overlay_scratch_mount_dirs $lowerdir $upperdir $workdir -o index=on,xino=ontests/overlay/048 +2
-2@@ -32,7 +32,7 @@ report_nlink() _ls_l $SCRATCH_MNT/$f | awk '{ print $2, $9 }' | _filter_scratch done - $UMOUNT_PROG $SCRATCH_MNT + _unmount $SCRATCH_MNT } # Create lower hardlinks@@ -101,7 +101,7 @@ touch $SCRATCH_MNT/1 touch $SCRATCH_MNT/2 # Perform the rest of the changes offline -$UMOUNT_PROG $SCRATCH_MNT +_unmount $SCRATCH_MNT test_hardlinks_offlinetests/overlay/049 +1
-1@@ -32,7 +32,7 @@ create_redirect() touch $SCRATCH_MNT/origin/file mv $SCRATCH_MNT/origin $SCRATCH_MNT/$redirect - $UMOUNT_PROG $SCRATCH_MNT + _unmount $SCRATCH_MNT } # Import common functions.tests/overlay/050 +1
-1@@ -76,7 +76,7 @@ mount_dirs() # Unmount the overlay without unmounting base fs unmount_dirs() { - $UMOUNT_PROG $SCRATCH_MNT + _unmount $SCRATCH_MNT } # Check non-stale file handles of lower/upper files and verifytests/overlay/051 +2
-2@@ -28,7 +28,7 @@ _cleanup() # Cleanup overlay scratch mount that is holding base test mount # to prevent _check_test_fs and _test_umount from failing before # _check_scratch_fs _scratch_umount - $UMOUNT_PROG $SCRATCH_MNT 2>/dev/null + _unmount $SCRATCH_MNT 2>/dev/null } # Import common functions.@@ -103,7 +103,7 @@ mount_dirs() # underlying dirs unmount_dirs() { - $UMOUNT_PROG $SCRATCH_MNT + _unmount $SCRATCH_MNT _overlay_check_scratch_dirs $middle:$lower $upper $work \ -o "index=on,nfs_export=on"tests/overlay/052 +1
-1@@ -73,7 +73,7 @@ mount_dirs() # Unmount the overlay without unmounting base fs unmount_dirs() { - $UMOUNT_PROG $SCRATCH_MNT + _unmount $SCRATCH_MNT } # Check non-stale file handles of lower/upper moved filestests/overlay/053 +2
-2@@ -30,7 +30,7 @@ _cleanup() # Cleanup overlay scratch mount that is holding base test mount # to prevent _check_test_fs and _test_umount from failing before # _check_scratch_fs _scratch_umount - $UMOUNT_PROG $SCRATCH_MNT 2>/dev/null + _unmount $SCRATCH_MNT 2>/dev/null } # Import common functions.@@ -99,7 +99,7 @@ mount_dirs() # underlying dirs unmount_dirs() { - $UMOUNT_PROG $SCRATCH_MNT + _unmount $SCRATCH_MNT _overlay_check_scratch_dirs $middle:$lower $upper $work \ -o "index=on,nfs_export=on,redirect_dir=on"tests/overlay/054 +1
-1@@ -87,7 +87,7 @@ mount_dirs() # Unmount the overlay without unmounting base fs unmount_dirs() { - $UMOUNT_PROG $SCRATCH_MNT + _unmount $SCRATCH_MNT } # Check encode/decode/read file handles of dir with non-indexed ancestortests/overlay/055 +2
-2@@ -37,7 +37,7 @@ _cleanup() # Cleanup overlay scratch mount that is holding base test mount # to prevent _check_test_fs and _test_umount from failing before # _check_scratch_fs _scratch_umount - $UMOUNT_PROG $SCRATCH_MNT 2>/dev/null + _unmount $SCRATCH_MNT 2>/dev/null } # Import common functions.@@ -109,7 +109,7 @@ mount_dirs() # underlying dirs unmount_dirs() { - $UMOUNT_PROG $SCRATCH_MNT + _unmount $SCRATCH_MNT _overlay_check_scratch_dirs $middle:$lower $upper $work \ -o "index=on,nfs_export=on,redirect_dir=on"tests/overlay/056 +1
-1@@ -73,7 +73,7 @@ mkdir $lowerdir/testdir2/subdir _overlay_scratch_mount_dirs $lowerdir $upperdir $workdir touch $SCRATCH_MNT/testdir1/foo touch $SCRATCH_MNT/testdir2/subdir -$UMOUNT_PROG $SCRATCH_MNT +_unmount $SCRATCH_MNT remove_impure $upperdir/testdir1 remove_impure $upperdir/testdir2tests/overlay/057 +2
-2@@ -48,7 +48,7 @@ _overlay_scratch_mount_dirs $lowerdir $lowerdir2 $workdir2 -o redirect_dir=on # Create opaque parent with absolute redirect child in middle layer mkdir $SCRATCH_MNT/pure mv $SCRATCH_MNT/origin $SCRATCH_MNT/pure/redirect -$UMOUNT_PROG $SCRATCH_MNT +_unmount $SCRATCH_MNT _overlay_scratch_mount_dirs $lowerdir2:$lowerdir $upperdir $workdir -o redirect_dir=on mv $SCRATCH_MNT/pure/redirect $SCRATCH_MNT/redirect # List content of renamed merge dir before mount cycle@@ -56,7 +56,7 @@ ls $SCRATCH_MNT/redirect/ # Verify that redirects are followed by listing content of renamed merge dir # after mount cycle -$UMOUNT_PROG $SCRATCH_MNT +_unmount $SCRATCH_MNT _overlay_scratch_mount_dirs $lowerdir2:$lowerdir $upperdir $workdir -o redirect_dir=on ls $SCRATCH_MNT/redirect/tests/overlay/059 +1
-1@@ -33,7 +33,7 @@ create_origin_ref() _scratch_mount -o redirect_dir=on mv $SCRATCH_MNT/origin $SCRATCH_MNT/$ref - $UMOUNT_PROG $SCRATCH_MNT + _unmount $SCRATCH_MNT } # Import common functions.tests/overlay/060 +1
-1@@ -130,7 +130,7 @@ mount_ro_overlay() umount_overlay() { - $UMOUNT_PROG $SCRATCH_MNT + _unmount $SCRATCH_MNT } # Assumes it is called with overlay mounted.tests/overlay/062 +1
-1@@ -18,7 +18,7 @@ _cleanup() { cd / rm -f $tmp.* - $UMOUNT_PROG $lowertestdir + _unmount $lowertestdir } # Import common functions.tests/overlay/063 +1
-1@@ -40,7 +40,7 @@ rm ${upperdir}/file mkdir ${SCRATCH_MNT}/file > /dev/null 2>&1 # unmount overlayfs -$UMOUNT_PROG $SCRATCH_MNT +_unmount $SCRATCH_MNT echo "Silence is golden" # success, all donetests/overlay/065 +11
-11@@ -30,7 +30,7 @@ _cleanup() { cd / rm -f $tmp.* - $UMOUNT_PROG $mnt2 2>/dev/null + _unmount $mnt2 2>/dev/null } # Import common functions.@@ -63,7 +63,7 @@ mkdir -p $lowerdir/lower $upperdir $workdir echo Conflicting upperdir/lowerdir _overlay_scratch_mount_dirs $upperdir $upperdir $workdir \ 2>&1 | _filter_error_mount -$UMOUNT_PROG $SCRATCH_MNT 2>/dev/null +_unmount $SCRATCH_MNT 2>/dev/null # Use new upper/work dirs for each test to avoid ESTALE errors # on mismatch lowerdir/upperdir (see test overlay/037)@@ -75,7 +75,7 @@ mkdir $upperdir $workdir echo Conflicting workdir/lowerdir _overlay_scratch_mount_dirs $workdir $upperdir $workdir \ -oindex=off 2>&1 | _filter_error_mount -$UMOUNT_PROG $SCRATCH_MNT 2>/dev/null +_unmount $SCRATCH_MNT 2>/dev/null rm -rf $upperdir $workdir mkdir -p $upperdir/lower $workdir@@ -85,7 +85,7 @@ mkdir -p $upperdir/lower $workdir echo Overlapping upperdir/lowerdir _overlay_scratch_mount_dirs $upperdir/lower $upperdir $workdir \ 2>&1 | _filter_error_mount -$UMOUNT_PROG $SCRATCH_MNT 2>/dev/null +_unmount $SCRATCH_MNT 2>/dev/null rm -rf $upperdir $workdir mkdir $upperdir $workdir@@ -94,7 +94,7 @@ mkdir $upperdir $workdir echo Conflicting lower layers _overlay_scratch_mount_dirs $lowerdir:$lowerdir $upperdir $workdir \ 2>&1 | _filter_error_mount -$UMOUNT_PROG $SCRATCH_MNT 2>/dev/null +_unmount $SCRATCH_MNT 2>/dev/null rm -rf $upperdir $workdir mkdir $upperdir $workdir@@ -103,7 +103,7 @@ mkdir $upperdir $workdir echo Overlapping lower layers below _overlay_scratch_mount_dirs $lowerdir:$lowerdir/lower $upperdir $workdir \ 2>&1 | _filter_error_mount -$UMOUNT_PROG $SCRATCH_MNT 2>/dev/null +_unmount $SCRATCH_MNT 2>/dev/null rm -rf $upperdir $workdir mkdir $upperdir $workdir@@ -112,7 +112,7 @@ mkdir $upperdir $workdir echo Overlapping lower layers above _overlay_scratch_mount_dirs $lowerdir/lower:$lowerdir $upperdir $workdir \ 2>&1 | _filter_error_mount -$UMOUNT_PROG $SCRATCH_MNT 2>/dev/null +_unmount $SCRATCH_MNT 2>/dev/null rm -rf $upperdir $workdir mkdir -p $upperdir/upper $workdir $mnt2@@ -129,14 +129,14 @@ mkdir -p $upperdir2 $workdir2 $mnt2 echo "Overlapping with upperdir of another instance (index=on)" _overlay_scratch_mount_dirs $upperdir/upper $upperdir2 $workdir2 \ -oindex=on 2>&1 | _filter_busy_mount -$UMOUNT_PROG $SCRATCH_MNT 2>/dev/null +_unmount $SCRATCH_MNT 2>/dev/null rm -rf $upperdir2 $workdir2 mkdir -p $upperdir2 $workdir2 echo "Overlapping with upperdir of another instance (index=off)" _overlay_scratch_mount_dirs $upperdir/upper $upperdir2 $workdir2 \ - -oindex=off && $UMOUNT_PROG $SCRATCH_MNT + -oindex=off && _unmount $SCRATCH_MNT rm -rf $upperdir2 $workdir2 mkdir -p $upperdir2 $workdir2@@ -146,14 +146,14 @@ mkdir -p $upperdir2 $workdir2 echo "Overlapping with workdir of another instance (index=on)" _overlay_scratch_mount_dirs $workdir/work $upperdir2 $workdir2 \ -oindex=on 2>&1 | _filter_busy_mount -$UMOUNT_PROG $SCRATCH_MNT 2>/dev/null +_unmount $SCRATCH_MNT 2>/dev/null rm -rf $upperdir2 $workdir2 mkdir -p $upperdir2 $workdir2 echo "Overlapping with workdir of another instance (index=off)" _overlay_scratch_mount_dirs $workdir/work $upperdir2 $workdir2 \ - -oindex=off && $UMOUNT_PROG $SCRATCH_MNT + -oindex=off && _unmount $SCRATCH_MNT # Move upper layer root into lower layer after mount echo Overlapping upperdir/lowerdir after mounttests/overlay/067 +1
-1@@ -70,7 +70,7 @@ stat $testfile >>$seqres.full diff -q $realfile $testfile >>$seqres.full && echo "diff with middle layer file doesn't know right from wrong! (cold cache)" -$UMOUNT_PROG $SCRATCH_MNT +_unmount $SCRATCH_MNT # check overlayfs _overlay_check_scratch_dirs $middle:$lower $upper $work -o xino=offtests/overlay/068 +2
-2@@ -28,7 +28,7 @@ _cleanup() cd / rm -f $tmp.* # Unmount the nested overlay mount - $UMOUNT_PROG $mnt2 2>/dev/null + _unmount $mnt2 2>/dev/null } # Import common functions.@@ -100,7 +100,7 @@ mount_dirs() unmount_dirs() { # unmount & check nested overlay - $UMOUNT_PROG $mnt2 + _unmount $mnt2 _overlay_check_dirs $SCRATCH_MNT $upper2 $work2 \ -o "index=on,nfs_export=on,redirect_dir=on"tests/overlay/069 +3
-3@@ -28,7 +28,7 @@ _cleanup() cd / rm -f $tmp.* # Unmount the nested overlay mount - $UMOUNT_PROG $mnt2 2>/dev/null + _unmount $mnt2 2>/dev/null } # Import common functions.@@ -108,12 +108,12 @@ mount_dirs() unmount_dirs() { # unmount & check nested overlay - $UMOUNT_PROG $mnt2 + _unmount $mnt2 _overlay_check_dirs $SCRATCH_MNT $upper2 $work2 \ -o "index=on,nfs_export=on,redirect_dir=on" # unmount & check underlying overlay - $UMOUNT_PROG $SCRATCH_MNT + _unmount $SCRATCH_MNT _overlay_check_dirs $lower $upper $work \ -o "index=on,nfs_export=on,redirect_dir=on" }tests/overlay/070 +3
-3@@ -26,7 +26,7 @@ _cleanup() cd / rm -f $tmp.* # Unmount the nested overlay mount - $UMOUNT_PROG $mnt2 2>/dev/null + _unmount $mnt2 2>/dev/null [ -z "$loopdev" ] || _destroy_loop_device $loopdev }@@ -93,12 +93,12 @@ mount_dirs() unmount_dirs() { # unmount & check nested overlay - $UMOUNT_PROG $mnt2 + _unmount $mnt2 _overlay_check_dirs $SCRATCH_MNT $upper2 $work2 \ -o "redirect_dir=on,index=on,xino=on" # unmount & check underlying overlay - $UMOUNT_PROG $SCRATCH_MNT + _unmount $SCRATCH_MNT _overlay_check_scratch_dirs $lower $upper $work \ -o "index=on,nfs_export=on" }tests/overlay/071 +3
-3@@ -29,7 +29,7 @@ _cleanup() cd / rm -f $tmp.* # Unmount the nested overlay mount - $UMOUNT_PROG $mnt2 2>/dev/null + _unmount $mnt2 2>/dev/null [ -z "$loopdev" ] || _destroy_loop_device $loopdev }@@ -103,12 +103,12 @@ mount_dirs() unmount_dirs() { # unmount & check nested overlay - $UMOUNT_PROG $mnt2 + _unmount $mnt2 _overlay_check_dirs $SCRATCH_MNT $upper2 $work2 \ -o "redirect_dir=on,index=on,xino=on" # unmount & check underlying overlay - $UMOUNT_PROG $SCRATCH_MNT + _unmount $SCRATCH_MNT _overlay_check_dirs $lower $upper $work \ -o "index=on,nfs_export=on" }tests/overlay/076 +1
-1@@ -47,7 +47,7 @@ _scratch_mount # on kernel v5.10..v5.10.14. Anything but hang is considered a test success. $CHATTR_PROG +i $SCRATCH_MNT/foo > /dev/null 2>&1 -$UMOUNT_PROG $SCRATCH_MNT +_unmount $SCRATCH_MNT # success, all done echo "Silence is golden"tests/overlay/077 +1
-1@@ -65,7 +65,7 @@ mv $SCRATCH_MNT/f100 $SCRATCH_MNT/former/ # Remove the lower directory and mount overlay again to create # a "former merge dir" -$UMOUNT_PROG $SCRATCH_MNT +_unmount $SCRATCH_MNT rm -rf $lowerdir/former _scratch_mounttests/overlay/078 +1
-1@@ -61,7 +61,7 @@ do_check() echo "Test chattr +$1 $2" >> $seqres.full - $UMOUNT_PROG $SCRATCH_MNT + _unmount $SCRATCH_MNT # Add attribute to lower file $CHATTR_PROG +$attr $lowertestfiletests/overlay/079 +1
-1@@ -156,7 +156,7 @@ mount_ro_overlay() umount_overlay() { - $UMOUNT_PROG $SCRATCH_MNT + _unmount $SCRATCH_MNT } test_no_access()tests/overlay/080 +1
-1@@ -264,7 +264,7 @@ mount_overlay() umount_overlay() { - $UMOUNT_PROG $SCRATCH_MNT + _unmount $SCRATCH_MNT }tests/overlay/081 +7
-7@@ -46,7 +46,7 @@ ovl_fsid=$(stat -f -c '%i' $test_dir) echo "Overlayfs (uuid=null) and upper fs fsid differ" # Keep base fs mounted in case it has a volatile fsid (e.g. tmpfs) -$UMOUNT_PROG $SCRATCH_MNT +_unmount $SCRATCH_MNT # Test legacy behavior is preserved by default for existing "impure" overlayfs _scratch_mount@@ -55,7 +55,7 @@ ovl_fsid=$(stat -f -c '%i' $test_dir) [[ "$ovl_fsid" == "$upper_fsid" ]] || \ echo "Overlayfs (after uuid=null) and upper fs fsid differ" -$UMOUNT_PROG $SCRATCH_MNT +_unmount $SCRATCH_MNT # Test unique fsid on explicit opt-in for existing "impure" overlayfs _scratch_mount -o uuid=on@@ -65,7 +65,7 @@ ovl_unique_fsid=$ovl_fsid [[ "$ovl_fsid" != "$upper_fsid" ]] || \ echo "Overlayfs (uuid=on) and upper fs fsid are the same" -$UMOUNT_PROG $SCRATCH_MNT +_unmount $SCRATCH_MNT # Test unique fsid is persistent by default after it was created _scratch_mount@@ -74,7 +74,7 @@ ovl_fsid=$(stat -f -c '%i' $test_dir) [[ "$ovl_fsid" == "$ovl_unique_fsid" ]] || \ echo "Overlayfs (after uuid=on) unique fsid is not persistent" -$UMOUNT_PROG $SCRATCH_MNT +_unmount $SCRATCH_MNT # Test ignore existing persistent fsid on explicit opt-out _scratch_mount -o uuid=null@@ -83,7 +83,7 @@ ovl_fsid=$(stat -f -c '%i' $test_dir) [[ "$ovl_fsid" == "$upper_fsid" ]] || \ echo "Overlayfs (uuid=null) and upper fs fsid differ" -$UMOUNT_PROG $SCRATCH_MNT +_unmount $SCRATCH_MNT # Test fallback to uuid=null with non-upper ovelray _overlay_scratch_mount_dirs "$upperdir:$lowerdir" "-" "-" -o ro,uuid=on@@ -110,7 +110,7 @@ ovl_unique_fsid=$ovl_fsid [[ "$ovl_fsid" != "$upper_fsid" ]] || \ echo "Overlayfs (new) and upper fs fsid are the same" -$UMOUNT_PROG $SCRATCH_MNT +_unmount $SCRATCH_MNT # Test unique fsid is persistent by default after it was created _scratch_mount -o uuid=on@@ -119,7 +119,7 @@ ovl_fsid=$(stat -f -c '%i' $test_dir) [[ "$ovl_fsid" == "$ovl_unique_fsid" ]] || \ echo "Overlayfs (uuid=on) unique fsid is not persistent" -$UMOUNT_PROG $SCRATCH_MNT +_unmount $SCRATCH_MNT echo "Silence is golden" status=0tests/overlay/083 +1
-1@@ -52,7 +52,7 @@ $MOUNT_PROG -t overlay | grep ovl_esc_test | tee -a $seqres.full | grep -v spac # Re-create the upper/work dirs to mount them with a different lower # This is required in case index feature is enabled -$UMOUNT_PROG $SCRATCH_MNT +_unmount $SCRATCH_MNT rm -rf "$upperdir" "$workdir" mkdir -p "$upperdir" "$workdir"tests/overlay/084 +5
-5@@ -15,7 +15,7 @@ _cleanup() { cd / # Unmount nested mounts if things fail - $UMOUNT_PROG $OVL_BASE_SCRATCH_MNT/nested 2>/dev/null + _unmount $OVL_BASE_SCRATCH_MNT/nested 2>/dev/null rm -rf $tmp }@@ -44,7 +44,7 @@ nesteddir=$OVL_BASE_SCRATCH_MNT/nested umount_overlay() { - $UMOUNT_PROG $SCRATCH_MNT + _unmount $SCRATCH_MNT } test_escape()@@ -88,12 +88,12 @@ test_escape() echo "nested xattr mount with trusted.overlay" _overlay_mount_dirs $SCRATCH_MNT/layer2:$SCRATCH_MNT/layer1 - - overlayfs $nesteddir stat $nesteddir/dir/file 2>&1 | _filter_scratch - $UMOUNT_PROG $nesteddir + _unmount $nesteddir echo "nested xattr mount with user.overlay" _overlay_mount_dirs $SCRATCH_MNT/layer2:$SCRATCH_MNT/layer1 - - -o userxattr overlayfs $nesteddir stat $nesteddir/dir/file 2>&1 | _filter_scratch - $UMOUNT_PROG $nesteddir + _unmount $nesteddir # Also ensure propagate the escaped xattr when we copy-up layer2/dir echo "copy-up of escaped xattrs"@@ -164,7 +164,7 @@ test_escaped_xwhiteout() do_test_xwhiteout $prefix $nesteddir - $UMOUNT_PROG $nesteddir + _unmount $nesteddir } test_escaped_xwhiteout trustedtests/overlay/085 +1
-1@@ -157,7 +157,7 @@ mount_ro_overlay() umount_overlay() { - $UMOUNT_PROG $SCRATCH_MNT + _unmount $SCRATCH_MNT } test_no_access()tests/overlay/086 +4
-4@@ -38,21 +38,21 @@ $MOUNT_PROG -t overlay none $SCRATCH_MNT \ 2>> $seqres.full && \ echo "ERROR: invalid combination of lowerdir and lowerdir+ mount options" -$UMOUNT_PROG $SCRATCH_MNT 2>/dev/null +_unmount $SCRATCH_MNT 2>/dev/null $MOUNT_PROG -t overlay none $SCRATCH_MNT \ -o"lowerdir=$lowerdir,datadir+=$lowerdir_colons" \ -o redirect_dir=follow,metacopy=on 2>> $seqres.full && \ echo "ERROR: invalid combination of lowerdir and datadir+ mount options" -$UMOUNT_PROG $SCRATCH_MNT 2>/dev/null +_unmount $SCRATCH_MNT 2>/dev/null $MOUNT_PROG -t overlay none $SCRATCH_MNT \ -o"datadir+=$lowerdir,lowerdir+=$lowerdir_colons" \ -o redirect_dir=follow,metacopy=on 2>> $seqres.full && \ echo "ERROR: invalid order of lowerdir+ and datadir+ mount options" -$UMOUNT_PROG $SCRATCH_MNT 2>/dev/null +_unmount $SCRATCH_MNT 2>/dev/null # mount is expected to fail with escaped colons. $MOUNT_PROG -t overlay none $SCRATCH_MNT \@@ -60,7 +60,7 @@ $MOUNT_PROG -t overlay none $SCRATCH_MNT \ 2>> $seqres.full && \ echo "ERROR: incorrect parsing of escaped colons in lowerdir+ mount option" -$UMOUNT_PROG $SCRATCH_MNT 2>/dev/null +_unmount $SCRATCH_MNT 2>/dev/null # mount is expected to succeed without escaped colons. $MOUNT_PROG -t overlay ovl_esc_test $SCRATCH_MNT \
Re: [PATCH] fstests: finish UMOUNT_PROG to _unmount conversion
In reply to Filipe MananaQuoted 9 lines · Filipe Manana
Quoted 8 lines · Dave Chinner
tests/btrfs/029 +0
-0@@ -74,7 +74,7 @@ cp --reflink=always $orig_file $copy_file >> $seqres.full 2>&1 || echo "cp refli md5sum $orig_file | _filter_testdir_and_scratch md5sum $copy_file | _filter_testdir_and_scratch
Quoted 5 lines
tests/btrfs/029 cp --reflink=always $orig_file $copy_file >> $seqres.full 2>&1 || echo "cp refli · line 77
Quoted 2 lines
tests/btrfs/029 +1
-1-$UMOUNT_PROG $reflink_test_dir +_unmount $reflink_test_dirThis isn't equivalent to directly calling
UMOUNT_PROGsince the_unmounthelper always redirects stdout and stderr to $seqres.full.
Please update your tree to the latest for-next. _unmount does, indeed, return stdout/stderr to the caller, and so as the commit message says, it is a drop-in replacement for UMOUNT_PROG.
I wouldn't have sent the patch in this form if that hadn't been fixed.
-Dave.
Signature · 2 lines
Dave Chinner [email protected]
PATCH 2/2 btrfs/254: fix test failure in case scratch devices are larger than 50G
In reply to [email protected]From: Filipe Manana <[email protected]>
If the devices in the scratch pool have a size larger than 50G, then the test fails due to chunk allocation failure when attempting to create a multidevice filesystem on $lvdev and $scratch_dev2. This happens because the $lvdev device has a size of 1G and metadata chunks have a size of 1G for filesystems with a size greater than 50G, so mkfs fails when it attempts to allocate chunks since it needs to allocate a 1G metadata chunk plus a system chunk and a data chunk.
$ ./check btrfs/254 FSTYP -- btrfs PLATFORM -- Linux/x86_64 debian0 6.14.0-rc3-btrfs-next-187+ #1 SMP PREEMPT_DYNAMIC Tue Feb 18 10:53:23 WET 2025 MKFS_OPTIONS -- /dev/sdc MOUNT_OPTIONS -- /dev/sdc /home/fdmanana/btrfs-tests/scratch_1
btrfs/254 2s ... [failed, exit status 1]- output mismatch (see /home/fdmanana/git/hub/xfstests/results//btrfs/254.out.bad)
--- tests/btrfs/254.out 2024-10-07 12:36:15.532225987 +0100
+++ /home/fdmanana/git/hub/xfstests/results//btrfs/254.out.bad 2025-02-19 18:07:06.479812229 +0000
@@ -1,5 +1,13 @@
QA output created by 254
-Label: none uuid: <UUID>
- Total devices <NUM> FS bytes used <SIZE>
- devid <DEVID> size <SIZE> used <SIZE> path SCRATCH_DEV
- *** Some devices missing
+ERROR: not enough free space to allocate chunk
+btrfs-progs v6.13
...
(Run 'diff -u /home/fdmanana/git/hub/xfstests/tests/btrfs/254.out /home/fdmanana/git/hub/xfstests/results//btrfs/254.out.bad' to see the entire diff)
HINT: You _MAY_ be missing kernel fix:
770c79fb6550 btrfs: harden identification of a stale device
Ran: btrfs/254
Failures: btrfs/254
Failed 1 of 1 tests
Fix this by creating a 2G $lvdev device instead of 1G.
--- tests/btrfs/254 | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)
tests/btrfs/254 +5 -2
@@ -44,8 +44,11 @@ _scratch_dev_pool_get 3 setup_dmdev() { - # Some small size. - size=$((1024 * 1024 * 1024)) + # On filesystems up to 50G the metadata chunk size if 256M, but on + # larger ones it's 1G, so use 2G to ensure the test doesn't fail with + # -ENOSPC when running mkfs against $lvdev and $scratch_dev2 in case + # the device at $scratch_dev2 has more capacity than 50G. + size=$((2 * 1024 * 1024 * 1024)) size_in_sector=$((size / 512)) table="0 $size_in_sector linear $SCRATCH_DEV 0"
Signature · 1 line
2.45.2
Re: [PATCH 2/2] btrfs/254: fix test failure in case scratch devices are larger than 50G
Quoted 49 lines · On 20/2/25 02:19, [email protected] wrote:
From: Filipe Manana <[email protected]>
If the devices in the scratch pool have a size larger than 50G, then the test fails due to chunk allocation failure when attempting to create a multidevice filesystem on $lvdev and $scratch_dev2. This happens because the $lvdev device has a size of 1G and metadata chunks have a size of 1G for filesystems with a size greater than 50G, so mkfs fails when it attempts to allocate chunks since it needs to allocate a 1G metadata chunk plus a system chunk and a data chunk.
$ ./check btrfs/254 FSTYP -- btrfs PLATFORM -- Linux/x86_64 debian0 6.14.0-rc3-btrfs-next-187+ #1 SMP PREEMPT_DYNAMIC Tue Feb 18 10:53:23 WET 2025 MKFS_OPTIONS -- /dev/sdc MOUNT_OPTIONS -- /dev/sdc /home/fdmanana/btrfs-tests/scratch_1btrfs/254 2s ... [failed, exit status 1]- output mismatch (see
/home/fdmanana/git/hub/xfstests/results//btrfs/254.out.bad)
--- tests/btrfs/254.out 2024-10-07 12:36:15.532225987 +0100
+++/home/fdmanana/git/hub/xfstests/results//btrfs/254.out.bad2025-02-19 18:07:06.479812229 +0000
@@ -1,5 +1,13 @@
QA output created by 254
-Label: none uuid: <UUID>
- Total devices <NUM> FS bytes used <SIZE>
- devid <DEVID> size <SIZE> used <SIZE> pathSCRATCH_DEV
- *** Some devices missing
+ERROR: not enough free space to allocate chunk
+btrfs-progs v6.13
...
(Run 'diff -u/home/fdmanana/git/hub/xfstests/tests/btrfs/254.out/home/fdmanana/git/hub/xfstests/results//btrfs/254.out.bad' to see the entire diff)HINT: You _MAY_ be missing kernel fix:
770c79fb6550btrfs: harden identification of a stale deviceRan: btrfs/254 Failures: btrfs/254 Failed 1 of 1 testsFix this by creating a 2G $lvdev device instead of 1G.
Signed-off-by Filipe Manana <[email protected]>--- tests/btrfs/254 | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)tests/btrfs/254 +0
-0
tests/btrfs/254 _scratch_dev_pool_get 3 · line 47
Quoted 6 lines
tests/btrfs/254 +1
-2@@ -44,8 +44,11 @@ _scratch_dev_pool_get 3 setup_dmdev() { - # Some small size. - size=$((1024 * 1024 * 1024)) + # On filesystems up to 50G the metadata chunk size if 256M, but on
^s
Typo if->is.
tests/btrfs/254 _scratch_dev_pool_get 3 · line 52
Quoted 5 lines
tests/btrfs/254 +4
-0+ # larger ones it's 1G, so use 2G to ensure the test doesn't fail with + # -ENOSPC when running mkfs against $lvdev and $scratch_dev2 in case + # the device at $scratch_dev2 has more capacity than 50G. + size=$((2 * 1024 * 1024 * 1024)) size_in_sector=$((size / 512))
Fixed and applied to for-next.
Thanks, Anand
Quoted 2 lines
tests/btrfs/254 +0
-0table="0 $size_in_sector linear $SCRATCH_DEV 0"
Quoted 7 lines · On Wed, Feb 19, 2025 at 06:19:13PM +0000, [email protected] wrote:
From: Filipe Manana <[email protected]>
Fixes for btrfs/254, details in the change logs.
Filipe Manana (2):
btrfs/254: don't leave mount on test fs in case of failure/interruption btrfs/254: fix test failure in case scratch devices are larger than 50G
Quoted 3 lines · 在 2025/2/20 04:49, [email protected] 写道:
From: Filipe Manana <[email protected]>
Fixes for btrfs/254, details in the change logs.
Thanks,
Qu
Quoted 8 lines
Filipe Manana (2):
btrfs/254: don't leave mount on test fs in case of failure/interruption btrfs/254: fix test failure in case scratch devices are larger than 50Gtests/btrfs/254 | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-)