Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit 4ff376fe authored by Trond Myklebust's avatar Trond Myklebust
Browse files

NFSv4.1/pnfs: Fix a close/delegreturn hang when return-on-close is set



The helper pnfs_roc() has already verified that we have no delegations,
and no further open files, hence no outstanding I/O and it has marked
all the return-on-close lsegs as being invalid.
Furthermore, it sets the NFS_LAYOUT_RETURN bit, thus serialising the
close/delegreturn with all future layoutget calls on this inode.

The checks in pnfs_roc_drain() for valid layout segments are therefore
redundant: those cannot exist until another layoutget completes.
The other check for whether or not NFS_LAYOUT_RETURN is set, actually
causes a hang, since we already know that we hold that flag.

To fix, we therefore strip out all the functionality in pnfs_roc_drain()
except the retrieval of the barrier state, and then rename the function
accordingly.

Reported-by: default avatarChristoph Hellwig <hch@infradead.org>
Fixes: 5c4a79fb ("Don't prevent layoutgets when doing return-on-close")
Signed-off-by: default avatarTrond Myklebust <trond.myklebust@primarydata.com>
parent 7e94d6c4
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment