From owner-svn-src-stable-9@FreeBSD.ORG Sun Jan 8 23:05:36 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AC8B01065673; Sun, 8 Jan 2012 23:05:36 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 963AF8FC0A; Sun, 8 Jan 2012 23:05:36 +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 q08N5atq011697; Sun, 8 Jan 2012 23:05:36 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q08N5amw011695; Sun, 8 Jan 2012 23:05:36 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201201082305.q08N5amw011695@svn.freebsd.org> From: Rick Macklem Date: Sun, 8 Jan 2012 23:05:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r229827 - stable/9/sys/fs/nfsserver X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Jan 2012 23:05:36 -0000 Author: rmacklem Date: Sun Jan 8 23:05:36 2012 New Revision: 229827 URL: http://svn.freebsd.org/changeset/base/229827 Log: MFC: r228560 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. Modified: stable/9/sys/fs/nfsserver/nfs_nfsdport.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/amd64/include/xen/ (props changed) stable/9/sys/boot/ (props changed) stable/9/sys/boot/i386/efi/ (props changed) stable/9/sys/boot/ia64/efi/ (props changed) stable/9/sys/boot/ia64/ski/ (props changed) stable/9/sys/boot/powerpc/boot1.chrp/ (props changed) stable/9/sys/boot/powerpc/ofw/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/contrib/dev/acpica/ (props changed) stable/9/sys/contrib/octeon-sdk/ (props changed) stable/9/sys/contrib/pf/ (props changed) stable/9/sys/contrib/x86emu/ (props changed) Modified: stable/9/sys/fs/nfsserver/nfs_nfsdport.c ============================================================================== --- stable/9/sys/fs/nfsserver/nfs_nfsdport.c Sun Jan 8 22:23:19 2012 (r229826) +++ stable/9/sys/fs/nfsserver/nfs_nfsdport.c Sun Jan 8 23:05:36 2012 (r229827) @@ -1254,7 +1254,13 @@ nfsvno_fsync(struct vnode *vp, u_int64_t { 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 */