From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.0 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7B6B8C5ACAE for ; Wed, 11 Sep 2019 16:17:54 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 5C22920863 for ; Wed, 11 Sep 2019 16:17:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729360AbfIKQRx (ORCPT ); Wed, 11 Sep 2019 12:17:53 -0400 Received: from mx1.redhat.com ([209.132.183.28]:34880 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729002AbfIKQQX (ORCPT ); Wed, 11 Sep 2019 12:16:23 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 56C6059451; Wed, 11 Sep 2019 16:16:23 +0000 (UTC) Received: from coeurl.usersys.redhat.com (ovpn-122-52.rdu2.redhat.com [10.10.122.52]) by smtp.corp.redhat.com (Postfix) with ESMTP id 37940601A5; Wed, 11 Sep 2019 16:16:23 +0000 (UTC) Received: by coeurl.usersys.redhat.com (Postfix, from userid 1000) id 4A47520D2E; Wed, 11 Sep 2019 12:16:22 -0400 (EDT) From: Scott Mayhew To: anna.schumaker@netapp.com, trond.myklebust@hammerspace.com Cc: dhowells@redhat.com, viro@zeniv.linux.org.uk, linux-nfs@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v3 14/26] nfs_clone_sb_security(): simplify the check for server bogosity Date: Wed, 11 Sep 2019 12:16:09 -0400 Message-Id: <20190911161621.19832-15-smayhew@redhat.com> In-Reply-To: <20190911161621.19832-1-smayhew@redhat.com> References: <20190911161621.19832-1-smayhew@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Wed, 11 Sep 2019 16:16:23 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Al Viro We used to check ->i_op for being nfs_dir_inode_operations. With separate inode_operations for v3 and v4 that became bogus, but rather than going for protocol-dependent comparison we could've just checked ->i_fop instead; _that_ is the same for all protocol versions. Reviewed-by: David Howells Signed-off-by: Al Viro --- fs/nfs/super.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/nfs/super.c b/fs/nfs/super.c index 89751ce21110..6f4983fc3937 100644 --- a/fs/nfs/super.c +++ b/fs/nfs/super.c @@ -2569,7 +2569,7 @@ int nfs_clone_sb_security(struct super_block *s, struct dentry *mntroot, unsigned long kflags = 0, kflags_out = 0; /* clone any lsm security options from the parent to the new sb */ - if (d_inode(mntroot)->i_op != NFS_SB(s)->nfs_client->rpc_ops->dir_inode_ops) + if (d_inode(mntroot)->i_fop != &nfs_dir_operations) return -ESTALE; if (NFS_SB(s)->caps & NFS_CAP_SECURITY_LABEL) -- 2.17.2