Commit 90fecfcb3437dfc9bec4ee3306584dcd6843701b

Authored by Andy Adamson
Committed by Trond Myklebust
1 parent 554d458d79

NFSv4.1 cleanup filelayout invalid layout handling

The invalid layout bits are should only be used to block LAYOUTGETs.

Do not invalidate a layout on deviceid invalidation.
Do not invalidate a layout on un-handled READ, WRITE, COMMIT errors.

Signed-off-by: Andy Adamson <andros@netapp.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>

Showing 1 changed file with 6 additions and 22 deletions Side-by-side Diff

fs/nfs/nfs4filelayout.c
... ... @@ -148,7 +148,6 @@
148 148 static int filelayout_read_done_cb(struct rpc_task *task,
149 149 struct nfs_read_data *data)
150 150 {
151   - struct nfs_pgio_header *hdr = data->header;
152 151 int reset = 0;
153 152  
154 153 dprintk("%s DS read\n", __func__);
155 154  
... ... @@ -157,10 +156,8 @@
157 156 data->ds_clp, &reset) == -EAGAIN) {
158 157 dprintk("%s calling restart ds_clp %p ds_clp->cl_session %p\n",
159 158 __func__, data->ds_clp, data->ds_clp->cl_session);
160   - if (reset) {
161   - pnfs_set_lo_fail(hdr->lseg);
  159 + if (reset)
162 160 nfs4_reset_read(task, data);
163   - }
164 161 rpc_restart_call_prepare(task);
165 162 return -EAGAIN;
166 163 }
167 164  
168 165  
... ... @@ -233,17 +230,14 @@
233 230 static int filelayout_write_done_cb(struct rpc_task *task,
234 231 struct nfs_write_data *data)
235 232 {
236   - struct nfs_pgio_header *hdr = data->header;
237 233 int reset = 0;
238 234  
239 235 if (filelayout_async_handle_error(task, data->args.context->state,
240 236 data->ds_clp, &reset) == -EAGAIN) {
241 237 dprintk("%s calling restart ds_clp %p ds_clp->cl_session %p\n",
242 238 __func__, data->ds_clp, data->ds_clp->cl_session);
243   - if (reset) {
244   - pnfs_set_lo_fail(hdr->lseg);
  239 + if (reset)
245 240 nfs4_reset_write(task, data);
246   - }
247 241 rpc_restart_call_prepare(task);
248 242 return -EAGAIN;
249 243 }
250 244  
... ... @@ -272,10 +266,9 @@
272 266 data->ds_clp, &reset) == -EAGAIN) {
273 267 dprintk("%s calling restart ds_clp %p ds_clp->cl_session %p\n",
274 268 __func__, data->ds_clp, data->ds_clp->cl_session);
275   - if (reset) {
  269 + if (reset)
276 270 prepare_to_resend_writes(data);
277   - pnfs_set_lo_fail(data->lseg);
278   - } else
  271 + else
279 272 rpc_restart_call_prepare(task);
280 273 return -EAGAIN;
281 274 }
282 275  
... ... @@ -393,12 +386,8 @@
393 386 j = nfs4_fl_calc_j_index(lseg, offset);
394 387 idx = nfs4_fl_calc_ds_index(lseg, j);
395 388 ds = nfs4_fl_prepare_ds(lseg, idx);
396   - if (!ds) {
397   - /* Either layout fh index faulty, or ds connect failed */
398   - set_bit(lo_fail_bit(IOMODE_RW), &lseg->pls_layout->plh_flags);
399   - set_bit(lo_fail_bit(IOMODE_READ), &lseg->pls_layout->plh_flags);
  389 + if (!ds)
400 390 return PNFS_NOT_ATTEMPTED;
401   - }
402 391 dprintk("%s USE DS: %s\n", __func__, ds->ds_remotestr);
403 392  
404 393 /* No multipath support. Use first DS */
405 394  
... ... @@ -433,11 +422,8 @@
433 422 j = nfs4_fl_calc_j_index(lseg, offset);
434 423 idx = nfs4_fl_calc_ds_index(lseg, j);
435 424 ds = nfs4_fl_prepare_ds(lseg, idx);
436   - if (!ds) {
437   - set_bit(lo_fail_bit(IOMODE_RW), &lseg->pls_layout->plh_flags);
438   - set_bit(lo_fail_bit(IOMODE_READ), &lseg->pls_layout->plh_flags);
  425 + if (!ds)
439 426 return PNFS_NOT_ATTEMPTED;
440   - }
441 427 dprintk("%s ino %lu sync %d req %Zu@%llu DS: %s\n", __func__,
442 428 hdr->inode->i_ino, sync, (size_t) data->args.count, offset,
443 429 ds->ds_remotestr);
... ... @@ -969,8 +955,6 @@
969 955 idx = calc_ds_index_from_commit(lseg, data->ds_commit_index);
970 956 ds = nfs4_fl_prepare_ds(lseg, idx);
971 957 if (!ds) {
972   - set_bit(lo_fail_bit(IOMODE_RW), &lseg->pls_layout->plh_flags);
973   - set_bit(lo_fail_bit(IOMODE_READ), &lseg->pls_layout->plh_flags);
974 958 prepare_to_resend_writes(data);
975 959 filelayout_commit_release(data);
976 960 return -EAGAIN;