]>
Commit | Line | Data |
---|---|---|
a25c9ad6 TT |
1 | From fbb9bfa4a5925f8049ef51d8f59eb94920781ec8 Mon Sep 17 00:00:00 2001 |
2 | From: Theodore Ts'o <tytso@mit.edu> | |
3 | Date: Sat, 18 May 2019 23:04:49 -0400 | |
4 | Subject: [PATCH 2/2] e2scrub_all: avoid scrubbing all devices when there is | |
5 | nothing to scrub | |
6 | ||
7 | Running lsblk when there are no valid block devicse results in | |
8 | generating all block devices as the list of devices to scrub; this | |
9 | results in a lot of e2scrub_all failures. | |
10 | ||
11 | Addresses-Debian-Bug: #929186 | |
12 | ||
13 | Signed-off-by: Theodore Ts'o <tytso@mit.edu> | |
14 | --- | |
15 | scrub/e2scrub_all.in | 8 ++++++-- | |
16 | 1 file changed, 6 insertions(+), 2 deletions(-) | |
17 | ||
18 | diff --git a/scrub/e2scrub_all.in b/scrub/e2scrub_all.in | |
19 | index 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 | -- | |
38 | 2.19.1 | |
39 |