[PATCH 14/14] SQUASHME pnfs_submit: remove kfree from under spinlock

andros
2010-04-08T19:54:59Z

fs/nfs/nfs4filelayoutdev.c | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/fs/nfs/nfs4filelayoutdev.c b/fs/nfs/nfs4filelayoutdev.c
index 50e2865..5c13dc5 100644
--- a/fs/nfs/nfs4filelayoutdev.c
+++ b/fs/nfs/nfs4filelayoutdev.c
@@ -410,9 +410,7 @@ nfs4_pnfs_ds_add(struct inode *inode, struct nfs4_pnfs_ds **dsp,
ds->ds_ip_addr);
list_add(&ds->ds_node, &nfs4_data_server_cache);
*dsp = ds;
- }
- if (tmp_ds != NULL) {
- destroy_ds(ds);
+ } else {
atomic_inc(&tmp_ds->ds_count);
dprintk("%s data server found ip 0x%x, inc'ed ds_count to %d\n",
__func__, tmp_ds->ds_ip_addr,
@@ -420,6 +418,8 @@ nfs4_pnfs_ds_add(struct inode *inode, struct nfs4_pnfs_ds **dsp,
*dsp = tmp_ds;
}
spin_unlock(&nfs4_ds_cache_lock);
+ if (tmp_ds != NULL)
+ destroy_ds(ds);
}

static struct nfs4_pnfs_ds *
--
1.6.6