Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933665Ab1D2S64 (ORCPT ); Fri, 29 Apr 2011 14:58:56 -0400 Received: from kroah.org ([198.145.64.141]:35096 "EHLO coco.kroah.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933377Ab1D2S6p (ORCPT ); Fri, 29 Apr 2011 14:58:45 -0400 X-Mailbox-Line: From gregkh@clark.kroah.org Fri Apr 29 11:56:57 2011 Message-Id: <20110429185656.925958215@clark.kroah.org> User-Agent: quilt/0.48-16.4 Date: Fri, 29 Apr 2011 11:56:08 -0700 From: Greg KH To: linux-kernel@vger.kernel.org, stable@kernel.org Cc: stable-review@kernel.org, torvalds@linux-foundation.org, akpm@linux-foundation.org, alan@lxorguk.ukuu.org.uk, Jeff Layton , Trond Myklebust Subject: [45/55] nfs: dont lose MS_SYNCHRONOUS on remount of noac mount In-Reply-To: <20110429185706.GA12824@kroah.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1628 Lines: 50 2.6.38-stable review patch. If anyone has any objections, please let us know. ------------------ From: Jeff Layton commit 26c4c170731f00008f4317a2888a0a07ac99d90d upstream. On a remount, the VFS layer will clear the MS_SYNCHRONOUS bit on the assumption that the flags on the mount syscall will have it set if the remounted fs is supposed to keep it. In the case of "noac" though, MS_SYNCHRONOUS is implied. A remount of such a mount will lose the MS_SYNCHRONOUS flag since "sync" isn't part of the mount options. Reported-by: Max Matveev Signed-off-by: Jeff Layton Signed-off-by: Trond Myklebust Signed-off-by: Greg Kroah-Hartman --- fs/nfs/super.c | 9 +++++++++ 1 file changed, 9 insertions(+) --- a/fs/nfs/super.c +++ b/fs/nfs/super.c @@ -2077,6 +2077,15 @@ nfs_remount(struct super_block *sb, int if (error < 0) goto out; + /* + * noac is a special case. It implies -o sync, but that's not + * necessarily reflected in the mtab options. do_remount_sb + * will clear MS_SYNCHRONOUS if -o sync wasn't specified in the + * remount options, so we have to explicitly reset it. + */ + if (data->flags & NFS_MOUNT_NOAC) + *flags |= MS_SYNCHRONOUS; + /* compare new mount options with old ones */ error = nfs_compare_remount_data(nfss, data); out: -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/