From: Olga Kornievskaia <[email protected]>
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 <[email protected]>
---
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
On Tue, 2019-03-19 at 12:12 -0400, Olga Kornievskaia wrote:
> From: Olga Kornievskaia <[email protected]>
>
> 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 <[email protected]>
> ---
> 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
[email protected]