diff options
author | Trond Myklebust <trond.myklebust@hammerspace.com> | 2018-05-22 11:17:16 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2018-08-03 07:55:14 +0200 |
commit | b05c460a0ce3bef757f40475d028d8fcfea2bb5d (patch) | |
tree | 3b2d459206af6a8d1e65727ce4bf676756343dcf | |
parent | 759fb7f94fab59cf3ca9e67c6646b87cff919918 (diff) | |
download | linux-stable-b05c460a0ce3bef757f40475d028d8fcfea2bb5d.tar.gz linux-stable-b05c460a0ce3bef757f40475d028d8fcfea2bb5d.tar.bz2 linux-stable-b05c460a0ce3bef757f40475d028d8fcfea2bb5d.zip |
pnfs: Don't release the sequence slot until we've processed layoutget on open
[ Upstream commit ae55e59da0e401893b3c52b575fc18a00623d0a1 ]
If the server recalls the layout that was just handed out, we risk hitting
a race as described in RFC5661 Section 2.10.6.3 unless we ensure that we
release the sequence slot after processing the LAYOUTGET operation that
was sent as part of the OPEN compound.
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | fs/nfs/nfs4proc.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c index 91e017ca7072..cf5fdc25289a 100644 --- a/fs/nfs/nfs4proc.c +++ b/fs/nfs/nfs4proc.c @@ -2701,7 +2701,7 @@ static int _nfs4_open_and_get_state(struct nfs4_opendata *opendata, if (ret != 0) goto out; - state = nfs4_opendata_to_nfs4_state(opendata); + state = _nfs4_opendata_to_nfs4_state(opendata); ret = PTR_ERR(state); if (IS_ERR(state)) goto out; @@ -2737,6 +2737,7 @@ static int _nfs4_open_and_get_state(struct nfs4_opendata *opendata, nfs4_schedule_stateid_recovery(server, state); } out: + nfs4_sequence_free_slot(&opendata->o_res.seq_res); return ret; } |