From patchwork Mon Sep 12 11:16:08 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Gruenbacher X-Patchwork-Id: 9326197 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 056836089F for ; Mon, 12 Sep 2016 11:16:17 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EBDF828D06 for ; Mon, 12 Sep 2016 11:16:16 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E0A0628D15; Mon, 12 Sep 2016 11:16:16 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9688828D13 for ; Mon, 12 Sep 2016 11:16:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753374AbcILLQN (ORCPT ); Mon, 12 Sep 2016 07:16:13 -0400 Received: from mx1.redhat.com ([209.132.183.28]:46148 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751955AbcILLQN (ORCPT ); Mon, 12 Sep 2016 07:16:13 -0400 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 02CB9B98C7; Mon, 12 Sep 2016 11:16:11 +0000 (UTC) Received: from nux.redhat.com (vpn1-4-189.ams2.redhat.com [10.36.4.189]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u8CBG9Hg021833; Mon, 12 Sep 2016 07:16:10 -0400 From: Andreas Gruenbacher To: Trond Myklebust , Anna Schumaker Cc: Andreas Gruenbacher , linux-nfs@vger.kernel.org Subject: [PATCH] nfs: Set s_time_gran consistently on NFSv2 Date: Mon, 12 Sep 2016 13:16:08 +0200 Message-Id: <1473678968-13124-1-git-send-email-agruenba@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.24 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Mon, 12 Sep 2016 11:16:12 +0000 (UTC) Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Hi Trond and Anna, is it true that nfs_clone_super accidentally sets s_time_gran to 1 on NFSv2? If so, could you please merge the following patch? Thanks, Andreas Signed-off-by: Andreas Gruenbacher --- fs/nfs/super.c | 25 +++++++++---------------- 1 file changed, 9 insertions(+), 16 deletions(-) diff --git a/fs/nfs/super.c b/fs/nfs/super.c index d396013..4c72fec 100644 --- a/fs/nfs/super.c +++ b/fs/nfs/super.c @@ -2312,6 +2312,15 @@ inline void nfs_initialise_sb(struct super_block *sb) { struct nfs_server *server = NFS_SB(sb); + if (server->nfs_client->rpc_ops->version != 2) { + sb->s_time_gran = 1; + /* + * The VFS shouldn't apply the umask to mode bits. We will do + * so ourselves when necessary. + */ + sb->s_flags |= MS_POSIXACL; + } + sb->s_magic = NFS_SUPER_MAGIC; /* We probably want something more informative here */ @@ -2342,14 +2351,6 @@ void nfs_fill_super(struct super_block *sb, struct nfs_mount_info *mount_info) if (data && data->bsize) sb->s_blocksize = nfs_block_size(data->bsize, &sb->s_blocksize_bits); - if (server->nfs_client->rpc_ops->version != 2) { - /* The VFS shouldn't apply the umask to mode bits. We will do - * so ourselves when necessary. - */ - sb->s_flags |= MS_POSIXACL; - sb->s_time_gran = 1; - } - nfs_initialise_sb(sb); } EXPORT_SYMBOL_GPL(nfs_fill_super); @@ -2367,14 +2368,6 @@ void nfs_clone_super(struct super_block *sb, struct nfs_mount_info *mount_info) sb->s_maxbytes = old_sb->s_maxbytes; sb->s_xattr = old_sb->s_xattr; sb->s_op = old_sb->s_op; - sb->s_time_gran = 1; - - if (server->nfs_client->rpc_ops->version != 2) { - /* The VFS shouldn't apply the umask to mode bits. We will do - * so ourselves when necessary. - */ - sb->s_flags |= MS_POSIXACL; - } nfs_initialise_sb(sb); }