]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commit
xfs_io: Allow -P and -L to be given to open for O_PATH and O_NOFOLLOW
authorDavid Howells <dhowells@redhat.com>
Thu, 24 May 2018 19:48:41 +0000 (14:48 -0500)
committerEric Sandeen <sandeen@redhat.com>
Thu, 24 May 2018 19:48:41 +0000 (14:48 -0500)
commitfc52865c480556966b1c869c4f32338c8a60be5f
tree9e421f145d88f238c2d79cd05cf4f4f9587ecc82
parent7c4889e89b683cecfe53dc50326fb54215958328
xfs_io: Allow -P and -L to be given to open for O_PATH and  O_NOFOLLOW

Allow "open -P" to specify O_PATH so that paths which would otherwise be
unopenable might be opened for stat()'ing.  Such things include files that
would incur an access error or device files for which no corresponding
driver is available.

Allow "-L" to be given in conjunction with O_PATH to specify O_NOFOLLOW
also.

We also have to avoid calling xfsctl() if O_PATH is given as ioctls are
forbidden on such fds.  This means we cannot retrieve the geometry
information on an XFS filesystem, so the record gets cleared instead.  For
the moment, only the xfsctl() calls in the 'open' command are
conditionalised.

Signed-off-by: David Howells <dhowells@redhat.com>
Signed-off-by: Jeff Layton <jlayton@redhat.com>
Reviewed-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
io/file.c
io/init.c
io/io.h
io/open.c
man/man8/xfs_io.8