]> sourceware.org Git - lvm2.git/commit
fix dev_unset_last_byte after write error
authorHeming Zhao <heming.zhao@suse.com>
Wed, 13 Nov 2019 15:15:07 +0000 (09:15 -0600)
committerDavid Teigland <teigland@redhat.com>
Wed, 13 Nov 2019 15:36:58 +0000 (09:36 -0600)
commit13c254fc05386d05ab6bbda2806f9ca4d3358a0c
tree91aeeeb28a850ef702a3dee4021927f0c6544161
parent9cad26be321844868a904c7b07bebe37be4e0169
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>
lib/format_text/format-text.c
lib/label/label.c
lib/metadata/mirror.c
This page took 0.034386 seconds and 5 git commands to generate.