diff options
| -rw-r--r-- | fs/nfs/client.c | 1 | ||||
| -rw-r--r-- | fs/nfs/pnfs.c | 5 | ||||
| -rw-r--r-- | include/linux/nfs_fs_sb.h | 1 |
3 files changed, 6 insertions, 1 deletions
diff --git a/fs/nfs/client.c b/fs/nfs/client.c index 17ba6b995659..f005b5bebdc7 100644 --- a/fs/nfs/client.c +++ b/fs/nfs/client.c | |||
| @@ -207,7 +207,6 @@ error_0: | |||
| 207 | static void nfs4_shutdown_session(struct nfs_client *clp) | 207 | static void nfs4_shutdown_session(struct nfs_client *clp) |
| 208 | { | 208 | { |
| 209 | if (nfs4_has_session(clp)) { | 209 | if (nfs4_has_session(clp)) { |
| 210 | nfs4_deviceid_purge_client(clp); | ||
| 211 | nfs4_destroy_session(clp->cl_session); | 210 | nfs4_destroy_session(clp->cl_session); |
| 212 | nfs4_destroy_clientid(clp); | 211 | nfs4_destroy_clientid(clp); |
| 213 | } | 212 | } |
diff --git a/fs/nfs/pnfs.c b/fs/nfs/pnfs.c index b8323aa7b543..bdf7e52943c8 100644 --- a/fs/nfs/pnfs.c +++ b/fs/nfs/pnfs.c | |||
| @@ -80,6 +80,9 @@ unset_pnfs_layoutdriver(struct nfs_server *nfss) | |||
| 80 | if (nfss->pnfs_curr_ld) { | 80 | if (nfss->pnfs_curr_ld) { |
| 81 | if (nfss->pnfs_curr_ld->clear_layoutdriver) | 81 | if (nfss->pnfs_curr_ld->clear_layoutdriver) |
| 82 | nfss->pnfs_curr_ld->clear_layoutdriver(nfss); | 82 | nfss->pnfs_curr_ld->clear_layoutdriver(nfss); |
| 83 | /* Decrement the MDS count. Purge the deviceid cache if zero */ | ||
| 84 | if (atomic_dec_and_test(&nfss->nfs_client->cl_mds_count)) | ||
| 85 | nfs4_deviceid_purge_client(nfss->nfs_client); | ||
| 83 | module_put(nfss->pnfs_curr_ld->owner); | 86 | module_put(nfss->pnfs_curr_ld->owner); |
| 84 | } | 87 | } |
| 85 | nfss->pnfs_curr_ld = NULL; | 88 | nfss->pnfs_curr_ld = NULL; |
| @@ -127,6 +130,8 @@ set_pnfs_layoutdriver(struct nfs_server *server, const struct nfs_fh *mntfh, | |||
| 127 | module_put(ld_type->owner); | 130 | module_put(ld_type->owner); |
| 128 | goto out_no_driver; | 131 | goto out_no_driver; |
| 129 | } | 132 | } |
| 133 | /* Bump the MDS count */ | ||
| 134 | atomic_inc(&server->nfs_client->cl_mds_count); | ||
| 130 | 135 | ||
| 131 | dprintk("%s: pNFS module for %u set\n", __func__, id); | 136 | dprintk("%s: pNFS module for %u set\n", __func__, id); |
| 132 | return; | 137 | return; |
diff --git a/include/linux/nfs_fs_sb.h b/include/linux/nfs_fs_sb.h index fbb78fb09bd2..f58325a1d8fb 100644 --- a/include/linux/nfs_fs_sb.h +++ b/include/linux/nfs_fs_sb.h | |||
| @@ -25,6 +25,7 @@ struct nfs41_impl_id; | |||
| 25 | */ | 25 | */ |
| 26 | struct nfs_client { | 26 | struct nfs_client { |
| 27 | atomic_t cl_count; | 27 | atomic_t cl_count; |
| 28 | atomic_t cl_mds_count; | ||
| 28 | int cl_cons_state; /* current construction state (-ve: init error) */ | 29 | int cl_cons_state; /* current construction state (-ve: init error) */ |
| 29 | #define NFS_CS_READY 0 /* ready to be used */ | 30 | #define NFS_CS_READY 0 /* ready to be used */ |
| 30 | #define NFS_CS_INITING 1 /* busy initialising */ | 31 | #define NFS_CS_INITING 1 /* busy initialising */ |
