FS/XFS testing framework
 help / color / mirror / Atom feed
From: Jan Kara <jack@suse.cz>
To: <fstests@vger.kernel.org>
Cc: Zorro Lang <zlang@redhat.com>, Jan Kara <jack@suse.cz>
Subject: [PATCH v3 2/3] common: Unmount udf filesystem prior checking
Date: Tue, 31 Jan 2023 13:39:58 +0100	[thread overview]
Message-ID: <20230131124005.14207-2-jack@suse.cz> (raw)
In-Reply-To: <20230131123809.28200-1-jack@suse.cz>

_check_udf_filesystem forgot to unmount the filesystem prior to checking
it. That was leading to check failures.

Signed-off-by: Jan Kara <jack@suse.cz>
---
 common/rc | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/common/rc b/common/rc
index bf3effa4c1ed..7f80afe7aeec 100644
--- a/common/rc
+++ b/common/rc
@@ -3074,6 +3074,12 @@ _check_udf_filesystem()
 	return
     fi
 
+    # Is the filesystem mounted?
+    local type=`_fs_type $device`
+    if [ "$type" = "$FSTYP" ]; then
+	local mountpoint=`_umount_or_remount_ro $device`
+    fi
+
     local device=$1
     local blksz=`echo $MKFS_OPTIONS | sed -rn 's/.*(-b|--blocksize)[ =]?+([0-9]+).*/\2/p'`
     if [ -z "$blksz" ]; then
@@ -3090,6 +3096,10 @@ _check_udf_filesystem()
 	_udf_test_known_error_filter | \
 	grep -E -iv "Error count:.*[0-9]+.*total occurrences:.*[0-9]+|Warning count:.*[0-9]+.*total occurrences:.*[0-9]+" && \
         echo "Warning UDF Verifier reported errors see $seqres.checkfs." && return 1
+    # Remount the filesystem
+    if [ "$type" = "$FSTYP" ]; then
+	_mount_or_remount_rw "$MOUNT_OPTIONS" $device $mountpoint
+    fi
     return 0
 }
 
-- 
2.35.3


  parent reply	other threads:[~2023-01-31 12:40 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-31 12:39 [PATCH v3 0/3] fstests: Fix checking of UDF filesystems Jan Kara
2023-01-31 12:39 ` [PATCH v3 1/3] common: Provide blocksize and ecclength to udf fsck Jan Kara
2023-01-31 12:39 ` Jan Kara [this message]
2023-02-06 11:00   ` [PATCH v3 2/3] common: Unmount udf filesystem prior checking Zorro Lang
2023-01-31 12:39 ` [PATCH v3 3/3] common: Improve blocksize support for udf Jan Kara
2023-02-06 11:12   ` Zorro Lang
2023-02-07 12:28     ` Jan Kara

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230131124005.14207-2-jack@suse.cz \
    --to=jack@suse.cz \
    --cc=fstests@vger.kernel.org \
    --cc=zlang@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox