diff options
author | Trond Myklebust <Trond.Myklebust@netapp.com> | 2012-10-11 12:26:04 -0400 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2012-10-15 10:49:42 -0400 |
commit | 8fcdc31b3d09bc348ff9bf752ae1291828756cfa (patch) | |
tree | d56ebacf4dd7290a60555756882178f8541603d0 /fs | |
parent | ddffeb8c4d0331609ef2581d84de4d763607bd37 (diff) |
NFSv4.1: Kill nfs4_ds_disconnect()
There is nothing to prevent another thread from dereferencing ds->ds_clp
during or after the call to nfs4_ds_disconnect(), and Oopsing due to the
resulting NULL pointer.
Instead, we should just rely on filelayout_mark_devid_invalid() to keep
us out of trouble by avoiding that deviceid.
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/nfs/nfs4filelayout.c | 1 | ||||
-rw-r--r-- | fs/nfs/nfs4filelayout.h | 1 | ||||
-rw-r--r-- | fs/nfs/nfs4filelayoutdev.c | 22 |
3 files changed, 0 insertions, 24 deletions
diff --git a/fs/nfs/nfs4filelayout.c b/fs/nfs/nfs4filelayout.c index 52d847212066..816c2d0d133a 100644 --- a/fs/nfs/nfs4filelayout.c +++ b/fs/nfs/nfs4filelayout.c | |||
@@ -207,7 +207,6 @@ static int filelayout_async_handle_error(struct rpc_task *task, | |||
207 | clear_bit(NFS_INO_LAYOUTCOMMIT, &NFS_I(inode)->flags); | 207 | clear_bit(NFS_INO_LAYOUTCOMMIT, &NFS_I(inode)->flags); |
208 | _pnfs_return_layout(inode); | 208 | _pnfs_return_layout(inode); |
209 | rpc_wake_up(&tbl->slot_tbl_waitq); | 209 | rpc_wake_up(&tbl->slot_tbl_waitq); |
210 | nfs4_ds_disconnect(clp); | ||
211 | /* fall through */ | 210 | /* fall through */ |
212 | default: | 211 | default: |
213 | reset: | 212 | reset: |
diff --git a/fs/nfs/nfs4filelayout.h b/fs/nfs/nfs4filelayout.h index dca47d786710..8c07241fe52b 100644 --- a/fs/nfs/nfs4filelayout.h +++ b/fs/nfs/nfs4filelayout.h | |||
@@ -149,6 +149,5 @@ extern void nfs4_fl_put_deviceid(struct nfs4_file_layout_dsaddr *dsaddr); | |||
149 | extern void nfs4_fl_free_deviceid(struct nfs4_file_layout_dsaddr *dsaddr); | 149 | extern void nfs4_fl_free_deviceid(struct nfs4_file_layout_dsaddr *dsaddr); |
150 | struct nfs4_file_layout_dsaddr * | 150 | struct nfs4_file_layout_dsaddr * |
151 | filelayout_get_device_info(struct inode *inode, struct nfs4_deviceid *dev_id, gfp_t gfp_flags); | 151 | filelayout_get_device_info(struct inode *inode, struct nfs4_deviceid *dev_id, gfp_t gfp_flags); |
152 | void nfs4_ds_disconnect(struct nfs_client *clp); | ||
153 | 152 | ||
154 | #endif /* FS_NFS_NFS4FILELAYOUT_H */ | 153 | #endif /* FS_NFS_NFS4FILELAYOUT_H */ |
diff --git a/fs/nfs/nfs4filelayoutdev.c b/fs/nfs/nfs4filelayoutdev.c index 3336d5eaf879..a8eaa9b7bb0f 100644 --- a/fs/nfs/nfs4filelayoutdev.c +++ b/fs/nfs/nfs4filelayoutdev.c | |||
@@ -149,28 +149,6 @@ _data_server_lookup_locked(const struct list_head *dsaddrs) | |||
149 | } | 149 | } |
150 | 150 | ||
151 | /* | 151 | /* |
152 | * Lookup DS by nfs_client pointer. Zero data server client pointer | ||
153 | */ | ||
154 | void nfs4_ds_disconnect(struct nfs_client *clp) | ||
155 | { | ||
156 | struct nfs4_pnfs_ds *ds; | ||
157 | struct nfs_client *found = NULL; | ||
158 | |||
159 | dprintk("%s clp %p\n", __func__, clp); | ||
160 | spin_lock(&nfs4_ds_cache_lock); | ||
161 | list_for_each_entry(ds, &nfs4_data_server_cache, ds_node) | ||
162 | if (ds->ds_clp && ds->ds_clp == clp) { | ||
163 | found = ds->ds_clp; | ||
164 | ds->ds_clp = NULL; | ||
165 | } | ||
166 | spin_unlock(&nfs4_ds_cache_lock); | ||
167 | if (found) { | ||
168 | set_bit(NFS_CS_STOP_RENEW, &clp->cl_res_state); | ||
169 | nfs_put_client(clp); | ||
170 | } | ||
171 | } | ||
172 | |||
173 | /* | ||
174 | * Create an rpc connection to the nfs4_pnfs_ds data server | 152 | * Create an rpc connection to the nfs4_pnfs_ds data server |
175 | * Currently only supports IPv4 and IPv6 addresses | 153 | * Currently only supports IPv4 and IPv6 addresses |
176 | */ | 154 | */ |