]> git.ipfire.org Git - thirdparty/e2fsprogs.git/blame - debian/patches/0002-e2scrub_all-avoid-scrubbing-all-devices-when-there-i.patch
Merge tag 'v1.45.2' into debian/master
[thirdparty/e2fsprogs.git] / debian / patches / 0002-e2scrub_all-avoid-scrubbing-all-devices-when-there-i.patch
CommitLineData
a25c9ad6
TT
1From fbb9bfa4a5925f8049ef51d8f59eb94920781ec8 Mon Sep 17 00:00:00 2001
2From: Theodore Ts'o <tytso@mit.edu>
3Date: Sat, 18 May 2019 23:04:49 -0400
4Subject: [PATCH 2/2] e2scrub_all: avoid scrubbing all devices when there is
5 nothing to scrub
6
7Running lsblk when there are no valid block devicse results in
8generating all block devices as the list of devices to scrub; this
9results in a lot of e2scrub_all failures.
10
11Addresses-Debian-Bug: #929186
12
13Signed-off-by: Theodore Ts'o <tytso@mit.edu>
14---
15 scrub/e2scrub_all.in | 8 ++++++--
16 1 file changed, 6 insertions(+), 2 deletions(-)
17
18diff --git a/scrub/e2scrub_all.in b/scrub/e2scrub_all.in
19index 7ee653158..abc237e42 100644
20--- a/scrub/e2scrub_all.in
21+++ b/scrub/e2scrub_all.in
22@@ -103,8 +103,12 @@ fi
23
24 # Find scrub targets, make sure we only do this once.
25 ls_scan_targets() {
26- lsblk -o NAME,MOUNTPOINT,FSTYPE -P -n -p \
27- $(lvs -o lv_path --noheadings -S "lv_active=active,lv_role=public,lv_role!=snapshot,vg_free>${snap_size_mb}") | \
28+ local devices=$(lvs -o lv_path --noheadings -S "lv_active=active,lv_role=public,lv_role!=snapshot,vg_free>${snap_size_mb}")
29+
30+ if [ -z "$devices" ]; then
31+ return 0;
32+ fi
33+ lsblk -o NAME,MOUNTPOINT,FSTYPE -P -n -p $devices | \
34 grep FSTYPE=\"ext\[234\]\" | while read vars ; do
35 eval "${vars}"
36
37--
382.19.1
39