Commit 7e0f9f47 authored by Peng Tao's avatar Peng Tao Committed by Greg Kroah-Hartman

pnfsblock: don't spinlock when freeing block_dev

commit 93a3844e upstream.

bl_free_block_dev() may sleep. We can not call it with spinlock held.
Besides, there is no need to take bm_lock as we are last user freeing bm_devlist.
Signed-off-by: default avatarPeng Tao <peng_tao@emc.com>
Signed-off-by: default avatarBenny Halevy <bhalevy@tonian.com>
Signed-off-by: default avatarTrond Myklebust <Trond.Myklebust@netapp.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent ae648133
......@@ -779,16 +779,13 @@ bl_cleanup_layoutcommit(struct nfs4_layoutcommit_data *lcdata)
static void free_blk_mountid(struct block_mount_id *mid)
{
if (mid) {
struct pnfs_block_dev *dev;
spin_lock(&mid->bm_lock);
while (!list_empty(&mid->bm_devlist)) {
dev = list_first_entry(&mid->bm_devlist,
struct pnfs_block_dev,
bm_node);
struct pnfs_block_dev *dev, *tmp;
/* No need to take bm_lock as we are last user freeing bm_devlist */
list_for_each_entry_safe(dev, tmp, &mid->bm_devlist, bm_node) {
list_del(&dev->bm_node);
bl_free_block_dev(dev);
}
spin_unlock(&mid->bm_lock);
kfree(mid);
}
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment