summaryrefslogtreecommitdiffstats
path: root/fs/nfs/pnfs_dev.c
diff options
context:
space:
mode:
authorTrond Myklebust2011-06-14 18:07:38 +0200
committerTrond Myklebust2011-06-15 17:24:29 +0200
commit1d92a08da23848a38eece4df7eaa4e8ec0e6c699 (patch)
tree17da4ebe1aba9da32990a7fa5bbe3f2ff6f60941 /fs/nfs/pnfs_dev.c
parentNFSv4.1: deprecate headerpadsz in CREATE_SESSION (diff)
downloadkernel-qcow2-linux-1d92a08da23848a38eece4df7eaa4e8ec0e6c699.tar.gz
kernel-qcow2-linux-1d92a08da23848a38eece4df7eaa4e8ec0e6c699.tar.xz
kernel-qcow2-linux-1d92a08da23848a38eece4df7eaa4e8ec0e6c699.zip
NFSv4.1: Fix a refcounting issue in the pNFS device id cache
When we add something to the global device id cache, we need to bump the reference count, so that the cache itself holds a reference. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs/nfs/pnfs_dev.c')
-rw-r--r--fs/nfs/pnfs_dev.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/fs/nfs/pnfs_dev.c b/fs/nfs/pnfs_dev.c
index 5944d4b369a2..f0f8e1e22f6c 100644
--- a/fs/nfs/pnfs_dev.c
+++ b/fs/nfs/pnfs_dev.c
@@ -209,6 +209,7 @@ nfs4_insert_deviceid_node(struct nfs4_deviceid_node *new)
hlist_add_head_rcu(&new->node, &nfs4_deviceid_cache[hash]);
spin_unlock(&nfs4_deviceid_lock);
+ atomic_inc(&new->ref);
return new;
}