pNFS/flexfiles: If the layout is invalid, it must be updated before retrying
commit df3ab232e462bce20710596d697ade6b72497694 upstream. If we see that our pNFS READ/WRITE/COMMIT operation failed, but we also see that our layout segment is no longer valid, then we need to get a new layout segment before retrying. Fixes: 90816d1ddacf ("NFSv4.1/flexfiles: Don't mark the entire deviceid...") Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com> Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
77bbc0c771
commit
c65db336d6
@ -1073,9 +1073,6 @@ static int ff_layout_async_handle_error_v4(struct rpc_task *task,
|
||||
struct nfs_client *mds_client = mds_server->nfs_client;
|
||||
struct nfs4_slot_table *tbl = &clp->cl_session->fc_slot_table;
|
||||
|
||||
if (task->tk_status >= 0)
|
||||
return 0;
|
||||
|
||||
switch (task->tk_status) {
|
||||
/* MDS state errors */
|
||||
case -NFS4ERR_DELEG_REVOKED:
|
||||
@ -1176,9 +1173,6 @@ static int ff_layout_async_handle_error_v3(struct rpc_task *task,
|
||||
{
|
||||
struct nfs4_deviceid_node *devid = FF_LAYOUT_DEVID_NODE(lseg, idx);
|
||||
|
||||
if (task->tk_status >= 0)
|
||||
return 0;
|
||||
|
||||
switch (task->tk_status) {
|
||||
/* File access problems. Don't mark the device as unavailable */
|
||||
case -EACCES:
|
||||
@ -1213,6 +1207,13 @@ static int ff_layout_async_handle_error(struct rpc_task *task,
|
||||
{
|
||||
int vers = clp->cl_nfs_mod->rpc_vers->number;
|
||||
|
||||
if (task->tk_status >= 0)
|
||||
return 0;
|
||||
|
||||
/* Handle the case of an invalid layout segment */
|
||||
if (!pnfs_is_valid_lseg(lseg))
|
||||
return -NFS4ERR_RESET_TO_PNFS;
|
||||
|
||||
switch (vers) {
|
||||
case 3:
|
||||
return ff_layout_async_handle_error_v3(task, lseg, idx);
|
||||
|
Loading…
x
Reference in New Issue
Block a user