]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
nfscl: Fix NFS VOP_ALLOCATE for mounts without Allocate support
authorRick Macklem <rmacklem@FreeBSD.org>
Sun, 10 Oct 2021 21:27:52 +0000 (14:27 -0700)
committerRick Macklem <rmacklem@FreeBSD.org>
Sun, 10 Oct 2021 21:27:52 +0000 (14:27 -0700)
commit235891a1273d99b86784f935d2d6c554ce189559
treefda3cc0913b2721bb61683f940f52646d2e23c0d
parente81e77c5a055d1cbf6d6a6f0acbaf443267aa84f
nfscl: Fix NFS VOP_ALLOCATE for mounts without Allocate support

Without this patch, nfs_allocate() fell back on using vop_stdallocate()
for NFS mounts without Allocate operation support.  This was incorrect,
since some file systems, such as ZFS, cannot do allocate via
vop_stdallocate(), which uses writes to try and allocate blocks.

Also, fix nfs_allocate() to return EINVAL when mounts cannot do Allocate,
since that is the correct error for posix_fallocate(2).
Note that Allocate is only supported by some NFSv4.2 servers.

MFC after: 2 weeks
sys/fs/nfsclient/nfs_clvnops.c