All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/1] Fixing lease renewal
@ 2014-09-23 21:36 Olga Kornievskaia
  2014-09-23 21:51 ` Trond Myklebust
  0 siblings, 1 reply; 14+ messages in thread
From: Olga Kornievskaia @ 2014-09-23 21:36 UTC (permalink / raw)
  To: linux-nfs

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.

---
 fs/nfs/nfs4state.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/fs/nfs/nfs4state.c b/fs/nfs/nfs4state.c
index 22fe351..790aed3 100644
--- a/fs/nfs/nfs4state.c
+++ b/fs/nfs/nfs4state.c
@@ -2345,6 +2345,8 @@ static void nfs4_state_manager(struct nfs_client *clp)
                        status = nfs4_check_lease(clp);
                        if (status < 0)
                                goto out_error;
+                       if (!test_bit(NFS4CLNT_MOVED, &clp->cl_state))
+                               continue;
                }

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

^ permalink raw reply related	[flat|nested] 14+ messages in thread

* Re: [PATCH 1/1] Fixing lease renewal
  2014-09-23 21:36 Olga Kornievskaia
@ 2014-09-23 21:51 ` Trond Myklebust
  2014-09-24 13:10   ` Olga Kornievskaia
  0 siblings, 1 reply; 14+ messages in thread
From: Trond Myklebust @ 2014-09-23 21:51 UTC (permalink / raw)
  To: Olga Kornievskaia; +Cc: linux-nfs

Hi Olga,

On Tue, Sep 23, 2014 at 5:36 PM, Olga Kornievskaia
<olga.kornievskaia@gmail.com> 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.
>
> ---
>  fs/nfs/nfs4state.c |    2 ++
>  1 files changed, 2 insertions(+), 0 deletions(-)
>
> diff --git a/fs/nfs/nfs4state.c b/fs/nfs/nfs4state.c
> index 22fe351..790aed3 100644
> --- a/fs/nfs/nfs4state.c
> +++ b/fs/nfs/nfs4state.c
> @@ -2345,6 +2345,8 @@ static void nfs4_state_manager(struct nfs_client *clp)
>                         status = nfs4_check_lease(clp);
>                         if (status < 0)
>                                 goto out_error;
> +                       if (!test_bit(NFS4CLNT_MOVED, &clp->cl_state))
> +                               continue;
>                 }
>
>                 if (test_and_clear_bit(NFS4CLNT_MOVED, &clp->cl_state)) {
>

What say we just move the "if (test_and_clear_bit(NFS4CLNT_MOVED,
&clp->cl_state)) { ... }" section so that it comes immediately before
the NFS4CLNT_CHECK_LEASE test?
That way we can just reinstate the original 'continue' without the
extra test above, and ensure that the NFS4CLNT_MOVED is always handled
before trying the check lease.

Also, please do remember to add a "Signed-off-by:" line when submitting patches.

Thanks
  Trond
-- 
Trond Myklebust

Linux NFS client maintainer, PrimaryData

trond.myklebust@primarydata.com

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH 1/1] Fixing lease renewal
  2014-09-23 21:51 ` Trond Myklebust
