From: Eric Biggers <ebiggers@kernel.org>
To: Theodore Ts'o <tytso@mit.edu>
Cc: fstests@vger.kernel.org
Subject: [PATCH resend] android-xfstests: fix finding FS_TYPE when userdata is on dm device
Date: Wed, 5 Sep 2018 12:07:00 -0700 [thread overview]
Message-ID: <20180905190700.66123-1-ebiggers@kernel.org> (raw)
From: Eric Biggers <ebiggers@google.com>
If the userdata filesystem is on a device-mapper device, then shrinking
the partition underneath it breaks 'blkid' probing, which
android-setup-partitions now uses find the filesystem type. Use blkid's
'-p' and '-S' options to do a low-level probe with explicitly specified
size, which still works in this case.
Signed-off-by: Eric Biggers <ebiggers@google.com>
---
kvm-xfstests/test-appliance/android-setup-partitions | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/kvm-xfstests/test-appliance/android-setup-partitions b/kvm-xfstests/test-appliance/android-setup-partitions
index 8d38303..ddaa252 100755
--- a/kvm-xfstests/test-appliance/android-setup-partitions
+++ b/kvm-xfstests/test-appliance/android-setup-partitions
@@ -259,7 +259,8 @@ get_fs_size()
# userdata partition. That isn't necessary, since resizing the underlying
# partition to a size smaller than the dm device just causes I/O requests to the
# truncated region to fail, and normally there should be no I/O occurring beyond
-# the end of the filesystem.
+# the end of the filesystem. Exception: this makes 'blkid' stop reporting
+# information about the device, unless blkid's -p and -S options are used.
shrink_userdata_partition()
{
local fs_size part_size
@@ -380,7 +381,9 @@ else
fi
# Type of the userdata filesystem, e.g. ext4 or f2fs
-USERDATA_FS_TYPE=$(blkid -s TYPE -o value "$USERDATA_FS_DEV")
+USERDATA_FS_TYPE=$(blkid -s TYPE -o value \
+ -p -S $(get_partition_size "$USERDATA_RAW_DEV") \
+ "$USERDATA_FS_DEV")
if ! all_partitions_present ; then
# Free up as much space as we can, then create the partitions.
--
2.19.0.rc2.392.g5ba43deb5a-goog
next reply other threads:[~2018-09-05 23:41 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-09-05 19:07 Eric Biggers [this message]
2018-09-15 19:36 ` [PATCH resend] android-xfstests: fix finding FS_TYPE when userdata is on dm device Theodore Y. Ts'o
2018-10-03 23:37 ` Eric Biggers
2018-10-04 2:35 ` Theodore Y. Ts'o
2018-10-11 12:01 ` Amir Goldstein
2018-10-11 14:56 ` Theodore Y. Ts'o
2018-10-11 15:12 ` Amir Goldstein
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=20180905190700.66123-1-ebiggers@kernel.org \
--to=ebiggers@kernel.org \
--cc=fstests@vger.kernel.org \
--cc=tytso@mit.edu \
/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.