Skip to content

Commit bba67e0

Browse files
Trond MyklebustTrond Myklebust
authored andcommitted
NFS: Remove BKL usage from open()
All the NFSv4 stateful operations are already protected by other locks (in particular by the rpc_sequence locks. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
1 parent b6a2e56 commit bba67e0

File tree

3 files changed

+0
-10
lines changed

3 files changed

+0
-10
lines changed

fs/nfs/dir.c

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -139,10 +139,8 @@ nfs_opendir(struct inode *inode, struct file *filp)
139139

140140
nfs_inc_stats(inode, NFSIOS_VFSOPEN);
141141

142-
lock_kernel();
143142
/* Call generic open code in order to cache credentials */
144143
res = nfs_open(inode, filp);
145-
unlock_kernel();
146144
return res;
147145
}
148146

@@ -1019,9 +1017,7 @@ static struct dentry *nfs_atomic_lookup(struct inode *dir, struct dentry *dentry
10191017
}
10201018

10211019
/* Open the file on the server */
1022-
lock_kernel();
10231020
res = nfs4_atomic_open(dir, dentry, nd);
1024-
unlock_kernel();
10251021
if (IS_ERR(res)) {
10261022
error = PTR_ERR(res);
10271023
switch (error) {
@@ -1083,9 +1079,7 @@ static int nfs_open_revalidate(struct dentry *dentry, struct nameidata *nd)
10831079
* operations that change the directory. We therefore save the
10841080
* change attribute *before* we do the RPC call.
10851081
*/
1086-
lock_kernel();
10871082
ret = nfs4_open_revalidate(dir, dentry, openflags, nd);
1088-
unlock_kernel();
10891083
out:
10901084
dput(parent);
10911085
if (!ret)

fs/nfs/file.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,9 +128,7 @@ nfs_file_open(struct inode *inode, struct file *filp)
128128
return res;
129129

130130
nfs_inc_stats(inode, NFSIOS_VFSOPEN);
131-
lock_kernel();
132131
res = nfs_open(inode, filp);
133-
unlock_kernel();
134132
return res;
135133
}
136134

fs/nfs/nfs4proc.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -451,9 +451,7 @@ static struct nfs4_state *nfs4_try_open_cached(struct nfs4_opendata *opendata)
451451
/* Save the delegation */
452452
memcpy(stateid.data, delegation->stateid.data, sizeof(stateid.data));
453453
rcu_read_unlock();
454-
lock_kernel();
455454
ret = nfs_may_open(state->inode, state->owner->so_cred, open_mode);
456-
unlock_kernel();
457455
if (ret != 0)
458456
goto out;
459457
ret = -EAGAIN;

0 commit comments

Comments
 (0)