Bug#935009: e2fsprogs: e2scrub_all doesn't work when vg_free>${snap_size_mb}

2019-08-18 Thread Theodore Y. Ts'o
Control: tags -1 +pending
Control: severity -1 normal

On Sun, Aug 18, 2019 at 04:16:25AM +0200, Mikhail Morfikov wrote:
> There's no error indicating what could be wrong.
> 
> Looking through the /usr/sbin/e2scrub_all file, I noticed the following line:
> 
> local devices=$(lvs -o lv_path --noheadings -S
> "lv_active=active,lv_role=public,lv_role!=snapshot,vg_free>${snap_size_mb}")
> 
> There's vg_free>${snap_size_mb} which causes the problem -- the above lvs
> command returns nothing. It should be ">=" instead of ">", or the value in
> /etc/e2scrub.conf should be less than what pvscan returns as "free" to make it
> work.

Thanks for the bug report.  The following patch will be in the next
release of e2fsprogs.

- Ted

commit 2e8cb3bebfd72c35922ddd5229fe0117b61ff19d
Author: Theodore Ts'o 
Date:   Sun Aug 18 19:23:07 2019 -0400

e2scrub_all: allow scrubbing in vg's whose free space == snapshot size

If the volume group's free space is exactly the same as snapshot size,
e2scrub_all will skip those logical volumes in those volume groups.
Fix this by changing the test from '>' to '>='.

Fixes: c120312253 ("e2scrub_all: make sure there's enough free space...")
Addresses-Debian-Bug: #935009
Signed-off-by: Theodore Ts'o 

diff --git a/scrub/e2scrub_all.in b/scrub/e2scrub_all.in
index 5bdbd116..2c563672 100644
--- a/scrub/e2scrub_all.in
+++ b/scrub/e2scrub_all.in
@@ -103,7 +103,7 @@ fi
 
 # Find scrub targets, make sure we only do this once.
 ls_scan_targets() {
-local devices=$(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;



Bug#935009: e2fsprogs: e2scrub_all doesn't work when vg_free>${snap_size_mb}

2019-08-17 Thread Mikhail Morfikov
Package: e2fsprogs
Version: 1.45.3-4
Severity: important

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA512

Dear Maintainer,

I have 4 GiB of free space in each of my PVs:

# pvscan
  PV /dev/mapper/sdb1_crypt   VG wd_blue_labellvm2 [820.30 GiB / 4.00 GiB
free]
  PV /dev/mapper/sda2_crypt   VG wd_black_label   lvm2 [<230.88 GiB / 4.00 GiB
free]
  Total: 2 [<1.03 TiB] / in use: 2 [<1.03 TiB] / in no VG: 0 [0   ]

I also have snap_size_mb=4096 set in the /etc/e2scrub.conf file, but nothing
happens when I issue as root the following command:

# e2scrub_all

There's no error indicating what could be wrong.

Looking through the /usr/sbin/e2scrub_all file, I noticed the following line:

local devices=$(lvs -o lv_path --noheadings -S
"lv_active=active,lv_role=public,lv_role!=snapshot,vg_free>${snap_size_mb}")

There's vg_free>${snap_size_mb} which causes the problem -- the above lvs
command returns nothing. It should be ">=" instead of ">", or the value in
/etc/e2scrub.conf should be less than what pvscan returns as "free" to make it
work.





- -- System Information:
Debian Release: bullseye/sid
  APT prefers unstable
  APT policy: (990, 'unstable'), (130, 'experimental')
Architecture: amd64 (x86_64)

Kernel: Linux 5.2.9-amd64-morficzny+ (SMP w/2 CPU cores; PREEMPT)
Kernel taint flags: TAINT_RANDSTRUCT
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8),
LANGUAGE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages e2fsprogs depends on:
ii  libblkid12.34-0.1
ii  libc62.28-10
ii  libcom-err2  1.45.3-4
ii  libext2fs2   1.45.3-4
ii  libss2   1.45.3-4
ii  libuuid1 2.34-0.1
ii  logsave  1.45.3-4

Versions of packages e2fsprogs recommends:
pn  e2fsprogs-l10n  

Versions of packages e2fsprogs suggests:
pn  e2fsck-static  
pn  fuse2fs
pn  gpart  
ii  parted 3.2-25+b1

- -- Configuration Files:
/etc/e2scrub.conf changed:
periodic_e2scrub=1
recipient=root
snap_size_mb=4096
scrub_all=1



- -- no debconf information

-BEGIN PGP SIGNATURE-

iQIzBAEBCgAdFiEE5JPPWm5C7TFDUMqpzQRoEHcbZSAFAl1YtPEACgkQzQRoEHcb
ZSCg5Q/9HHg254TnJ+yug2jPiFPgyzp59nHrZ25CSZjmoCvl0IvmSDtmzgIzj9Kw
F6jMC23+rewK9kjFjcZrGzz3pNblwx5z6QIPOm7m6Xob9gPV0EXIURI4sqeo2u76
ZmZjOeTd+1hjq2w6XKVElbVcB04qC36hCIN7apyZVdW6TVhZGFBHSA95xz9rTSa6
7i2o9Z9PSlsyKVBC7+Bf/ucTpzNQG/avOm5GuHl2++KSl3+gIeHZqgvOWdfd28pg
L5H58uafWn2RqrHkIbJVZCUTsuJzYTV/Kk5c3/KytR2OpOTfpCxj0QQ44NOHnrzx
EdzGkLD5XJVe8MB62OzCHWP/6iJWD8SfnsmMn705TankVjWMzZyKkXUVIAEK/ijq
MWcCvlONJxYEWk0NcoM0NQ1XAycfqdxOWx0mdCHV7fnM4qah+RxZgufi8iMoySXG
7MwqFWvtWiS7MMkBN6KVAMx88JXSmsc9WCOw0GjV4UrUDv3G2rdAfA6BCFejA4IR
dm1vX1xedDBDFZBNkdTvYYsr237Ro/PNyL+slZdh/2woMgliaez02/CzeeA7BAK5
MzS2sVCtIXrXxzfxqbPwaHkMJO4lXLQGcroY1pEt6RljUbCYx35/eeH9dwp6NWDH
P/burk6Fey3Nn7/YB+XiI9UVjOGZQbiuti3E1gxVW0Dz/1zJGPc=
=ZvAz
-END PGP SIGNATURE-