1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-21 13:34:40 +03:00
lvm2/lib/label
Heming Zhao 13c254fc05 fix dev_unset_last_byte after write error
dev_unset_last_byte() must be called while the fd is still valid.
After a write error, dev_unset_last_byte() must be called before
closing the dev and resetting the fd.

In the write error path, dev_unset_last_byte() was being called
after label_scan_invalidate() which meant that it would not unset
the last_byte values.

After a write error, dev_unset_last_byte() is now called in
dev_write_bytes() before label_scan_invalidate(), instead of by
the caller of dev_write_bytes().

In the common case of a successful write, the sequence is still:
dev_set_last_byte(); dev_write_bytes(); dev_unset_last_byte();

Signed-off-by: Zhao Heming <heming.zhao@suse.com>
2019-11-13 09:36:58 -06:00
..
hints.c hints: check for malloc failure 2019-08-28 12:41:57 -05:00
hints.h hints: skip hint flock if nolocking option is set 2019-04-29 13:01:15 -05:00
label.c fix dev_unset_last_byte after write error 2019-11-13 09:36:58 -06:00
label.h scanning: open devs rw when rescanning for write 2019-06-21 10:57:49 -05:00