[systemd-devel] [PATCH v2 5/5] mount: auto-detect iSCSI and FCoE as requiring network

Karel Zak kzak at redhat.com
Mon Dec 1 07:47:32 PST 2014

On Mon, Dec 01, 2014 at 02:28:33PM +0100, Zbigniew Jędrzejewski-Szmek wrote:
> > Wouldn't be enough to use Chris' iSCSI and FCoE auto detection?
> Please see previous discussion... Detecting network might not be trivial
> if the devices are layered and there's a network-requiring device somewhere
> lower in the stack.

 Good point. (It would be possible to analyze whole stack by slave/holders
 relations, but I agree it's too complex and probably too fragile.)

> > Anyway, if you still want to read userspace mount options than I can
> > add something like:
> > 
> >  mnt_inotify_mtab_add_watch()
> >  mnt_inotify_mtab_rm_watch()
> >  mnt_inotify_mtab_changed()
> > 
> > to hide all the paths and private mtab/utab stuff.
> Maybe something more like what journal client code does here:
>  mnt_mtab_get_fd() -> epoll fd
>  mnt_mtab_get_events() -> EPOLLIN|EPOLLPRI
>  mnt_mtab_process() -> information what changed

 Hmm.. utab is optional and very often does not exist, and library
 uses rename(2) to do atomic update of the file. This is reason why
 Chris have used inotify for /run/mount directory (and Lennart asked
 for inotify API). I have doubts you can use epoll to monitor 
 directories, epoll is about I/O monitoring.


 Karel Zak  <kzak at redhat.com>

More information about the systemd-devel mailing list