diff mbox

SQUASHME: pnfs: move synchronize_rcu out side of spin_lock

Message ID 1290015704-6221-1-git-send-email-bhalevy@panasas.com (mailing list archive)
State RFC, archived
Headers show

Commit Message

Benny Halevy Nov. 17, 2010, 5:41 p.m. UTC
None
diff mbox

Patch

diff --git a/fs/nfs/pnfs.c b/fs/nfs/pnfs.c
index 559fcce..39c7d9f 100644
--- a/fs/nfs/pnfs.c
+++ b/fs/nfs/pnfs.c
@@ -1651,7 +1651,6 @@  pnfs_unhash_deviceid(struct pnfs_deviceid_cache *c,
 	hlist_for_each_entry_rcu(d, n, &c->dc_deviceids[h], de_node)
 		if (!memcmp(&d->de_id, id, sizeof(*id))) {
 			hlist_del_rcu(&d->de_node);
-			synchronize_rcu();
 			return d;
 		}
 
@@ -1672,7 +1671,7 @@  pnfs_put_deviceid(struct pnfs_deviceid_cache *c,
 
 	pnfs_unhash_deviceid(c, &devid->de_id);
 	spin_unlock(&c->dc_lock);
-
+	synchronize_rcu();
 	c->dc_free_callback(devid);
 }
 EXPORT_SYMBOL_GPL(pnfs_put_deviceid);
@@ -1686,7 +1685,7 @@  pnfs_delete_deviceid(struct pnfs_deviceid_cache *c,
 	spin_lock(&c->dc_lock);
 	devid = pnfs_unhash_deviceid(c, id);
 	spin_unlock(&c->dc_lock);
-
+	synchronize_rcu();
 	dprintk("%s [%d]\n", __func__, atomic_read(&devid->de_ref));
 	if (atomic_dec_and_test(&devid->de_ref))
 		c->dc_free_callback(devid);