Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp1098519ybe; Wed, 11 Sep 2019 09:20:06 -0700 (PDT) X-Google-Smtp-Source: APXvYqwhE87AWcV30gTuIWJz7X7UzIozldymP3uo8Ifp74YImqt1ttsUyKkQcdD2IcCLFefE1n+u X-Received: by 2002:a17:906:81d9:: with SMTP id e25mr30424528ejx.37.1568218806370; Wed, 11 Sep 2019 09:20:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568218806; cv=none; d=google.com; s=arc-20160816; b=Thf5qMI3vZu4FqddfBL+sUdL106A6zW3cJ8u/5o0LZsVkL/SiBSJZJRd7gIgYnavAL 5dzFCDagdtCAaKppoI1VmicCOHh7aPJ/+cJaeP2CXdmcoHJNcxrzqF0kyMyrAeZboxxC 0rzd5AbDbYqDUoF0/a/EtpQecBcwUwT4MXxK9mKwBGfa/sWpFRMcTyCgAYZf0rMR66yS XBQho2zr/UscxUdQpZg39146vw0V0I7RBAv5UjdicsHZoU9IqalFUsRtaCX5CnV1YtQL 9yYkgyDFoSHJ3ohiva/BB7YSJKuCSn/1h0N9ZA1j/+E74m3aR+oryniF/n8F0sfAPBx9 L5Qg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from; bh=NJjkJEEWe0aa24iASl/3EZrtIy1D1CxV7qTmSe4Qw1o=; b=ik3vjmfAICXidasllsh99mOm02/JprSf8Q7rgiF7DHhygvmV0iUfjZYGqqidkQlyO/ 3a7/Agi4u56l3FylxD7VH96CUVxen+JoqbSHI8Zzjj8WlaFV9Sw4VQuwKsya+AP5flcK xC8h8D8qClrLCK0Zy2NHLna1K1JQjdRHhx98bLbkeErJKU1kTW0ZFrKarPUxvMFpFDmz fgp3Rf+Dm3LVL0LUWru86vaYbyBszJxPPCk8nC1MmJLjud99G7ckWEd+axf7J2pVrKpC M2MN0tle3HjPjF2gOxemkkvWxUn6+Qg08MrU9iFKshm0s8daaORbC4yePWW/0NTKZi+m G65A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-nfs-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t6si11455621ejr.238.2019.09.11.09.19.41; Wed, 11 Sep 2019 09:20:06 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-nfs-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-nfs-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729335AbfIKQRq (ORCPT + 99 others); Wed, 11 Sep 2019 12:17:46 -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-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@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