chiark / gitweb /
mount: monitor for utab changes with inotify
authorChris Leech <cleech@redhat.com>
Mon, 24 Nov 2014 04:33:39 +0000 (20:33 -0800)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Fri, 28 Nov 2014 19:30:50 +0000 (14:30 -0500)
commitbefb6d54948480f836d53d633bef27e3505818c1
treeaf77c29722d934c06ac261d2e74472058bc08d0c
parent8d3ae2bd4c9bf9fc2e57f7b3776325a1c750ca30
mount: monitor for utab changes with inotify

Parsing the mount table with libmount races against the mount command,
which will handle the actual mounting before updating utab.  This means
the poll event on /proc/self/mountinfo can kick of a reparse in systemd
before the utab information is available.

This change adds in an additional event source using inotify to watch
for changes to utab.  It only watches for IN_MOVED_TO events, matching
libmount behavior of always overwriting this file using rename(2).

This does add a second pass through the mount table parsing when utab is
updated.
src/core/manager.c
src/core/manager.h
src/core/mount.c