All of lore.kernel.org
 help / color / mirror / Atom feed
From: Trond Myklebust <trond.myklebust@primarydata.com>
To: Olga Kornievskaia <aglo@umich.edu>
Cc: linux-nfs <linux-nfs@vger.kernel.org>
Subject: Re: [PATCH 1/1] Fixing infinite state recovery loop due to failed delegation return
Date: Tue, 4 Nov 2014 19:14:14 -0500	[thread overview]
Message-ID: <CAHQdGtQWg+Fiyn7vH9pjU1GR-TKvMp+gcR7ssaA1zESQ8JdVsw@mail.gmail.com> (raw)
In-Reply-To: <CAN-5tyHVoJ60z7WBaCYvUN3GsCEGh9jGc0evRCuiVt2aA6zP0g@mail.gmail.com>

On Tue, Nov 4, 2014 at 6:22 PM, Olga Kornievskaia <aglo@umich.edu> wrote:
> Trond, can you please respond to the patch?
>
> As per earlier conversation, in this solution, state recovery is
> initiated which marks the locks lost.
>
> Please either accept this patch or let me know what needs to be fixed.
>

Please see the 3 fixes I just sent out concerning delegation recovery
w.r.t. NFSv4+NFSv4.1. In addition, we need to handle the case you
patch attempts to address (however see the question I have below).

> Thank you.
>
> On Mon, Nov 3, 2014 at 9:36 AM, Olga Kornievskaia <kolga@netapp.com> wrote:
>> If we get a bad-stateid-type of error when we send OPEN with delegate_cur
>> to return currently held delegation, we shouldn't be trying to reclaim locks
>> associated with that delegation state_id because we don't have an
>> open_stateid to be used for the LOCK operation. Thus, we should
>> return an error from the nfs4_open_delegation_recall() in that case.
>>
>> Furthermore, if an error occurs the delegation code will call
>> nfs_abort_delegation_return() which sets again the NFS4CLNT_DELEGRETURN
>> flags in the state and it leads the state manager to into an infinite loop
>> for trying to reclaim the delegated state.
>>
>> Signed-off-by: Olga Kornievskaia <kolga@netapp.com>
>> ---
>>  fs/nfs/delegation.c |    5 +++--
>>  fs/nfs/nfs4proc.c   |    2 +-
>>  2 files changed, 4 insertions(+), 3 deletions(-)
>>
>> diff --git a/fs/nfs/delegation.c b/fs/nfs/delegation.c
>> index 5853f53..8016d89 100644
>> --- a/fs/nfs/delegation.c
>> +++ b/fs/nfs/delegation.c
>> @@ -394,7 +394,7 @@ static int nfs_end_delegation_return(struct inode *inode, struct nfs_delegation
>>                 err = nfs4_wait_clnt_recover(clp);
>>         } while (err == 0);
>>
>> -       if (err) {
>> +       if (err && err != -EIO) {
>>                 nfs_abort_delegation_return(delegation, clp);

This exception for EIO now has me worried. If we detach the
delegation, then it looks to me as if we will never send a
FREE_STATEID, as required for the case of NFSv4.1.

>>                 goto out;
>>         }
>> @@ -458,7 +458,8 @@ restart:
>>                         iput(inode);
>>                         if (!err)
>>                                 goto restart;
>> -                       set_bit(NFS4CLNT_DELEGRETURN, &clp->cl_state);
>> +                       if (err != -EIO)
>> +                               set_bit(NFS4CLNT_DELEGRETURN, &clp->cl_state);

Please explain why this is needed. If we've cleared the bad
delegation, then why should we not attempt to return any others that
may be pending?

>>                         return err;
>>                 }
>>         }
>> diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c
>> index 5aa55c1..6871055 100644
>> --- a/fs/nfs/nfs4proc.c
>> +++ b/fs/nfs/nfs4proc.c
>> @@ -1655,7 +1655,7 @@ static int nfs4_handle_delegation_recall_error(struct nfs_server *server, struct
>>                         nfs_inode_find_state_and_recover(state->inode,
>>                                         stateid);
>>                         nfs4_schedule_stateid_recovery(server, state);
>> -                       return 0;
>> +                       return -EIO;
>>                 case -NFS4ERR_DELAY:
>>                 case -NFS4ERR_GRACE:
>>                         set_bit(NFS_DELEGATED_STATE, &state->flags);
>> --
>> 1.7.1
>>
>> --
>> To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
>> the body of a message to majordomo@vger.kernel.org
>> More majordomo info at  http://vger.kernel.org/majordomo-info.html



-- 
Trond Myklebust

Linux NFS client maintainer, PrimaryData

trond.myklebust@primarydata.com

  reply	other threads:[~2014-11-05  0:14 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-03 14:36 [PATCH 1/1] Fixing infinite state recovery loop due to failed delegation return Olga Kornievskaia
2014-11-04 23:22 ` Olga Kornievskaia
2014-11-05  0:14   ` Trond Myklebust [this message]
2014-11-05 17:53     ` Olga Kornievskaia
2014-11-05 18:38       ` Trond Myklebust
2014-11-06 18:54         ` Olga Kornievskaia
2014-11-06 19:15           ` Trond Myklebust
  -- strict thread matches above, loose matches on Subject: below --
2014-10-24 20:13 Olga Kornievskaia

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAHQdGtQWg+Fiyn7vH9pjU1GR-TKvMp+gcR7ssaA1zESQ8JdVsw@mail.gmail.com \
    --to=trond.myklebust@primarydata.com \
    --cc=aglo@umich.edu \
    --cc=linux-nfs@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.