@ 2014-09-24 13:10   ` Olga Kornievskaia
  0 siblings, 0 replies; 14+ messages in thread
From: Olga Kornievskaia @ 2014-09-24 13:10 UTC (permalink / raw)
  To: Trond Myklebust; +Cc: linux-nfs

Thanks, Trond. Will do the changes you suggested and submit another patch.

On Tue, Sep 23, 2014 at 2:51 PM, Trond Myklebust
<trond.myklebust@primarydata.com> wrote:
> Hi Olga,
>
> On Tue, Sep 23, 2014 at 5:36 PM, Olga Kornievskaia
> <olga.kornievskaia@gmail.com> 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.
>>
>> ---
>>  fs/nfs/nfs4state.c |    2 ++
>>  1 files changed, 2 insertions(+), 0 deletions(-)
>>
>> diff --git a/fs/nfs/nfs4state.c b/fs/nfs/nfs4state.c
>> index 22fe351..790aed3 100644
>> --- a/fs/nfs/nfs4state.c
>> +++ b/fs/nfs/nfs4state.c
>> @@ -2345,6 +2345,8 @@ static void nfs4_state_manager(struct nfs_client *clp)
>>                         status = nfs4_check_lease(clp);
>>                         if (status < 0)
>>                                 goto out_error;
>> +                       if (!test_bit(NFS4CLNT_MOVED, &clp->cl_state))
>> +                               continue;
>>                 }
>>
>>                 if (test_and_clear_bit(NFS4CLNT_MOVED, &clp->cl_state)) {
>>
>
> What say we just move the "if (test_and_clear_bit(NFS4CLNT_MOVED,
> &clp->cl_state)) { ... }" section so that it comes immediately before
> the NFS4CLNT_CHECK_LEASE test?
> That way we can just reinstate the original 'continue' without the
> extra test above, and ensure that the NFS4CLNT_MOVED is always handled
> before trying the check lease.
>
> Also, please do remember to add a "Signed-off-by:" line when submitting patches.
>
> Thanks
>   Trond
> --
> Trond Myklebust
>
> Linux NFS client maintainer, PrimaryData
>
> trond.myklebust@primarydata.com

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [PATCH 1/1] Fixing lease renewal
@ 2014-09-24 13:11 Olga Kornievskaia
  2014-09-24 13:46 ` Anna Schumaker
  0 siblings, 1 reply; 14+ messages in thread
From: Olga Kornievskaia @ 2014-09-24 13:11 UTC (permalink / raw)
  To: linux-nfs

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)) {
-- 
1.7.1

^ permalink raw reply related	[flat|nested] 14+ messages in thread

* Re: [PATCH 1/1] Fixing lease renewal
  2014-09-24 13:11 [PATCH 1/1] Fixing lease renewal Olga Kornievskaia
@ 2014-09-24 13:46 ` Anna Schumaker
  2014-09-24 15:08   ` Olga Kornievskaia
  0 siblings, 1 reply; 14+ messages in thread
From: Anna Schumaker @ 2014-09-24 13:46 UTC (permalink / raw)
  To: Olga Kornievskaia, linux-nfs

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)) {


^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH 1/1] Fixing lease renewal
  2014-09-24 13:46 ` Anna Schumaker
@ 2014-09-24 15:08   ` Olga Kornievskaia
  0 siblings, 0 replies; 14+ messages in thread
