Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp2130746ybc; Wed, 20 Nov 2019 09:20:43 -0800 (PST) X-Google-Smtp-Source: APXvYqxHe0RpUuRtBg+inM3GpKOw0OnhxtEpsAayJjc9OuNmGNzfS/D7TsgO4Xqxp5l3dOaK0SUh X-Received: by 2002:a17:906:751:: with SMTP id z17mr6537123ejb.313.1574270443272; Wed, 20 Nov 2019 09:20:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574270443; cv=none; d=google.com; s=arc-20160816; b=Ow6pfOsY1Z9Kuguc1Q6T7HoRAfeaKvof7J5Xfdca8XZWuHcSZm/lmMvNUM/I+ItPBn F/bGJ2S9YAbiqRD/bggDRNWUmrcZICSU/zjc4tPD8iXdSZxTb0V7crqjGLnY4x4ZGqut U9wNpj4upMMu7K2SXLRncc3xe9GkTJV4udaANu2+xJNHJp/vH++PLucexm4Xd6DqUpaA 7q5AWHXQRuVd7qwxurk6vGtIYMBjIUrFG/61nNiXvm5qpmwbLdS6ktHxHtx6c5T+RdIy K2KZgtRGb3CycTBAkipbyKmKQqCltD6sZRlFHXIa16EbC3YT0cSAbXFc5B/a6wpxewsM pKEQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:references :in-reply-to:message-id:date:subject:cc:to:from:dkim-signature; bh=VfTwEHC91vLf788MahabIL/JjXF4xSOgcRFDg7nd7E0=; b=0ZRSFdeBMiDEg8qnAbOqDYCmDsuuXmMoCSb3j4Nm97vsotZcI4VuZv2xYUirwwB30O SR/VJawD/kOuiCAIZPQQbauGyumfLSwr792JgLuPCzCT22vk3ZSRnNiCQpN6IZ+bGCL4 fv3j5UFOhJbGhkKzyiRApp0zPv7jom89G0ul/4rJ+gOfGohD6FEuzZKprQn52KWmEWH7 vanChZm6obLH2xiHKWP7n1wtaudAD8oGTVyxUWFJDwQBZqBNLuSWJbaAg+p/BwjgZcAL +vTBvV9c2aFhLBNyxx62jVCQNq+CGPcdE8zwl7083odkMaMeveLBglMb6wcDl4hP+PAR b6Yw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=doXJBElN; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (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 ch17si16606764ejb.184.2019.11.20.09.20.18; Wed, 20 Nov 2019 09:20:43 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=doXJBElN; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730435AbfKTP2A (ORCPT + 99 others); Wed, 20 Nov 2019 10:28:00 -0500 Received: from us-smtp-delivery-1.mimecast.com ([207.211.31.120]:26467 "EHLO us-smtp-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1729107AbfKTP14 (ORCPT ); Wed, 20 Nov 2019 10:27:56 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1574263676; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=VfTwEHC91vLf788MahabIL/JjXF4xSOgcRFDg7nd7E0=; b=doXJBElNPqBdtUGabB+lYgvgnwF3VE8YCe6zuHaNhFuHzJ0ip/e7yixG/QU8nAvvtY3pGG Hzyb1ggAf2sSrLskB9SAJ8ToCgXO6ZC4PT92ztioQaE/dwdt8ssqD0N4HmqPbMY0NhVJZJ A+QikLDCOQ1gIjZ66iFEbHGfIPIMzc4= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-89-ZBvrTDm_MMy3MUvfRNLqDw-1; Wed, 20 Nov 2019 10:27:53 -0500 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 405FD18B5F75; Wed, 20 Nov 2019 15:27:52 +0000 (UTC) Received: from coeurl.usersys.redhat.com (ovpn-123-90.rdu2.redhat.com [10.10.123.90]) by smtp.corp.redhat.com (Postfix) with ESMTP id 184CF1037ADA; Wed, 20 Nov 2019 15:27:52 +0000 (UTC) Received: by coeurl.usersys.redhat.com (Postfix, from userid 1000) id 6B2F1209BA; Wed, 20 Nov 2019 10:27:50 -0500 (EST) 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 v5 14/27] nfs_clone_sb_security(): simplify the check for server bogosity Date: Wed, 20 Nov 2019 10:27:37 -0500 Message-Id: <20191120152750.6880-15-smayhew@redhat.com> In-Reply-To: <20191120152750.6880-1-smayhew@redhat.com> References: <20191120152750.6880-1-smayhew@redhat.com> X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-MC-Unique: ZBvrTDm_MMy3MUvfRNLqDw-1 X-Mimecast-Spam-Score: 0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable 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 d8b53fcaa60e..c5fefd9bf6ae 100644 --- a/fs/nfs/super.c +++ b/fs/nfs/super.c @@ -2578,7 +2578,7 @@ int nfs_clone_sb_security(struct super_block *s, stru= ct dentry *mntroot, =09unsigned long kflags =3D 0, kflags_out =3D 0; =20 =09/* clone any lsm security options from the parent to the new sb */ -=09if (d_inode(mntroot)->i_op !=3D NFS_SB(s)->nfs_client->rpc_ops->dir_ino= de_ops) +=09if (d_inode(mntroot)->i_fop !=3D &nfs_dir_operations) =09=09return -ESTALE; =20 =09if (NFS_SB(s)->caps & NFS_CAP_SECURITY_LABEL) --=20 2.17.2