summaryrefslogtreecommitdiffstats
path: root/sys/nfsserver
diff options
context:
space:
mode:
authordelphij <delphij@FreeBSD.org>2011-12-15 02:26:53 +0000
committerdelphij <delphij@FreeBSD.org>2011-12-15 02:26:53 +0000
commit51d47afd851057c0e847d4c9ceadf0b00685bc20 (patch)
treec317acb0cc0a448cddc48e0acc79cda2388cbb51 /sys/nfsserver
parent4b16f2dc46d161383f7be940faae768f8cb01438 (diff)
downloadFreeBSD-src-51d47afd851057c0e847d4c9ceadf0b00685bc20.zip
FreeBSD-src-51d47afd851057c0e847d4c9ceadf0b00685bc20.tar.gz
Honor NFSv3 commit call (RFC 1813, Section 3.3.21) where when count is 0,
the full length from offset is being flushed. Note that for now VOP_FSYNC does not support offset and length parameters so we still do the same full VOP_FSYNC. This issue was reported at FreeNAS support site as FreeNAS ticket #1096. Submitted by: "ceckerle" <ce.freenas eckerle net> Prodded by: gcooper Reviewed by: rmacklem MFC after: 2 weeks
Diffstat (limited to 'sys/nfsserver')
-rw-r--r--sys/nfsserver/nfs_serv.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/sys/nfsserver/nfs_serv.c b/sys/nfsserver/nfs_serv.c
index 3ee804d..e51c761 100644
--- a/sys/nfsserver/nfs_serv.c
+++ b/sys/nfsserver/nfs_serv.c
@@ -3454,7 +3454,12 @@ nfsrv_commit(struct nfsrv_descript *nfsd, struct nfssvc_sock *slp,
}
for_ret = VOP_GETATTR(vp, &bfor, cred);
- 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.
+ */
+ if (cnt == 0 || cnt > MAX_COMMIT_COUNT) {
/*
* Give up and do the whole thing
*/
OpenPOWER on IntegriCloud