Skip to content

Commit 62e2a47

Browse files
author
Trond Myklebust
committed
NFS/pnfs: Fix a live lock between recalled layouts and layoutget
When the server is recalling a layout, we should ignore the count of outstanding layoutget calls, since the server is expected to return either NFS4ERR_RECALLCONFLICT or NFS4ERR_RETURNCONFLICT for as long as the recall is outstanding. Currently, we may end up livelocking, causing the layout to eventually be forcibly revoked. Fixes: bf0291d ("pNFS: Ensure LAYOUTGET and LAYOUTRETURN are properly serialised") Cc: [email protected] Signed-off-by: Trond Myklebust <[email protected]>
1 parent 78d4f34 commit 62e2a47

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

fs/nfs/pnfs.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1308,7 +1308,7 @@ pnfs_prepare_layoutreturn(struct pnfs_layout_hdr *lo,
13081308
enum pnfs_iomode *iomode)
13091309
{
13101310
/* Serialise LAYOUTGET/LAYOUTRETURN */
1311-
if (atomic_read(&lo->plh_outstanding) != 0)
1311+
if (atomic_read(&lo->plh_outstanding) != 0 && lo->plh_return_seq == 0)
13121312
return false;
13131313
if (test_and_set_bit(NFS_LAYOUT_RETURN_LOCK, &lo->plh_flags))
13141314
return false;

0 commit comments

Comments
 (0)