]> www.infradead.org Git - users/hch/xfstests-dev.git/commitdiff
fstests: btrfs/261 fix failure if /var/lib/btrfs isn't writable
authorAnand Jain <anand.jain@oracle.com>
Tue, 29 Aug 2023 12:34:06 +0000 (20:34 +0800)
committerZorro Lang <zlang@kernel.org>
Sat, 16 Sep 2023 03:27:52 +0000 (11:27 +0800)
We don't need scrub status; it is okay to ignore the warnings due to
the readonly /var/lib/btrfs if any. Redirect stderr to seqres.full.
We check the scrub return status.

    +WARNING: failed to open the progress status socket at /var/lib/btrfs/scrub.progress.42fad803-d505-48f4-a04d-612dbf8bd724: Read-only file system. Progress cannot be queried
    +WARNING: failed to write the progress status file: Read-only file system. Status recording disabled

Signed-off-by: Anand Jain <anand.jain@oracle.com>
Reviewed-by: Zorro Lang <zlang@redhat.com>
Signed-off-by: Zorro Lang <zlang@kernel.org>
tests/btrfs/261

index 21567052d58e98ad8fa5e8a3d204b560e7abcccc..26aed2c20769e192a83db88eaafecd8feb2bebdf 100755 (executable)
@@ -68,7 +68,9 @@ workload()
        $BTRFS_UTIL_PROG scrub start -B $SCRATCH_MNT >> $seqres.full 2>&1
 
        # Make sure above scrub fixed the fs
-       $BTRFS_UTIL_PROG scrub start -Br $SCRATCH_MNT >> $seqres.full
+       # Redirect the stderr to seqres.full as well to avoid warnings if
+       # /var/lib filesystem is readonly, as scrub fails to write status.
+       $BTRFS_UTIL_PROG scrub start -Br $SCRATCH_MNT >> $seqres.full 2>&1
        if [ $? -ne 0 ]; then
                echo "scrub failed to fix the fs for profile $mkfs_opts"
        fi