1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-03-06 00:58:48 +03:00

TEST: Unaccounted possible output causing failure

lvchange-raid.sh checks to ensure that the 'p'artial flag takes
precedence over the 'w'ritemostly flag by disabling and reenabling
a device in the array.  Most of the time this works fine, but
sometimes the kernel can notice the device failure before it is
reenabled.  In that case, the attr flag will not return to 'w', but
to 'r'efresh.  This is because 'r'efresh also takes precedence over
the 'w'ritemostly flag.  So, we also do a quick check for 'r' and
not just 'w'.
This commit is contained in:
Jonathan Brassow 2013-09-12 13:23:53 -05:00
parent e2268aeb92
commit 1d06868240

View File

@ -105,7 +105,15 @@ run_writemostly_check() {
# Partial flag supercedes writemostly flag
aux disable_dev $d0
lvs -a --noheadings -o lv_attr $vg/${lv}_rimage_0 | grep '.*p.$'
# It is possible for the kernel to detect the failed device before
# we re-enable it. If so, the field will be set to 'r'efresh since
# that also takes precedence over 'w'ritemostly. If this has happened,
# we refresh the LV and then check for 'w'.
aux enable_dev $d0
if lvs -a --noheadings -o lv_attr $vg/${lv}_rimage_0 | grep '.*r.$'; then
lvchange --refresh $vg/$lv
fi
lvs -a --noheadings -o lv_attr $vg/${lv}_rimage_0 | grep '.*w.$'
# Catch Bad writebehind values