From patchwork Fri Oct 26 21:06:56 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bruce Fields X-Patchwork-Id: 1653911 Return-Path: X-Original-To: patchwork-linux-nfs@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id 815163FD4E for ; Fri, 26 Oct 2012 21:07:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S966529Ab2JZVHB (ORCPT ); Fri, 26 Oct 2012 17:07:01 -0400 Received: from fieldses.org ([174.143.236.118]:34436 "EHLO fieldses.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S966494Ab2JZVG6 (ORCPT ); Fri, 26 Oct 2012 17:06:58 -0400 Received: from bfields by fieldses.org with local (Exim 4.76) (envelope-from ) id 1TRr7J-0005KT-Qk; Fri, 26 Oct 2012 17:06:57 -0400 From: "J. Bruce Fields" To: linux-nfs@vger.kernel.org, linux-fsdevel@vger.kernel.org Cc: Peter Staubach , "J. Bruce Fields" Subject: [PATCH 1/2] nfsd: assume writeable exportabled filesystems have f_sync Date: Fri, 26 Oct 2012 17:06:56 -0400 Message-Id: <1351285617-20450-2-git-send-email-bfields@redhat.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1351285617-20450-1-git-send-email-bfields@redhat.com> References: <1351285617-20450-1-git-send-email-bfields@redhat.com> Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org From: "J. Bruce Fields" I don't really see how you could claim to support nfsd and not support fsync somehow. And in practice a quick look through the exportable filesystems suggests the only ones without an ->fsync are read-only (efs, isofs, squashfs) or in-memory (shmem). Also, performing a write and then returning an error if the sync fails (as we would do here in the wgather case) seems unhelpful to clients. Also remove an incorrect comment. Signed-off-by: J. Bruce Fields --- fs/nfsd/vfs.c | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/fs/nfsd/vfs.c b/fs/nfsd/vfs.c index c120b48..ed3eb59 100644 --- a/fs/nfsd/vfs.c +++ b/fs/nfsd/vfs.c @@ -1020,21 +1020,8 @@ nfsd_vfs_write(struct svc_rqst *rqstp, struct svc_fh *fhp, struct file *file, inode = dentry->d_inode; exp = fhp->fh_export; - /* - * Request sync writes if - * - the sync export option has been set, or - * - the client requested O_SYNC behavior (NFSv3 feature). - * - The file system doesn't support fsync(). - * When NFSv2 gathered writes have been configured for this volume, - * flushing the data to disk is handled separately below. - */ use_wgather = (rqstp->rq_vers == 2) && EX_WGATHER(exp); - if (!file->f_op->fsync) {/* COMMIT3 cannot work */ - stable = 2; - *stablep = 2; /* FILE_SYNC */ - } - if (!EX_ISSYNC(exp)) stable = 0; if (stable && !use_wgather) {