Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 308619
b: refs/heads/master
c: 90fecfc
h: refs/heads/master
i:
  308617: fb9beb8
  308615: d9f52ec
v: v3
  • Loading branch information
Andy Adamson authored and Trond Myklebust committed May 19, 2012
1 parent 07a29e9 commit b7c5390
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 23 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 554d458d79fa34acc73bc5128ba7bbf6b3007dfd
refs/heads/master: 90fecfcb3437dfc9bec4ee3306584dcd6843701b
28 changes: 6 additions & 22 deletions trunk/fs/nfs/nfs4filelayout.c
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,6 @@ static int filelayout_async_handle_error(struct rpc_task *task,
static int filelayout_read_done_cb(struct rpc_task *task,
struct nfs_read_data *data)
{
struct nfs_pgio_header *hdr = data->header;
int reset = 0;

dprintk("%s DS read\n", __func__);
Expand All @@ -157,10 +156,8 @@ static int filelayout_read_done_cb(struct rpc_task *task,
data->ds_clp, &reset) == -EAGAIN) {
dprintk("%s calling restart ds_clp %p ds_clp->cl_session %p\n",
__func__, data->ds_clp, data->ds_clp->cl_session);
if (reset) {
pnfs_set_lo_fail(hdr->lseg);
if (reset)
nfs4_reset_read(task, data);
}
rpc_restart_call_prepare(task);
return -EAGAIN;
}
Expand Down Expand Up @@ -233,17 +230,14 @@ static void filelayout_read_release(void *data)
static int filelayout_write_done_cb(struct rpc_task *task,
struct nfs_write_data *data)
{
struct nfs_pgio_header *hdr = data->header;
int reset = 0;

if (filelayout_async_handle_error(task, data->args.context->state,
data->ds_clp, &reset) == -EAGAIN) {
dprintk("%s calling restart ds_clp %p ds_clp->cl_session %p\n",
__func__, data->ds_clp, data->ds_clp->cl_session);
if (reset) {
pnfs_set_lo_fail(hdr->lseg);
if (reset)
nfs4_reset_write(task, data);
}
rpc_restart_call_prepare(task);
return -EAGAIN;
}
Expand Down Expand Up @@ -272,10 +266,9 @@ static int filelayout_commit_done_cb(struct rpc_task *task,
data->ds_clp, &reset) == -EAGAIN) {
dprintk("%s calling restart ds_clp %p ds_clp->cl_session %p\n",
__func__, data->ds_clp, data->ds_clp->cl_session);
if (reset) {
if (reset)
prepare_to_resend_writes(data);
pnfs_set_lo_fail(data->lseg);
} else
else
rpc_restart_call_prepare(task);
return -EAGAIN;
}
Expand Down Expand Up @@ -393,12 +386,8 @@ filelayout_read_pagelist(struct nfs_read_data *data)
j = nfs4_fl_calc_j_index(lseg, offset);
idx = nfs4_fl_calc_ds_index(lseg, j);
ds = nfs4_fl_prepare_ds(lseg, idx);
if (!ds) {
/* Either layout fh index faulty, or ds connect failed */
set_bit(lo_fail_bit(IOMODE_RW), &lseg->pls_layout->plh_flags);
set_bit(lo_fail_bit(IOMODE_READ), &lseg->pls_layout->plh_flags);
if (!ds)
return PNFS_NOT_ATTEMPTED;
}
dprintk("%s USE DS: %s\n", __func__, ds->ds_remotestr);

/* No multipath support. Use first DS */
Expand Down Expand Up @@ -433,11 +422,8 @@ filelayout_write_pagelist(struct nfs_write_data *data, int sync)
j = nfs4_fl_calc_j_index(lseg, offset);
idx = nfs4_fl_calc_ds_index(lseg, j);
ds = nfs4_fl_prepare_ds(lseg, idx);
if (!ds) {
set_bit(lo_fail_bit(IOMODE_RW), &lseg->pls_layout->plh_flags);
set_bit(lo_fail_bit(IOMODE_READ), &lseg->pls_layout->plh_flags);
if (!ds)
return PNFS_NOT_ATTEMPTED;
}
dprintk("%s ino %lu sync %d req %Zu@%llu DS: %s\n", __func__,
hdr->inode->i_ino, sync, (size_t) data->args.count, offset,
ds->ds_remotestr);
Expand Down Expand Up @@ -969,8 +955,6 @@ static int filelayout_initiate_commit(struct nfs_commit_data *data, int how)
idx = calc_ds_index_from_commit(lseg, data->ds_commit_index);
ds = nfs4_fl_prepare_ds(lseg, idx);
if (!ds) {
set_bit(lo_fail_bit(IOMODE_RW), &lseg->pls_layout->plh_flags);
set_bit(lo_fail_bit(IOMODE_READ), &lseg->pls_layout->plh_flags);
prepare_to_resend_writes(data);
filelayout_commit_release(data);
return -EAGAIN;
Expand Down

0 comments on commit b7c5390

Please sign in to comment.