diff mbox

[1/1] Fixing lease renewal

Message ID CAN-5tyFQihuK22n_bzsO0LtqQBM+KW6vELt7H_DPEF0RFdoDQQ@mail.gmail.com (mailing list archive)
State New, archived
Headers show

Commit Message

Olga Kornievskaia Sept. 24, 2014, 1:11 p.m. UTC
Commit c9fdeb28 removed a 'continue' after checking if the lease needs
to be renewed. However, if client hasn't moved, the code falls down to
starting reboot recovery erroneously (ie., sends open reclaim and gets
back stale_clientid error) before recovering from getting stale_clientid
on the renew operation.

Signed-off-by: Olga Kornievskaia <kolga@netapp.com>
---
 fs/nfs/nfs4state.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

Comments

Anna Schumaker Sept. 24, 2014, 1:46 p.m. UTC | #1
Hey Olga,

Your patch is using spaces instead of tabs, so it won't apply to the existing code.  Did you use `git format-patch` to generate it?

Anna

On 09/24/2014 09:11 AM, Olga Kornievskaia wrote:
> Commit c9fdeb28 removed a 'continue' after checking if the lease needs
> to be renewed. However, if client hasn't moved, the code falls down to
> starting reboot recovery erroneously (ie., sends open reclaim and gets
> back stale_clientid error) before recovering from getting stale_clientid
> on the renew operation.
>
> Signed-off-by: Olga Kornievskaia <kolga@netapp.com>
> ---
>  fs/nfs/nfs4state.c |    4 +++-
>  1 files changed, 3 insertions(+), 1 deletions(-)
>
> diff --git a/fs/nfs/nfs4state.c b/fs/nfs/nfs4state.c
> index 22fe351..4616598 100644
> --- a/fs/nfs/nfs4state.c
> +++ b/fs/nfs/nfs4state.c
> @@ -2340,11 +2340,13 @@ static void nfs4_state_manager(struct nfs_client *clp)
>                         continue;
>                 }
>
> -               if (test_and_clear_bit(NFS4CLNT_CHECK_LEASE, &clp->cl_state)) {
> +               if (!test_bit(NFS4CLNT_MOVED, &clp->cl_state) &&
> +                    test_and_clear_bit(NFS4CLNT_CHECK_LEASE, &clp->cl_state)) {
>                         section = "check lease";
>                         status = nfs4_check_lease(clp);
>                         if (status < 0)
>                                 goto out_error;
> +                       continue;
>                 }
>
>                 if (test_and_clear_bit(NFS4CLNT_MOVED, &clp->cl_state)) {

--
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
Olga Kornievskaia Sept. 24, 2014, 3:08 p.m. UTC | #2
I did. Let me try again.

On Wed, Sep 24, 2014 at 9:46 AM, Anna Schumaker
<Anna.Schumaker@netapp.com> wrote:
> Hey Olga,
>
> Your patch is using spaces instead of tabs, so it won't apply to the existing code.  Did you use `git format-patch` to generate it?
>
> Anna
>
> On 09/24/2014 09:11 AM, Olga Kornievskaia wrote:
>> Commit c9fdeb28 removed a 'continue' after checking if the lease needs
>> to be renewed. However, if client hasn't moved, the code falls down to
>> starting reboot recovery erroneously (ie., sends open reclaim and gets
>> back stale_clientid error) before recovering from getting stale_clientid
>> on the renew operation.
>>
>> Signed-off-by: Olga Kornievskaia <kolga@netapp.com>
>> ---
>>  fs/nfs/nfs4state.c |    4 +++-
>>  1 files changed, 3 insertions(+), 1 deletions(-)
>>
>> diff --git a/fs/nfs/nfs4state.c b/fs/nfs/nfs4state.c
>> index 22fe351..4616598 100644
>> --- a/fs/nfs/nfs4state.c
>> +++ b/fs/nfs/nfs4state.c
>> @@ -2340,11 +2340,13 @@ static void nfs4_state_manager(struct nfs_client *clp)
>>                         continue;
>>                 }
>>
>> -               if (test_and_clear_bit(NFS4CLNT_CHECK_LEASE, &clp->cl_state)) {
>> +               if (!test_bit(NFS4CLNT_MOVED, &clp->cl_state) &&
>> +                    test_and_clear_bit(NFS4CLNT_CHECK_LEASE, &clp->cl_state)) {
>>                         section = "check lease";
>>                         status = nfs4_check_lease(clp);
>>                         if (status < 0)
>>                                 goto out_error;
>> +                       continue;
>>                 }
>>
>>                 if (test_and_clear_bit(NFS4CLNT_MOVED, &clp->cl_state)) {
>
--
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
diff mbox

Patch

diff --git a/fs/nfs/nfs4state.c b/fs/nfs/nfs4state.c
index 22fe351..4616598 100644
--- a/fs/nfs/nfs4state.c
+++ b/fs/nfs/nfs4state.c
@@ -2340,11 +2340,13 @@  static void nfs4_state_manager(struct nfs_client *clp)
                        continue;
                }

-               if (test_and_clear_bit(NFS4CLNT_CHECK_LEASE, &clp->cl_state)) {
+               if (!test_bit(NFS4CLNT_MOVED, &clp->cl_state) &&
+                    test_and_clear_bit(NFS4CLNT_CHECK_LEASE, &clp->cl_state)) {
                        section = "check lease";
                        status = nfs4_check_lease(clp);
                        if (status < 0)
                                goto out_error;
+                       continue;
                }

                if (test_and_clear_bit(NFS4CLNT_MOVED, &clp->cl_state)) {