I will not commit this as a giant patch but will probably split it up
(e.g. handling LINK_MAX for individual filesystems as commits, probably
a single commit to move various settings out of vop_stdpathconf(), and
probably a separate commit for _PC_PIPE_BUF and switching FIFOs to use
their native fs' pathconf method). However, I think it can probably be
reviewed as one big chunk where one can see the cumulative effects.
Log messages from commits on this branch so far:
Add a real VOP_PATHCONF for fdescfs.
Honor the hardcoded link counts when reporting the LINK_MAX attribute.
Forward requests for variables other than NAME_MAX and LINK_MAX to the
underlying file descriptor via kern_fpathconf().
Flesh out ZFS pathconf handling.
- Handle _PC_NAME_MAX, _PC_PIPE_BUF (only dirs and fifos), and _PC_CHOWN_RESTRICTED.
- Use regular pathconf method for FIFOs. In particular, this supports _PC_NAME_MAX, _PC_LINK_MAX and several other variables for FIFOs.
Flesh out devfs_pathconf some more.
- _PC_FILESIZEBITS, _PC_NAME_MAX, _PC_LINK_MAX, _PC_SYMLINK_MAX, _PC_CHOWN_RESTRICTED.
ext2 pathconf fixes
- Use ext2_pathconf for FIFOs.
- Handle _PC_NAME_MAX, _PC_PIPE_BUF, and _PC_CHOWN_RESTRICTED.
Add a real implementation of VOP_PATHCONF for fuse.
This doesn't set _PC_CHOWN_RESTRICTED because I couldn't tell if chown
operations are actually restricted. fuse's setattr VOP sets a FACCESS_CHOWN
flag only to clear it via the FACCESS_XQUERIES mask before calling
fuse_internal_access(). For its part, fuse_internal_access() doesn't check
FACCESS_CHOWN. Perhaps a filesystem can optionally choose to enforce
restrictions, but it would need to be unconditional to set _PC_CHOWN_RESTRICTED
I think.
msdosfs pathconf fixes.
- Put back _PC_CHOWN_RESTRICTED.
- Add _PC_FILESIZEBITS.
nandfs pathconf fixes.
- Bring back _PC_LINK_MAX (but NANDFS_LINK_MAX), _PC_NAME_MAX (but NANDFS_NAME_LEN), _PC_PIPE_BUF (only dirs and fifos), and _PC_CHOWN_RESTRICTED.
- Use nandfs_pathconf for FIFOs.
- While here, consistently use NANDFS_LINK_MAX instead of LINK_MAX.
Use nlink_t instead of u_short for link count type.
This avoids truncating link counts > 2^15.
NFS pathconf fixes.
- Use INT_MAX as fallback link max (RPC field is 32 bits)
- Bring back _PC_PIPE_BUF.
- Use nfs_pathconf for FIFOs.
smbfs pathconf fixes.
- Remove _PC_LINK_MAX rather than returning 0.
- Handle _PC_FILESIZEBITS.
- Claim _PC_NO_TRUNC.
tmpfs pathconf fixes.
Note that FIFOs don't actually work since they don't use a separate VOP
vector.
udf pathconf fixes
- Use ufd_pathconf for FIFOs.
- Handle _PC_PIPE_BUF.
UFS pathconf fixes.
- Use ufs_pathconf for FIFOs.
- Add UFS_LINK_MAX and use instead of LINK_MAX.
- Restore _PC_LINK_MAX, _PC_PIPE_BUF, and _PC_CHOWN_RESTRICTED.
Retire FIFO pathconf method.
Trim vop_stdpathconf.
Drop _PC_NAME_MAX, _PC_LINK_MAX, _PC_PIPE_BUF, _PC_CHOWN_RESTRICTED.
Use tmpfs_pathconf for FIFOs on tmpfs.
Export tmpfs_pathconf.
More LINK_MAX fixes for ZFS.
In particular, add a ZFS_LINK_MAX which is 2^64 - 1. Use it to re-enable
EMLINK checking in zfs_link_create() and avoid capping va_nlink to LINK_MAX
as that is no longer needed.
Add an NFS_LINK_MAX and replace LINK_MAX usage with it.
I'm not certain ZFS really does CHOWN_RESTRICTED.
Use uint32_t cast to avoid sign extension.
Use 'int' for tmpfs link count and adopt a TMPFS_LINK_MAX.
Use NFS_LINK_MAX.
Truncate to LONG_MAX due to pathconf() API limitations.
Clean up after rebase of tmpfs_print commit.