Re: [PATCH 7/8] SQUASHME pnfs-submit: add error handlers to layout get

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Jun 23, 2010 at 9:04 AM, William A. (Andy) Adamson
<androsadamson@xxxxxxxxx> wrote:
> On Wed, Jun 23, 2010 at 3:41 AM, Benny Halevy <bhalevy@xxxxxxxxxxx> wrote:
>> On Jun. 23, 2010, 0:56 +0300, andros@xxxxxxxxxx wrote:
>>> From: Andy Adamson <andros@xxxxxxxxxx>
>>>
>>> Redo pnfs4_proc_layoutget() logic to match the other async operations that call
>>> nfs4_wait_for_completion_rpc_task.
>>>
>>> pnfs_get_layout_done passes session and delay errors. Handle them with the
>>> generic error handlers.
>>>
>>> Signed-off-by: Andy Adamson <andros@xxxxxxxxxx>
>>> ---
>>>  fs/nfs/nfs4proc.c |   45 +++++++++++++++++++++++++++++----------------
>>>  1 files changed, 29 insertions(+), 16 deletions(-)
>>>
>>> diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c
>>> index 35e8a56..6283996 100644
>>> --- a/fs/nfs/nfs4proc.c
>>> +++ b/fs/nfs/nfs4proc.c
>>> @@ -5446,6 +5446,10 @@ static void nfs4_pnfs_layoutget_done(struct rpc_task *task, void *calldata)
>>>               return;
>>>
>>>       pnfs_get_layout_done(lgp, task->tk_status);
>>> +
>>> +     if (nfs4_async_handle_error(task, server, NULL, NULL) == -EAGAIN)
>>> +             nfs_restart_rpc(task, server->nfs_client);
>>> +
>>>       dprintk("<-- %s\n", __func__);
>>>  }
>>>
>>> @@ -5471,10 +5475,9 @@ static const struct rpc_call_ops nfs4_pnfs_layoutget_call_ops = {
>>>   * and deal with retries.
>>>   * Currently we can't since we release lgp and its contents.
>>>   */
>>> -int pnfs4_proc_layoutget(struct nfs4_pnfs_layoutget *lgp)
>>> +static int _pnfs4_proc_layoutget(struct nfs4_pnfs_layoutget *lgp)
>>>  {
>>> -     struct inode *ino = lgp->args.inode;
>>> -     struct nfs_server *server = NFS_SERVER(ino);
>>> +     struct nfs_server *server = NFS_SERVER(lgp->args.inode);
>>>       struct rpc_task *task;
>>>       struct rpc_message msg = {
>>>               .rpc_proc = &nfs4_procedures[NFSPROC4_CLNT_PNFS_LAYOUTGET],
>>> @@ -5488,35 +5491,45 @@ int pnfs4_proc_layoutget(struct nfs4_pnfs_layoutget *lgp)
>>>               .callback_data = lgp,
>>>               .flags = RPC_TASK_ASYNC,
>>>       };
>>> -     int status;
>>> +     int status = 0;
>>>
>>>       dprintk("--> %s\n", __func__);
>>>
>>>       lgp->res.layout.buf = (void *)__get_free_page(GFP_NOFS);
>>>       if (lgp->res.layout.buf == NULL) {
>>>               nfs4_pnfs_layoutget_release(lgp);
>>> -             status = -ENOMEM;
>>> -             goto out;
>>> +             return -ENOMEM;
>>
>> This will bypass the dprintk.
>> How about adding a out_no_task label after the call to rpc_put_task?
>
> Actually, I think we need to lose all of these dprintk's. Look at
> _nfs4_proc_delegreturn for example...


Since pnfs4_proc_layoutget is only called by send_layout which prints
the status, I'll leave this alone for now.

Sometime soon we will need to purge the pnfs-submit branch of dprintks

-->Andy
>
> -->Andy
>
>>
>>>       }
>>>
>>>       lgp->res.seq_res.sr_slotid = NFS4_MAX_SLOT_TABLE;
>>>       task = rpc_run_task(&task_setup_data);
>>> -     if (IS_ERR(task)) {
>>> -             status = PTR_ERR(task);
>>> -             goto out;
>>> -     }
>>> +     if (IS_ERR(task))
>>> +             return PTR_ERR(task);
>>
>> ditto
>
>>
>> Benny
>>
>>>       status = nfs4_wait_for_completion_rpc_task(task);
>>> -     if (status == 0) {
>>> -             status = lgp->status;
>>> -             if (status == 0)
>>> -                     status = pnfs_layout_process(lgp);
>>> -     }
>>> -     rpc_put_task(task);
>>> +     if (status != 0)
>>> +             goto out;
>>> +     status = lgp->status;
>>> +     if (status != 0)
>>> +             goto out;
>>> +     status = pnfs_layout_process(lgp);
>>>  out:
>>> +     rpc_put_task(task);
>>>       dprintk("<-- %s status=%d\n", __func__, status);
>>>       return status;
>>>  }
>>>
>>> +int pnfs4_proc_layoutget(struct nfs4_pnfs_layoutget *lgp)
>>> +{
>>> +     struct nfs_server *server = NFS_SERVER(lgp->args.inode);
>>> +     struct nfs4_exception exception = { };
>>> +     int err;
>>> +     do {
>>> +             err = nfs4_handle_exception(server, _pnfs4_proc_layoutget(lgp),
>>> +                                         &exception);
>>> +     } while (exception.retry);
>>> +     return err;
>>> +}
>>> +
>>>  static void pnfs_layoutcommit_prepare(struct rpc_task *task, void *data)
>>>  {
>>>       struct pnfs_layoutcommit_data *ldata =
>>
>> --
>> To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
>> the body of a message to majordomo@xxxxxxxxxxxxxxx
>> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>>
>
--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Filesystem Development]     [Linux USB Development]     [Linux Media Development]     [Video for Linux]     [Linux NILFS]     [Linux Audio Users]     [Yosemite Info]     [Linux SCSI]

  Powered by Linux