[v4,14/26] nfs_clone_sb_security(): simplify the check for server bogosity
diff mbox series

Message ID 20190913121748.25391-15-smayhew@redhat.com
State New
Headers show
  • nfs: Mount API conversion
Related show

Commit Message

Scott Mayhew Sept. 13, 2019, 12:17 p.m. UTC
From: Al Viro <viro@zeniv.linux.org.uk>

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

Reviewed-by: David Howells <dhowells@redhat.com>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
 fs/nfs/super.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff mbox series

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;