public inbox for fstests@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH resend] android-xfstests: fix finding FS_TYPE when userdata is on dm device
@ 2018-09-05 19:07 Eric Biggers
  2018-09-15 19:36 ` Theodore Y. Ts'o
  0 siblings, 1 reply; 7+ messages in thread
From: Eric Biggers @ 2018-09-05 19:07 UTC (permalink / raw)
  To: Theodore Ts'o; +Cc: fstests

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

^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2018-10-11 22:40 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-09-05 19:07 [PATCH resend] android-xfstests: fix finding FS_TYPE when userdata is on dm device Eric Biggers
2018-09-15 19:36 ` 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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox