Whamcloud - gitweb
debian: update for v1.45.1-2 to fix e2scrub bugs
authorTheodore Ts'o <tytso@mit.edu>
Mon, 20 May 2019 15:05:13 +0000 (11:05 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Mon, 20 May 2019 15:05:13 +0000 (11:05 -0400)
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
debian/changelog
debian/patches/0001-e2scrub-stop-cron-spam-if-lvm2-is-not-installed.patch [new file with mode: 0644]
debian/patches/0002-e2scrub_all-avoid-scrubbing-all-devices-when-there-i.patch [new file with mode: 0644]
debian/patches/series [new file with mode: 0644]

index 8c5ce29..5ee6281 100644 (file)
@@ -1,3 +1,11 @@
+e2fsprogs (1.45.1-2) unstable; urgency=medium
+
+  * Avoid spurious e2scrub_all error messages spamming administrators from
+    cron/systemd timer units when lvm2 is not installed and/or there are
+    no lvm devices present in the system (Closes: #928977, #929186, #929254)
+
+ -- Theodore Y. Ts'o <tytso@mit.edu>  Mon, 20 May 2019 11:02:09 -0400
+
 e2fsprogs (1.45.1-1) unstable; urgency=medium
 
   * New upstream feature
diff --git a/debian/patches/0001-e2scrub-stop-cron-spam-if-lvm2-is-not-installed.patch b/debian/patches/0001-e2scrub-stop-cron-spam-if-lvm2-is-not-installed.patch
new file mode 100644 (file)
index 0000000..abb4a55
--- /dev/null
@@ -0,0 +1,103 @@
+From 9d41a057d9643505942628c919869a7019646276 Mon Sep 17 00:00:00 2001
+From: Theodore Ts'o <tytso@mit.edu>
+Date: Thu, 16 May 2019 14:56:37 -0400
+Subject: [PATCH 1/2] e2scrub: stop cron spam if lvm2 is not installed.
+
+Addresses-Debian-Bug: #928977
+
+Signed-off-by: Theodore Ts'o <tytso@mit.edu>
+---
+ scrub/e2scrub_all.cron.in     |  2 +-
+ scrub/e2scrub_all.in          | 12 ++++++++++--
+ scrub/e2scrub_all.service.in  |  2 +-
+ scrub/e2scrub_all_cron.in     |  2 +-
+ scrub/e2scrub_reap.service.in |  2 +-
+ 5 files changed, 14 insertions(+), 6 deletions(-)
+
+diff --git a/scrub/e2scrub_all.cron.in b/scrub/e2scrub_all.cron.in
+index 7d42c3f2e..5bf83ec97 100644
+--- a/scrub/e2scrub_all.cron.in
++++ b/scrub/e2scrub_all.cron.in
+@@ -1,2 +1,2 @@
+ 30 3 * * 0 root test -e /run/systemd/system || @pkglibdir@/e2scrub_all_cron
+-10 3 * * * root test -e /run/systemd/system || @root_sbindir@/e2scrub_all -A -r
++10 3 * * * root test -e /run/systemd/system || @root_sbindir@/e2scrub_all -C -A -r
+diff --git a/scrub/e2scrub_all.in b/scrub/e2scrub_all.in
+index 31ebc7970..7ee653158 100644
+--- a/scrub/e2scrub_all.in
++++ b/scrub/e2scrub_all.in
+@@ -26,6 +26,7 @@ if (( $EUID != 0 )); then
+ fi
+ scrub_all=0
++run_from_cron=0
+ snap_size_mb=256
+ reap=0
+ conffile="@root_sysconfdir@/e2scrub.conf"
+@@ -73,6 +74,7 @@ while getopts "nrAV" opt; do
+       "n") DBG="echo Would execute: " ;;
+       "r") scrub_args="${scrub_args} -r"; reap=1;;
+       "A") scrub_all=1;;
++      "C") run_from_cron=1;;
+       "V") print_version; exitcode 0;;
+       *) print_help; exitcode 2;;
+       esac
+@@ -84,13 +86,19 @@ shift "$((OPTIND - 1))"
+ # when e2scrub_all is run out of cron or a systemd timer.
+ if ! type lsblk >& /dev/null ; then
++    if [ "${run_from_cron}" -eq 1 ] ; then
++      exitcode 0
++    fi
+     echo "e2scrub_all: can't find lsblk --- is util-linux installed?"
+-    exitcode 0
++    exitcode 1
+ fi
+ if ! type lvcreate >& /dev/null ; then
++    if [ "${run_from_cron}" -eq 1 ] ; then
++      exitcode 0
++    fi
+     echo "e2scrub_all: can't find lvcreate --- is lvm2 installed?"
+-    exitcode 0
++    exitcode 1
+ fi
+ # Find scrub targets, make sure we only do this once.
+diff --git a/scrub/e2scrub_all.service.in b/scrub/e2scrub_all.service.in
+index 20f42bfe3..77b6ad599 100644
+--- a/scrub/e2scrub_all.service.in
++++ b/scrub/e2scrub_all.service.in
+@@ -8,5 +8,5 @@ Documentation=man:e2scrub_all(8)
+ [Service]
+ Type=oneshot
+ Environment=SERVICE_MODE=1
+-ExecStart=@root_sbindir@/e2scrub_all
++ExecStart=@root_sbindir@/e2scrub_all -C
+ SyslogIdentifier=e2scrub_all
+diff --git a/scrub/e2scrub_all_cron.in b/scrub/e2scrub_all_cron.in
+index f9cff878c..bc26fee3d 100644
+--- a/scrub/e2scrub_all_cron.in
++++ b/scrub/e2scrub_all_cron.in
+@@ -65,4 +65,4 @@ on_ac_power() {
+ test -e /run/systemd/system && exit 0
+ on_ac_power || exit 0
+-exec @root_sbindir@/e2scrub_all
++exec @root_sbindir@/e2scrub_all -C
+diff --git a/scrub/e2scrub_reap.service.in b/scrub/e2scrub_reap.service.in
+index cf26437cd..40511f735 100644
+--- a/scrub/e2scrub_reap.service.in
++++ b/scrub/e2scrub_reap.service.in
+@@ -16,7 +16,7 @@ NoNewPrivileges=yes
+ User=root
+ IOSchedulingClass=idle
+ CPUSchedulingPolicy=idle
+-ExecStart=@root_sbindir@/e2scrub_all -A -r
++ExecStart=@root_sbindir@/e2scrub_all -C -A -r
+ SyslogIdentifier=%N
+ RemainAfterExit=no
+-- 
+2.19.1
+
diff --git a/debian/patches/0002-e2scrub_all-avoid-scrubbing-all-devices-when-there-i.patch b/debian/patches/0002-e2scrub_all-avoid-scrubbing-all-devices-when-there-i.patch
new file mode 100644 (file)
index 0000000..f07974a
--- /dev/null
@@ -0,0 +1,39 @@
+From fbb9bfa4a5925f8049ef51d8f59eb94920781ec8 Mon Sep 17 00:00:00 2001
+From: Theodore Ts'o <tytso@mit.edu>
+Date: Sat, 18 May 2019 23:04:49 -0400
+Subject: [PATCH 2/2] e2scrub_all: avoid scrubbing all devices when there is
+ nothing to scrub
+
+Running lsblk when there are no valid block devicse results in
+generating all block devices as the list of devices to scrub; this
+results in a lot of e2scrub_all failures.
+
+Addresses-Debian-Bug: #929186
+
+Signed-off-by: Theodore Ts'o <tytso@mit.edu>
+---
+ scrub/e2scrub_all.in | 8 ++++++--
+ 1 file changed, 6 insertions(+), 2 deletions(-)
+
+diff --git a/scrub/e2scrub_all.in b/scrub/e2scrub_all.in
+index 7ee653158..abc237e42 100644
+--- a/scrub/e2scrub_all.in
++++ b/scrub/e2scrub_all.in
+@@ -103,8 +103,12 @@ fi
+ # Find scrub targets, make sure we only do this once.
+ ls_scan_targets() {
+-      lsblk -o NAME,MOUNTPOINT,FSTYPE -P -n -p \
+-            $(lvs -o lv_path --noheadings -S "lv_active=active,lv_role=public,lv_role!=snapshot,vg_free>${snap_size_mb}") | \
++    local devices=$(lvs -o lv_path --noheadings -S "lv_active=active,lv_role=public,lv_role!=snapshot,vg_free>${snap_size_mb}")
++
++    if [ -z "$devices" ]; then
++      return 0;
++    fi
++    lsblk -o NAME,MOUNTPOINT,FSTYPE -P -n -p $devices | \
+           grep FSTYPE=\"ext\[234\]\" | while read vars ; do
+               eval "${vars}"
+-- 
+2.19.1
+
diff --git a/debian/patches/series b/debian/patches/series
new file mode 100644 (file)
index 0000000..3c24d42
--- /dev/null
@@ -0,0 +1,2 @@
+0001-e2scrub-stop-cron-spam-if-lvm2-is-not-installed.patch
+0002-e2scrub_all-avoid-scrubbing-all-devices-when-there-i.patch