[systemd-devel] [PATCH] x86: defconfig: Enable CONFIG_FHANDLE

Lennart Poettering mzxreary at 0pointer.de
Mon Dec 1 04:42:37 PST 2014


On Mon, 01.12.14 14:54, Dave Chinner (david at fromorbit.com) wrote:

> On Mon, Dec 01, 2014 at 02:03:43AM +0100, Lennart Poettering wrote:
> > On Mon, 01.12.14 01:41, Richard Weinberger (richard at nod.at) wrote:
> > 
> > > CC'ing systemd folks.
> > > 
> > > Lennart, can you please explain why you need CONFIG_FHANDLE for systemd?
> > > Maybe I'm reading the source horrible wrong.
> > 
> > For two usecases:
> > 
> > a) Being able to detect if something is a mount point. The traditional
> >    way to do this is by stat()ing the dir in question and its parent
> >    and comparing st_dev. That logic is not able to detect bind mounts
> >    however, if destination and the place the mount is at are actually
> >    on the same file system... Thus we check the mount id too, if we
> >    can get our hands on it.
> 
> So what you really want in the mount id in st_buf.st_dev, not the
> underlying device number. i.e. fstatat(dirfd, path, buf,
> AT_MOUNTID)?

Well, I am not a fan of overloading things, and there might be reasons
why one would want to know both the mount id and the device id at the
same time with one atomic call, but ultimately I don't really care,
and fstatat(AT_MOUNT_ID) would certainly be at least as useful as
name_to_handle_at() is. 

Lennart


More information about the systemd-devel mailing list