f9b1e711f0
The 'nodup' option forces fdescfs to return real vnode behind file descriptor instead of the fdescfs fd vnode, on lookup. The end result is that e.g. stat("/dev/fd/3") returns the stat data for the underlying vnode, if any. Similarly, fchdir(2) works in the expected way. For open(2), if applied over file descriptor opened with O_PATH, it effectively re-open that vnode into normal file descriptor which has the specified access mode, assuming the current vnode permissions allow it. If the file descriptor does not reference vnode, the behavior is unchanged. This is done by a mount option, because permission check on open(2) breaks established fdescfs open semantic of dup(2)-ing the descriptor. So it is not suitable for /dev/fd mount. Tested by: Andrew Walker <awalker@ixsystems.com> Reviewed by: markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D30140