#878441 lvm2: commands that flush cache do not complete

Package:
lvm2
Source:
lvm2
Description:
Linux Logical Volume Manager
Submitter:
"Michael F. Lamb"
Date:
2017-10-13 18:15:05 UTC
Severity:
normal
#878441#5
Date:
2017-10-13 18:14:09 UTC
From:
To:
I have an lv with a writeback cache:

$ sudo lvs -a -o+cachemode
  LV                VG    Attr       LSize   Pool        Origin       Data%  Meta%  Move Log Cpy%Sync Convert CacheMode
  ...
  home              linux Cwi-a-C--- 130.00g [homecache] [home_corig] 99.94  1.72            90.77            writeback
  [home_corig]      linux owi-aoC--- 130.00g
  [home_corig]      linux owi-aoC--- 130.00g
  [home_corig]      linux owi-aoC--- 130.00g
  [homecache]       linux Cwi---C--- 104.16g                          99.94  1.72            90.77            writeback
  [homecache_cdata] linux Cwi-ao---- 104.16g
  [homecache_cmeta] linux ewi-ao----  20.00m

After a hard-reset and an fsck which performed several repairs, I
attempted to change the cachemode from 'writeback' to 'writethrough'.
The progress reaches a certain point but then seems to loop forever.

$ sudo lvchange --cachemode writethrough linux/home
  Flushing 24191 blocks for cache linux/home.
  Flushing 24190 blocks for cache linux/home.
  Flushing 24189 blocks for cache linux/home.
  Flushing 24189 blocks for cache linux/home.
  Flushing 24189 blocks for cache linux/home.
[ ... repeating for hours ... ]
  Flushing 24189 blocks for cache linux/home.
^C  Interrupted...
  Flushing of linux/home aborted.

Then I attempted to remove the cache altogether, with the same result.

$ sudo lvconvert --uncache linux/home
  Flushing 24189 blocks for cache linux/home.
[ ... repeating for hours ... ]
  Flushing 24189 blocks for cache linux/home.
^C  Interrupted...
  Flushing of linux/home aborted.

This issue seems like it might be related to upstream
https://bugzilla.redhat.com/show_bug.cgi?id=1276722 but a comment on
that bug states it was dealt with back in version 2.02.133. (I'm on
2.02.173.)

Note: during this issue, I also experienced bug #857142, so had to
perform the fsck after booting from a debian live usb drive. The
lvchange and lvconvert commands however were performed from this system.

I ran SMART extended diagnostics (including surface scan) on the drives
hosting the PVs for both the cache and home LVs and it reported no
problems. I can't find any I/O errors in my system logs either.

I don't know what initially caused the crash requiring me to hard-reset.
I think it was related to switching my xorg console while using
proprietary video drivers.

I copied (with tar) the data over to a new non-cached lv for my /home,
but I still have the old one around if you would like additional
information about it.