NFSv4/pnfs: Fix the layout barrier update
authorTrond Myklebust <trond.myklebust@hammerspace.com>
Fri, 2 Jul 2021 20:37:15 +0000 (16:37 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 20 Jul 2021 14:05:53 +0000 (16:05 +0200)
commita668a77e6aedfd3ca2ef6c4a8883e5177bffd905
treed3c98f8b754f07493c99d733fe4c98b697f645a2
parent6ccccc03f87af72353baed617f222542c9de4bb0
NFSv4/pnfs: Fix the layout barrier update

[ Upstream commit aa95edf309ef31e2df4a37ebf0e5c2ca2a6772ab ]

If we have multiple outstanding layoutget requests, the current code to
update the layout barrier assumes that the outstanding layout stateids
are updated in order. That's not necessarily the case.

Instead of using the value of lo->plh_outstanding as a guesstimate for
the window of values we need to accept, just wait to update the window
until we're processing the last one. The intention here is just to
ensure that we don't process 2^31 seqid updates without also updating
the barrier.

Fixes: 1bcf34fdac5f ("pNFS/NFSv4: Update the layout barrier when we schedule a layoutreturn")
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
fs/nfs/pnfs.c