Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 308628
b: refs/heads/master
c: b4a2967
h: refs/heads/master
v: v3
  • Loading branch information
Andy Adamson authored and Trond Myklebust committed May 19, 2012
1 parent dfbbc6e commit 7562eed
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 3a7936c3fc469c196d9163abfea6b7aa9572d443
refs/heads/master: b4a2967e52523dbf0281b52c042f9042c6082f99
1 change: 1 addition & 0 deletions trunk/fs/nfs/nfs4filelayout.c
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,7 @@ static int filelayout_async_handle_error(struct rpc_task *task,
_pnfs_return_layout(state->inode);
filelayout_mark_devid_invalid(devid);
rpc_wake_up(&tbl->slot_tbl_waitq);
nfs4_ds_disconnect(clp);
/* fall through */
default:
dprintk("%s Retry through MDS. Error %d\n", __func__,
Expand Down
1 change: 1 addition & 0 deletions trunk/fs/nfs/nfs4filelayout.h
Original file line number Diff line number Diff line change
Expand Up @@ -146,5 +146,6 @@ extern void nfs4_fl_put_deviceid(struct nfs4_file_layout_dsaddr *dsaddr);
extern void nfs4_fl_free_deviceid(struct nfs4_file_layout_dsaddr *dsaddr);
struct nfs4_file_layout_dsaddr *
get_device_info(struct inode *inode, struct nfs4_deviceid *dev_id, gfp_t gfp_flags);
void nfs4_ds_disconnect(struct nfs_client *clp);

#endif /* FS_NFS_NFS4FILELAYOUT_H */
22 changes: 22 additions & 0 deletions trunk/fs/nfs/nfs4filelayoutdev.c
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,28 @@ _data_server_lookup_locked(const struct list_head *dsaddrs)
return NULL;
}

/*
* Lookup DS by nfs_client pointer. Zero data server client pointer
*/
void nfs4_ds_disconnect(struct nfs_client *clp)
{
struct nfs4_pnfs_ds *ds;
struct nfs_client *found = NULL;

dprintk("%s clp %p\n", __func__, clp);
spin_lock(&nfs4_ds_cache_lock);
list_for_each_entry(ds, &nfs4_data_server_cache, ds_node)
if (ds->ds_clp && ds->ds_clp == clp) {
found = ds->ds_clp;
ds->ds_clp = NULL;
}
spin_unlock(&nfs4_ds_cache_lock);
if (found) {
set_bit(NFS_CS_STOP_RENEW, &clp->cl_res_state);
nfs_put_client(clp);
}
}

/*
* Create an rpc connection to the nfs4_pnfs_ds data server
* Currently only supports IPv4 and IPv6 addresses
Expand Down

0 comments on commit 7562eed

Please sign in to comment.