NFSv4: Fix a regression in nfs_set_open_stateid_locked()
authorTrond Myklebust <trond.myklebust@hammerspace.com>
Wed, 27 Oct 2021 01:56:40 +0000 (21:56 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 18 Nov 2021 18:17:04 +0000 (19:17 +0100)
commit9b882818aec13f532ac2238025bf53bd151e9a2e
treecab35205cb6fc5d8b82ba0d911c41f9fb0d4862f
parent4b7e3d5ee357d5bde3ebb0c0239bc78518b82c6f
NFSv4: Fix a regression in nfs_set_open_stateid_locked()

[ Upstream commit 01d29f87fcfef38d51ce2b473981a5c1e861ac0a ]

If we already hold open state on the client, yet the server gives us a
completely different stateid to the one we already hold, then we
currently treat it as if it were an out-of-sequence update, and wait for
5 seconds for other updates to come in.
This commit fixes the behaviour so that we immediately start processing
of the new stateid, and then leave it to the call to
nfs4_test_and_free_stateid() to decide what to do with the old stateid.

Fixes: b4868b44c562 ("NFSv4: Wait for stateid updates after CLOSE/OPEN_DOWNGRADE")
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
fs/nfs/nfs4proc.c