lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [day] [month] [year] [list]
Date:   Fri, 28 Feb 2020 10:14:07 +0000
From:   Zhouyi Zhou <zhouzhouyi@...il.com>
To:     trond.myklebust@...merspace.com, anna.schumaker@...app.com,
        linux-nfs@...r.kernel.org, linux-kernel@...r.kernel.org,
        paulmck@...ux.ibm.com, paulmck@...ux.vnet.ibm.com, neilb@...e.com
Cc:     Zhouyi Zhou <zhouzhouyi@...il.com>
Subject: [PATCH] NFS:remove redundant call to nfs_do_access

Also the rcu_read_lock and rcu_read_unlock is unnessarry because rcu
critical data structure is already protected in 
nfs_access_get_cached_rcu.  

Tested in x86_64 
Signed-off-by: Zhouyi Zhou <zhouzhouyi@...il.com>
---
 fs/nfs/dir.c |    9 +--------
 1 files changed, 1 insertions(+), 8 deletions(-)

diff --git a/fs/nfs/dir.c b/fs/nfs/dir.c
index 193d6fb..37b0c10 100644
--- a/fs/nfs/dir.c
+++ b/fs/nfs/dir.c
@@ -2732,14 +2732,7 @@ int nfs_permission(struct inode *inode, int mask)
 	if (!NFS_PROTO(inode)->access)
 		goto out_notsup;
 
-	/* Always try fast lookups first */
-	rcu_read_lock();
-	res = nfs_do_access(inode, cred, mask|MAY_NOT_BLOCK);
-	rcu_read_unlock();
-	if (res == -ECHILD && !(mask & MAY_NOT_BLOCK)) {
-		/* Fast lookup failed, try the slow way */
-		res = nfs_do_access(inode, cred, mask);
-	}
+	res = nfs_do_access(inode, cred, mask);
 out:
 	if (!res && (mask & MAY_EXEC))
 		res = nfs_execute_ok(inode, mask);
-- 
1.7.1

Powered by blists - more mailing lists