From: Su Yue <l@damenly.su>
To: fstests@vger.kernel.org
Cc: linux-mtd@lists.infradead.org, l@damenly.su
Subject: [PATCH v2] shared/032: add options for jffs2
Date: Sat, 19 Dec 2020 17:10:58 +0800 [thread overview]
Message-ID: <20201219091058.26422-1-l@damenly.su> (raw)
Recently I found that my disk space was eaten by results/shared/032.full
after one round of xfstests running. The file was filled with binary
bytes by the command:
`mkfs -t jffs2 /dev/mapper/test-2 >> results/shared/032.full 2>&1`
Manual of mkfs.jffs2:
========================================================================
The program mkfs.jffs2 creates a JFFS2 (Second Journalling Flash
File System) file system image and writes the resulting image to the
file specified by the -o option or by default to the standard output,
unless the standard output is a terminal device in which case mkfs.jffs2
will abort. The file system image is created using the files and
directories contained in the directory specified by the option -r or
the present directory, if the -r option is not specified.
========================================================================
So the command equals to
`mkfs -t jffs2 -r xfstests-dev /dev/mapper/test-2 \
-o xfstests-dev/results/shared/032.full \
>>xfstests-dev/results/shared/032.full 2>&1`
The output image 032.full is under the directory xfstests-dev.
mkfs.jffs2 keeps reading from 032.full in page size and append bytes
to 032.full until the disk where xfstests-devel located is full.
Fix it by setting @preargs to '-r /proc/fs -o' for jffs2, now the output
is $SCRATCH_DEV. Since mkfs.jffs2 doesn't check overwrite case, just
skip overwrite attempt.
Signed-off-by: Su Yue <l@damenly.su>
---
v2:
Fix typos in comment.
Fix path of results/shared/032.full in commit message.
---
tests/shared/032 | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/tests/shared/032 b/tests/shared/032
index 00ae6860d9d5..9836f13a691b 100755
--- a/tests/shared/032
+++ b/tests/shared/032
@@ -55,6 +55,8 @@ do
[ $fs = ext3 ] && preargs="-F"
[ $fs = ext4 ] && preargs="-F"
[ $fs = ext4dev ] && preargs="-F"
+ # jffs2 mkfs requires '-r $directory' and '-o $image'
+ [ $fs = jffs2 ] && preargs="-r /proc/fs -o"
# overwite the first few Kb - should blow away superblocks
$here/src/devzero -n 20 $SCRATCH_DEV >/dev/null
@@ -66,6 +68,9 @@ do
if [ $? -eq 0 ] ; then
# next, ensure we don't overwrite it
+ # jffs2 mkfs doesn't check overwrite case
+ [ $fs = jffs2 ] && continue
+
echo "=== Attempting $FSTYP overwrite of $fs..." >>$seqres.full
${MKFS_PROG} -t $FSTYP $SCRATCH_DEV >>$seqres.full 2>&1
--
2.29.2
reply other threads:[~2020-12-19 9:12 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=20201219091058.26422-1-l@damenly.su \
--to=l@damenly.su \
--cc=fstests@vger.kernel.org \
--cc=linux-mtd@lists.infradead.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox