Re: [PATCH v4] btrfs: a new test case to verify mount behavior with background remounting

[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]





在 2024/11/7 17:47, Anand Jain 写道:



+# 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
+
+# If above unmount, especially subv2 is not properly unmounted,
+# the rm should fail with some error message
+rm -r -- "$subv1_mount" "$subv2_mount"

nit:
Nice, if unmounting $subvol2_mount fails, rm will fail as well.
To capture the unmount error why not redirect its output
to the test case’s full log:
  unmount $subvol2_mount >> $seqres.full.

Because if $subvol2_mount is already unmounted (e.g. the interruption
happens after the umount funished), then above command will cause stderr
to pollute the golden output.

So at least we need to redirect both stderr and stdout, e.g.

  umount $subvol2_mount >> $seqres.full 2>&1

I'm fine with newer change, although that can always be done when
debugging, and with the initial test (and all the failures I have hit),
it should be good enough for now, until we got some new regression.

Thanks,
Qu

If you're fine with it, Zorro can consider to change this
during the merge. Nevertheless, the code looks good.

   Reviewed-by: Anand Jain <anand.jain@xxxxxxxxxx>

Thx, Anand







[Index of Archives]     [Linux Filesystems Development]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux