From owner-svn-src-all@FreeBSD.ORG Thu Dec 15 02:26:54 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6F59B1065670; Thu, 15 Dec 2011 02:26:54 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 252D98FC13; Thu, 15 Dec 2011 02:26:54 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pBF2QsKd025118; Thu, 15 Dec 2011 02:26:54 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pBF2QsKW025116; Thu, 15 Dec 2011 02:26:54 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201112150226.pBF2QsKW025116@svn.freebsd.org> From: Xin LI Date: Thu, 15 Dec 2011 02:26:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r228520 - head/sys/nfsserver X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Dec 2011 02:26:54 -0000 Author: delphij Date: Thu Dec 15 02:26:53 2011 New Revision: 228520 URL: http://svn.freebsd.org/changeset/base/228520 Log: 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" Prodded by: gcooper Reviewed by: rmacklem MFC after: 2 weeks Modified: head/sys/nfsserver/nfs_serv.c Modified: head/sys/nfsserver/nfs_serv.c ============================================================================== --- head/sys/nfsserver/nfs_serv.c Thu Dec 15 01:05:38 2011 (r228519) +++ head/sys/nfsserver/nfs_serv.c Thu Dec 15 02:26:53 2011 (r228520) @@ -3454,7 +3454,12 @@ nfsrv_commit(struct nfsrv_descript *nfsd } 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 */