diff options
author | rmacklem <rmacklem@FreeBSD.org> | 2011-12-16 00:58:41 +0000 |
---|---|---|
committer | rmacklem <rmacklem@FreeBSD.org> | 2011-12-16 00:58:41 +0000 |
commit | 8b1b8ed3cbd6bbfca00c2962853afec4ba1e1839 (patch) | |
tree | f4c6e5b2f149441fa125820d0ba5b0ae4d5a416b /sys/fs/nfsserver | |
parent | 5cd3bc283f665c6196ab07ea7d8978ce28ff4447 (diff) | |
download | FreeBSD-src-8b1b8ed3cbd6bbfca00c2962853afec4ba1e1839.zip FreeBSD-src-8b1b8ed3cbd6bbfca00c2962853afec4ba1e1839.tar.gz |
Patch the new NFS server in a manner analagous to r228520 for the
old NFS server, so that it correctly handles a count == 0 argument
for Commit.
PR: kern/118126
MFC after: 2 weeks
Diffstat (limited to 'sys/fs/nfsserver')
-rw-r--r-- | sys/fs/nfsserver/nfs_nfsdport.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/sys/fs/nfsserver/nfs_nfsdport.c b/sys/fs/nfsserver/nfs_nfsdport.c index 9fdb569..21b5e48 100644 --- a/sys/fs/nfsserver/nfs_nfsdport.c +++ b/sys/fs/nfsserver/nfs_nfsdport.c @@ -1254,7 +1254,13 @@ nfsvno_fsync(struct vnode *vp, u_int64_t off, int cnt, struct ucred *cred, { int error = 0; - if (cnt > MAX_COMMIT_COUNT) { + /* + * RFC 1813 3.3.21: if count is 0, a flush from offset to the end of + * file is done. At this time VOP_FSYNC does not accept offset and + * byte count parameters so call VOP_FSYNC the whole file for now. + * The same is true for NFSv4: RFC 3530 Sec. 14.2.3. + */ + if (cnt == 0 || cnt > MAX_COMMIT_COUNT) { /* * Give up and do the whole thing */ |