Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp723448ybe; Fri, 13 Sep 2019 05:21:09 -0700 (PDT) X-Google-Smtp-Source: APXvYqy7Xz1yDmeZpA6Op/aSHe3B8cBqyZOXS7nfGN5r2LZUyYW/+SMEgdT6djCq19UiS5hMCuky X-Received: by 2002:aa7:d696:: with SMTP id d22mr47209567edr.135.1568377268977; Fri, 13 Sep 2019 05:21:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568377268; cv=none; d=google.com; s=arc-20160816; b=W2B26l3GK5F/Zw5KPeSbOUiSvOI1Gjvff9Ycoba/XuwFgZrP4HVQ6Y6w4jVJNUr+w4 aMeVNHpeZyeULFGEP1P4iSkUAHedox1pVAdw7XX3LljFKAGzLPc+2D9aWaX+HHw0IoMH fe0SrJkIUEq6cOSzpquFO9+LvwWW0lnlIlYXQyeEEo944qMor6LtMQw7xF+ToQ3L0XEJ UCHEsRWSohx+UcO16xfkYot+NNB/Zkh24//jd5o4iqToVTFow+eeC8WnHLB65I6SaFrO yEdzaGlRWw2K6+kJu/7ykBw7EUZf2Ue0VvZ0EGQQ/Xv7JL29NhiPaNhsoUJoHlRVrfQ3 ew7w== 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=n1mTemhZkwzGYOTE5pdMtILZAlXiePeFSuRlHXHyVbbNqKJuLtPdJ2/iA6oMOreYCz oifN4ZjKQY6CRE1LpODCwkeL7JgGwPDSyUQOwL2b1vU4RmaHZQI25FweARixfOXiDDyr wjp1WiX1IXrRzkKx/SMp54A1YGHHcUgzq4oxhWdi99B39tT7+WvjIckilH/ifcPTJNGS zCydmO2a6SBO2mQqS6MRzKPhS9Lv84fcp7YjUtlqg9ird7SG4Wc40VhPvnGQtY8Y5B+/ MsPfLes5kER4Cq9zatdTx1fQ+9ReiiCp6JYjocE+e8EdBb/IQKg+74UjeaSw9qYPH7Gf Rj8w== 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 n18si14433207ejs.332.2019.09.13.05.20.44; Fri, 13 Sep 2019 05:21:08 -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 S2388293AbfIMMT2 (ORCPT + 99 others); Fri, 13 Sep 2019 08:19:28 -0400 Received: from mx1.redhat.com ([209.132.183.28]:33032 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729632AbfIMMRu (ORCPT ); Fri, 13 Sep 2019 08:17:50 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 2CED211A24; Fri, 13 Sep 2019 12:17:50 +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 0D90B60C44; Fri, 13 Sep 2019 12:17:50 +0000 (UTC) Received: by coeurl.usersys.redhat.com (Postfix, from userid 1000) id E445F20D2E; Fri, 13 Sep 2019 08:17:48 -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 v4 14/26] nfs_clone_sb_security(): simplify the check for server bogosity Date: Fri, 13 Sep 2019 08:17:36 -0400 Message-Id: <20190913121748.25391-15-smayhew@redhat.com> In-Reply-To: <20190913121748.25391-1-smayhew@redhat.com> References: <20190913121748.25391-1-smayhew@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Fri, 13 Sep 2019 12:17:50 +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