From: Ari Sundholm <ari@tuxera.com>
To: <fstests@vger.kernel.org>
Cc: Ari Sundholm <ari@tuxera.com>
Subject: [PATCH] generic/361: Require sparse file support and fix mounting the volume.
Date: Fri, 10 Sep 2021 14:53:55 +0300 [thread overview]
Message-ID: <20210910115355.2453046-1-ari@tuxera.com> (raw)
The test case generic/361 fails on multiple filesystem implementations
due to two issues:
1. A file is created on a 512 MB volume by truncating it to
1 GB. For this to work, the filesystem implementation must
support sparse files. However, the test case does not check
for sparse file support.
2. A loop device, backed by the 1 GB file, is created, mkfs is
run on it and it is mounted. However, the mount command does
not specify the filesystem type. This doesn't always work
properly, as the kernel may pick the wrong driver if there
are multiple implementations for a particular filesystem,
or not find a driver at all in some cases.
To fix the behavior of the test case, this commit adds a requirement
for sparse file support to the test case, and explicitly specifies the
filesystem type as $FSTYP when mounting the loop device.
Signed-off-by: Ari Sundholm <ari@tuxera.com>
---
tests/generic/361 | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/tests/generic/361 b/tests/generic/361
index 173a1a51..d76d2635 100755
--- a/tests/generic/361
+++ b/tests/generic/361
@@ -30,6 +30,7 @@ _supported_fs generic
_require_scratch
_require_block_device $SCRATCH_DEV
_require_loop
+_require_sparse_files
# create a small filesystem to hold another filesystem image
_scratch_mkfs_sized $((512 * 1024 * 1024)) >>$seqres.full 2>&1
@@ -44,7 +45,7 @@ mkdir -p $fs_mnt
# mount loop device and create a larger file to hit I/O errors on loop device
loop_dev=$(_create_loop_device $fs_img)
_mkfs_dev $loop_dev
-_mount $loop_dev $fs_mnt
+_mount -t $FSTYP $loop_dev $fs_mnt
if [ "$FSTYP" = "xfs" ]; then
# Turn off all XFS metadata IO error retries
dname=$(_short_dev $loop_dev)
--
2.25.1
reply other threads:[~2021-09-10 12:13 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20210910115355.2453046-1-ari@tuxera.com \
--to=ari@tuxera.com \
--cc=fstests@vger.kernel.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.