mirror of https://gitee.com/openkylin/linux.git
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>
This commit is contained in:
parent
c9c30dd5f7
commit
1d92a08da2
|
@ -209,6 +209,7 @@ nfs4_insert_deviceid_node(struct nfs4_deviceid_node *new)
|
||||||
|
|
||||||
hlist_add_head_rcu(&new->node, &nfs4_deviceid_cache[hash]);
|
hlist_add_head_rcu(&new->node, &nfs4_deviceid_cache[hash]);
|
||||||
spin_unlock(&nfs4_deviceid_lock);
|
spin_unlock(&nfs4_deviceid_lock);
|
||||||
|
atomic_inc(&new->ref);
|
||||||
|
|
||||||
return new;
|
return new;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue