linux-nfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/1] NFSv4.1 don't free interrupted slot on open
@ 2019-03-19 16:12 Olga Kornievskaia
  2019-03-19 16:58 ` Trond Myklebust
  0 siblings, 1 reply; 2+ messages in thread
From: Olga Kornievskaia @ 2019-03-19 16:12 UTC (permalink / raw)
  To: trond.myklebust, anna.schumaker; +Cc: linux-nfs

From: Olga Kornievskaia <kolga@netapp.com>

Allow the async rpc task for finish and update the open state if needed,
then free the slot. Otherwise, the async rpc unable to decode the reply.

Signed-off-by: Olga Kornievskaia <kolga@netapp.com>
---
 fs/nfs/nfs4proc.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c
index 4dbb0ee..96c2499 100644
--- a/fs/nfs/nfs4proc.c
+++ b/fs/nfs/nfs4proc.c
@@ -2933,7 +2933,8 @@ static int _nfs4_open_and_get_state(struct nfs4_opendata *opendata,
 	}
 
 out:
-	nfs4_sequence_free_slot(&opendata->o_res.seq_res);
+	if (!opendata->cancelled)
+		nfs4_sequence_free_slot(&opendata->o_res.seq_res);
 	return ret;
 }
 
-- 
1.8.3.1


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

* Re: [PATCH 1/1] NFSv4.1 don't free interrupted slot on open
  2019-03-19 16:12 [PATCH 1/1] NFSv4.1 don't free interrupted slot on open Olga Kornievskaia
@ 2019-03-19 16:58 ` Trond Myklebust
  0 siblings, 0 replies; 2+ messages in thread
From: Trond Myklebust @ 2019-03-19 16:58 UTC (permalink / raw)
  To: anna.schumaker, olga.kornievskaia; +Cc: linux-nfs

On Tue, 2019-03-19 at 12:12 -0400, Olga Kornievskaia wrote:
> From: Olga Kornievskaia <kolga@netapp.com>
> 
> Allow the async rpc task for finish and update the open state if
> needed,
> then free the slot. Otherwise, the async rpc unable to decode the
> reply.
> 
> Signed-off-by: Olga Kornievskaia <kolga@netapp.com>
> ---
>  fs/nfs/nfs4proc.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c
> index 4dbb0ee..96c2499 100644
> --- a/fs/nfs/nfs4proc.c
> +++ b/fs/nfs/nfs4proc.c
> @@ -2933,7 +2933,8 @@ static int _nfs4_open_and_get_state(struct
> nfs4_opendata *opendata,
>  	}
>  
>  out:
> -	nfs4_sequence_free_slot(&opendata->o_res.seq_res);
> +	if (!opendata->cancelled)
> +		nfs4_sequence_free_slot(&opendata->o_res.seq_res);
>  	return ret;
>  }
>  

Nice catch! Thank you, Olga. I agree that can cause major confusion
when some other process sends a new request on the same slot.

Applying for linux-next and marking as a stable fix.

-- 
Trond Myklebust
Linux NFS client maintainer, Hammerspace
trond.myklebust@hammerspace.com



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

end of thread, other threads:[~2019-03-19 16:58 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-03-19 16:12 [PATCH 1/1] NFSv4.1 don't free interrupted slot on open Olga Kornievskaia
2019-03-19 16:58 ` Trond Myklebust

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).