Whamcloud - gitweb
e2scrub_all: correctly handle the case where LUKS is stacked on an LV
authorTheodore Ts'o <tytso@mit.edu>
Thu, 4 Jul 2019 15:39:45 +0000 (11:39 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Thu, 4 Jul 2019 19:25:24 +0000 (15:25 -0400)
We handle the case where an LVM's PV is stacked on top of a dm-crypt
device, but not the case where it's the other way around, where a LVM
LV contains a LUKS encrypted file system.  Fix this oversight.

Addresses-Debian-Bug: #931387

Reported-by: Marc Haber <mh+debian-bugs@zugschlus.de>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
scrub/e2scrub_all.in

index cdc37ce..24b2c68 100644 (file)
@@ -102,8 +102,9 @@ ls_scan_targets() {
     if [ -z "$devices" ]; then
        return 0;
     fi
-    lsblk -o NAME,MOUNTPOINT,FSTYPE -P -n -p $devices | \
-           grep FSTYPE=\"ext\[234\]\" | while read vars ; do
+    lsblk -o NAME,MOUNTPOINT,FSTYPE,TYPE -P -n -p $devices | \
+       grep FSTYPE=\"ext\[234\]\" | grep TYPE=\"lvm\" | \
+       while read vars ; do
                eval "${vars}"
 
                if [ "${scrub_all}" -eq 1 ] || [ -n "${MOUNTPOINT}" ]; then