2018-06-01-stable - scan: work around udev problems by avoiding open RDWR
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=a30e6222799409ab6e6151683c95eb13f4abaefb Commit: a30e6222799409ab6e6151683c95eb13f4abaefb Parent: 76075ff55d7d23731b91929ef992fe6bdd32a964 Author: David Teigland <[email protected]> AuthorDate: Wed Jun 20 11:32:45 2018 -0500 Committer: David Teigland <[email protected]> CommitterDate: Wed Jun 20 12:05:04 2018 -0500
scan: work around udev problems by avoiding open RDWR
udev creates a train wreck of events if we open devices with RDWR. Until we can fix/disable/scrap udev, work around this by opening RDONLY and then closing/reopening RDWR when a write is needed. This invalidates the bcache blocks for the device before writing so it can trigger unnecessary rereading.
--- lib/device/device.h | 1 + lib/label/label.c | 56 +++++++++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 55 insertions(+), 2 deletions(-)
lib/device/device.h +1 -0
@@ -35,6 +35,7 @@#define DEV_BCACHE_EXCL 0x00001000/* bcache_fd should be open EXCL */ #define DEV_FILTER_AFTER_SCAN 0x00002000/* apply filter after bcache has data */ #define DEV_FILTER_OUT_SCAN 0x00004000/* filtered out during label scan */ +#define DEV_BCACHE_WRITE 0x00008000/* bcache_fd is open with RDWR */ /* * Support for external device info.
lib/label/label.c +54 -2
97 lines not on this page · raw message