From: Olga Kornievskaia @ 2014-09-24 15:08 UTC (permalink / raw)
  To: Anna Schumaker; +Cc: linux-nfs

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)) {
>

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [PATCH 1/1] Fixing lease renewal
@ 2014-09-24 16:08 Olga Kornievskaia
  2014-09-24 18:05 ` Trond Myklebust
  0 siblings, 1 reply; 14+ messages in thread
From: Olga Kornievskaia @ 2014-09-24 16:08 UTC (permalink / raw)
  To: Trond.Myklebust; +Cc: linux-nfs

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 file changed, 3 insertions(+), 1 deletion(-)

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)) {
-- 
1.8.5.2 (Apple Git-48)


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* Re: [PATCH 1/1] Fixing lease renewal
  2014-09-24 16:08 Olga Kornievskaia
@ 2014-09-24 18:05 ` Trond Myklebust
  2014-09-24 18:21   ` Olga Kornievskaia
  2014-09-24 18:29   ` Olga Kornievskaia
  0 siblings, 2 replies; 14+ messages in thread
From: Trond Myklebust @ 2014-09-24 18:05 UTC (permalink / raw)
  To: Olga Kornievskaia; +Cc: Linux NFS Mailing List

Hi Olga,

On Wed, Sep 24, 2014 at 12:08 PM, Olga Kornievskaia <kolga@netapp.com> 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 file changed, 3 insertions(+), 1 deletion(-)
>
> 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)) {
> --
> 1.8.5.2 (Apple Git-48)
>

I think you misunderstood me. I was proposing that we move the entire
code section that currently reads

                if (test_and_clear_bit(NFS4CLNT_MOVED, &clp->cl_state)) {
                        section = "migration";
                        status = nfs4_handle_migration(clp);
                        if (status < 0)
                                goto out_error;
                }

so that it occurs before the section

                if (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;
                }

That way we only need to test once for NFS4CLNT_MOVED.

Cheers
  Trond
-- 
Trond Myklebust

Linux NFS client maintainer, PrimaryData

trond.myklebust@primarydata.com

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH 1/1] Fixing lease renewal
  2014-09-24 18:05 ` Trond Myklebust
@ 2014-09-24 18:21   ` Olga Kornievskaia
  2014-09-24 18:29   ` Olga Kornievskaia
  1 sibling, 0 replies; 14+ messages in thread
From: Olga Kornievskaia @ 2014-09-24 18:21 UTC (permalink / raw)
  To: Trond Myklebust; +Cc: Olga Kornievskaia, Linux NFS Mailing List

I have misunderstood you. One more try coming up.

On Wed, Sep 24, 2014 at 2:05 PM, Trond Myklebust
<trond.myklebust@primarydata.com> wrote:
> Hi Olga,
>
> On Wed, Sep 24, 2014 at 12:08 PM, Olga Kornievskaia <kolga@netapp.com> 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 file changed, 3 insertions(+), 1 deletion(-)
>>
>> 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)) {
>> --
>> 1.8.5.2 (Apple Git-48)
>>
>
> I think you misunderstood me. I was proposing that we move the entire
> code section that currently reads
>
>                 if (test_and_clear_bit(NFS4CLNT_MOVED, &clp->cl_state)) {
>                         section = "migration";
>                         status = nfs4_handle_migration(clp);
>                         if (status < 0)
>                                 goto out_error;
>                 }
>
> so that it occurs before the section
>
>                 if (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;
>                 }
>
> That way we only need to test once for NFS4CLNT_MOVED.
>
> Cheers
>   Trond
> --
> Trond Myklebust
>
> Linux NFS client maintainer, PrimaryData
>
> trond.myklebust@primarydata.com
> --
> 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

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH 1/1] Fixing lease renewal
  2014-09-24 18:05 ` Trond Myklebust
  2014-09-24 18:21   ` Olga Kornievskaia
@ 2014-09-24 18:29   ` Olga Kornievskaia
  2014-09-24 20:11     ` Trond Myklebust
  1 sibling, 1 reply; 14+ messages in thread
From: Olga Kornievskaia @ 2014-09-24 18:29 UTC (permalink / raw)
  To: Trond Myklebust; +Cc: Olga Kornievskaia, Linux NFS Mailing List

Before I go ahead with the change, does it make sense to move "both"
of the migration sections NFS4CLNT_MOVED and NFS4CLNT_LEASE_MOVED
before the check lease section?

On Wed, Sep 24, 2014 at 2:05 PM, Trond Myklebust
<trond.myklebust@primarydata.com> wrote:
> Hi Olga,
>
> On Wed, Sep 24, 2014 at 12:08 PM, Olga Kornievskaia <kolga@netapp.com> 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 file changed, 3 insertions(+), 1 deletion(-)
>>
>> 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)) {
>> --
>> 1.8.5.2 (Apple Git-48)
>>
>
> I think you misunderstood me. I was proposing that we move the entire
> code section that currently reads
>
>                 if (test_and_clear_bit(NFS4CLNT_MOVED, &clp->cl_state)) {
>                         section = "migration";
>                         status = nfs4_handle_migration(clp);
>                         if (status < 0)
>                                 goto out_error;
>                 }
>
> so that it occurs before the section
>
>                 if (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;
>                 }
>
> That way we only need to test once for NFS4CLNT_MOVED.
>
> Cheers
>   Trond
> --
> Trond Myklebust
>
> Linux NFS client maintainer, PrimaryData
>
> trond.myklebust@primarydata.com
> --
> 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

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH 1/1] Fixing lease renewal
  2014-09-24 18:29   ` Olga Kornievskaia
