(lib)mpathpersist: use O_RDONLY file descriptors
authorMartin Wilck <mwilck@suse.com>
Mon, 8 Oct 2018 09:38:20 +0000 (11:38 +0200)
committerChristophe Varoqui <christophe.varoqui@opensvc.com>
Tue, 9 Oct 2018 11:35:35 +0000 (13:35 +0200)
commit9ec710af38275f4fe6c0d8f396cd226a8e361aa4
tree01e476aabb9ac5735de42c4c1c48de9f76c98f7a
parent7eab12a8861da1c7ff19e3025af3dec73c26a90c
(lib)mpathpersist: use O_RDONLY file descriptors

udevd catches close-after-write inotify events and generates "change"
uvents for such devices, which may cause extra unnecessary and unwanted
udev activity.

Therefore use O_RDONLY file descriptors for PRIN and PROUT commands. This
works just as well as O_WRONLY. sg_persist has supported the --readonly option
for years.

Signed-off-by: Martin Wilck <mwilck@suse.com>
libmpathpersist/mpath_pr_ioctl.c
mpathpersist/main.c