From befb6d54948480f836d53d633bef27e3505818c1 Mon Sep 17 00:00:00 2001 From: Chris Leech Date: Sun, 23 Nov 2014 20:33:39 -0800 Subject: 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.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/core/manager.h') diff --git a/src/core/manager.h b/src/core/manager.h index 02535023a3..ab75f902e5 100644 --- a/src/core/manager.h +++ b/src/core/manager.h @@ -182,6 +182,8 @@ struct Manager { /* Data specific to the mount subsystem */ FILE *proc_self_mountinfo; sd_event_source *mount_event_source; + int utab_inotify_fd; + sd_event_source *mount_utab_event_source; /* Data specific to the swap filesystem */ FILE *proc_swaps; -- cgit v1.2.3-54-g00ecf