diff options
author | Trond Myklebust <Trond.Myklebust@netapp.com> | 2010-08-04 09:29:52 -0400 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2010-08-06 13:41:39 -0400 |
commit | 761fe93cdfa29071879d882c92e966ae692c0048 (patch) | |
tree | 7d4e3cbf0d17703bb3457f9a2c2cceb930e0f59d | |
parent | 0d8a374673c9bc62bc78a2d8fe64553a51542cb4 (diff) |
NFS: Fix the locking in nfs4_callback_getattr
The delegation is protected by RCU now, so we need to replace the
nfsi->rwsem protection with an rcu protected section.
Reported-by: Fred Isaman <iisaman@netapp.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
-rw-r--r-- | fs/nfs/callback_proc.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/fs/nfs/callback_proc.c b/fs/nfs/callback_proc.c index 7445dd0ae3f3..930d10fecdaf 100644 --- a/fs/nfs/callback_proc.c +++ b/fs/nfs/callback_proc.c | |||
@@ -37,8 +37,8 @@ __be32 nfs4_callback_getattr(struct cb_getattrargs *args, struct cb_getattrres * | |||
37 | if (inode == NULL) | 37 | if (inode == NULL) |
38 | goto out_putclient; | 38 | goto out_putclient; |
39 | nfsi = NFS_I(inode); | 39 | nfsi = NFS_I(inode); |
40 | down_read(&nfsi->rwsem); | 40 | rcu_read_lock(); |
41 | delegation = nfsi->delegation; | 41 | delegation = rcu_dereference(nfsi->delegation); |
42 | if (delegation == NULL || (delegation->type & FMODE_WRITE) == 0) | 42 | if (delegation == NULL || (delegation->type & FMODE_WRITE) == 0) |
43 | goto out_iput; | 43 | goto out_iput; |
44 | res->size = i_size_read(inode); | 44 | res->size = i_size_read(inode); |
@@ -53,7 +53,7 @@ __be32 nfs4_callback_getattr(struct cb_getattrargs *args, struct cb_getattrres * | |||
53 | args->bitmap[1]; | 53 | args->bitmap[1]; |
54 | res->status = 0; | 54 | res->status = 0; |
55 | out_iput: | 55 | out_iput: |
56 | up_read(&nfsi->rwsem); | 56 | rcu_read_unlock(); |
57 | iput(inode); | 57 | iput(inode); |
58 | out_putclient: | 58 | out_putclient: |
59 | nfs_put_client(clp); | 59 | nfs_put_client(clp); |