@ 2014-09-24 20:11     ` Trond Myklebust
  2014-09-24 22:12       ` Olga Kornievskaia
  0 siblings, 1 reply; 14+ messages in thread
From: Trond Myklebust @ 2014-09-24 20:11 UTC (permalink / raw)
  To: Olga Kornievskaia; +Cc: Olga Kornievskaia, Linux NFS Mailing List

On Wed, Sep 24, 2014 at 2:29 PM, Olga Kornievskaia <aglo@umich.edu> wrote:
> Before I go ahead with the change, does it make sense to move "both"
> of the migration sections NFS4CLNT_MOVED and NFS4CLNT_LEASE_MOVED
> before the check lease section?

Actually. Never mind. Thinking about this, and looking at the code, we
definitely do want to ensure that lease recovery is performed before
migration recovery.
Let's just put the 'continue;' back into the CHECK_LEASE section for
now so that we enforce that.

> On Wed, Sep 24, 2014 at 2:05 PM, Trond Myklebust
> <trond.myklebust@primarydata.com> wrote:
>> Hi Olga,
>>
>> On Wed, Sep 24, 2014 at 12:08 PM, Olga Kornievskaia <kolga@netapp.com> 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 file changed, 3 insertions(+), 1 deletion(-)
>>>
>>> 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)) {
>>> --
>>> 1.8.5.2 (Apple Git-48)
>>>
>>
>> I think you misunderstood me. I was proposing that we move the entire
>> code section that currently reads
>>
>>                 if (test_and_clear_bit(NFS4CLNT_MOVED, &clp->cl_state)) {
>>                         section = "migration";
>>                         status = nfs4_handle_migration(clp);
>>                         if (status < 0)
>>                                 goto out_error;
>>                 }
>>
>> so that it occurs before the section
>>
>>                 if (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;
>>                 }
>>
>> That way we only need to test once for NFS4CLNT_MOVED.
>>
>> Cheers
>>   Trond
>> --
>> Trond Myklebust
>>
>> Linux NFS client maintainer, PrimaryData
>>
>> trond.myklebust@primarydata.com
>> --
>> 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

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [PATCH 1/1] Fixing lease renewal
@ 2014-09-24 22:11 Olga Kornievskaia
  2014-09-24 22:24 ` Trond Myklebust
  0 siblings, 1 reply; 14+ messages in thread
From: Olga Kornievskaia @ 2014-09-24 22:11 UTC (permalink / raw)
  To: Trond.Myklebust; +Cc: linux-nfs

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 | 1 +
 1 file changed, 1 insertion(+)

diff --git a/fs/nfs/nfs4state.c b/fs/nfs/nfs4state.c
index 22fe351..6678769 100644
--- a/fs/nfs/nfs4state.c
+++ b/fs/nfs/nfs4state.c
@@ -2345,6 +2345,7 @@ static void nfs4_state_manager(struct nfs_client *clp)
 			status = nfs4_check_lease(clp);
 			if (status < 0)
 				goto out_error;
+			continue;
 		}
 
 		if (test_and_clear_bit(NFS4CLNT_MOVED, &clp->cl_state)) {
-- 
1.8.5.2 (Apple Git-48)


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* Re: [PATCH 1/1] Fixing lease renewal
  2014-09-24 20:11     ` Trond Myklebust
@ 2014-09-24 22:12       ` Olga Kornievskaia
  0 siblings, 0 replies; 14+ messages in thread
From: Olga Kornievskaia @ 2014-09-24 22:12 UTC (permalink / raw)
  To: Trond Myklebust; +Cc: Linux NFS Mailing List

On Wed, Sep 24, 2014 at 4:11 PM, Trond Myklebust
<trond.myklebust@primarydata.com> wrote:
> On Wed, Sep 24, 2014 at 2:29 PM, Olga Kornievskaia <aglo@umich.edu> wrote:
>> Before I go ahead with the change, does it make sense to move "both"
>> of the migration sections NFS4CLNT_MOVED and NFS4CLNT_LEASE_MOVED
>> before the check lease section?
>
> Actually. Never mind. Thinking about this, and looking at the code, we
> definitely do want to ensure that lease recovery is performed before
> migration recovery.
> Let's just put the 'continue;' back into the CHECK_LEASE section for
> now so that we enforce that.
>

Ok. Another one submitted.

>> On Wed, Sep 24, 2014 at 2:05 PM, Trond Myklebust
>> <trond.myklebust@primarydata.com> wrote:
>>> Hi Olga,
>>>
>>> On Wed, Sep 24, 2014 at 12:08 PM, Olga Kornievskaia <kolga@netapp.com> 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 file changed, 3 insertions(+), 1 deletion(-)
>>>>
>>>> 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)) {
>>>> --
>>>> 1.8.5.2 (Apple Git-48)
>>>>
>>>
>>> I think you misunderstood me. I was proposing that we move the entire
>>> code section that currently reads
>>>
>>>                 if (test_and_clear_bit(NFS4CLNT_MOVED, &clp->cl_state)) {
>>>                         section = "migration";
>>>                         status = nfs4_handle_migration(clp);
>>>                         if (status < 0)
>>>                                 goto out_error;
>>>                 }
>>>
>>> so that it occurs before the section
>>>
>>>                 if (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;
>>>                 }
>>>
>>> That way we only need to test once for NFS4CLNT_MOVED.
>>>
>>> Cheers
>>>   Trond
>>> --
>>> Trond Myklebust
>>>
>>> Linux NFS client maintainer, PrimaryData
>>>
>>> trond.myklebust@primarydata.com
>>> --
>>> 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

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH 1/1] Fixing lease renewal
  2014-09-24 22:11 Olga Kornievskaia
@ 2014-09-24 22:24 ` Trond Myklebust
  0 siblings, 0 replies; 14+ messages in thread
From: Trond Myklebust @ 2014-09-24 22:24 UTC (permalink / raw)
  To: Olga Kornievskaia; +Cc: Linux NFS Mailing List

On Wed, Sep 24, 2014 at 6:11 PM, Olga Kornievskaia <kolga@netapp.com> 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 | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/fs/nfs/nfs4state.c b/fs/nfs/nfs4state.c
> index 22fe351..6678769 100644
> --- a/fs/nfs/nfs4state.c
> +++ b/fs/nfs/nfs4state.c
> @@ -2345,6 +2345,7 @@ static void nfs4_state_manager(struct nfs_client *clp)
>                         status = nfs4_check_lease(clp);
>                         if (status < 0)
>                                 goto out_error;
> +                       continue;
>                 }
>
>                 if (test_and_clear_bit(NFS4CLNT_MOVED, &clp->cl_state)) {
> --
> 1.8.5.2 (Apple Git-48)

Thanks Olga! Will apply.

-- 
Trond Myklebust

Linux NFS client maintainer, PrimaryData

trond.myklebust@primarydata.com

^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2014-09-24 22:24 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-09-24 13:11 [PATCH 1/1] Fixing lease renewal Olga Kornievskaia
2014-09-24 13:46 ` Anna Schumaker
2014-09-24 15:08   ` Olga Kornievskaia
  -- strict thread matches above, loose matches on Subject: below --
2014-09-24 22:11 Olga Kornievskaia
2014-09-24 22:24 ` Trond Myklebust
2014-09-24 16:08 Olga Kornievskaia
2014-09-24 18:05 ` Trond Myklebust
2014-09-24 18:21   ` Olga Kornievskaia
2014-09-24 18:29   ` Olga Kornievskaia
2014-09-24 20:11     ` Trond Myklebust
2014-09-24 22:12       ` Olga Kornievskaia
2014-09-23 21:36 Olga Kornievskaia
2014-09-23 21:51 ` Trond Myklebust
2014-09-24 13:10   ` Olga Kornievskaia

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.