[systemd-devel] [PATCH v2 1/2] path-util: Fix path_is_mount_point for files

Martin Pitt martin.pitt at ubuntu.com
Fri May 29 08:22:57 PDT 2015


Hello,

Lennart Poettering [2015-05-28 19:44 +0200]:
> I really think this should work as close as the usual *at() calls
> work. i.e. take a dir fd as first argument, and a filename
> *within*that*directory* to check. Maybe even give it the _at() suffix:
> 
> int fd_is_mount_point_at(int fd, const char *filename, int flags);
> int path_is_mount_point(const char *path, int flags);
> 
> path_is_mount_point() simply seperates the last part of the path,
> opens its parent directory, and then invokes fd_is_mount_point_at()
> with the parent dir and the last component...

Done now, this indeed looks much better now, avoids the "have parent
or not" cases.

This patch keeps the signature of path_is_mount_point(), as that's
being used in a lot of places. For simpler revivewing I'll send that
as a second patch. This updates fd_is_mount_point_at() to behave like
openat() and work for files again, fixing the regression.

Martin

-- 
Martin Pitt                        | http://www.piware.de
Ubuntu Developer (www.ubuntu.com)  | Debian Developer  (www.debian.org)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-path-util-Fix-path_is_mount_point-for-files.patch
Type: text/x-diff
Size: 10459 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/systemd-devel/attachments/20150529/61e75a54/attachment-0001.patch>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.freedesktop.org/archives/systemd-devel/attachments/20150529/61e75a54/attachment-0001.sig>


More information about the systemd-devel mailing list