Skip to content

Commit

Permalink
pNFS: Don't clear the layout stateid if a layout return is outstanding
Browse files Browse the repository at this point in the history
If we no longer hold any layout segments, we're normally expected to
consider the layout stateid to be invalid. However we cannot assume this
if we're about to, or in the process of sending a layoutreturn.

Fixes: 334a8f3 ("pNFS: Don't forget the layout stateid if...")
Signed-off-by: Trond Myklebust <[email protected]>
Cc: [email protected] # v4.8+
  • Loading branch information
trondmypd committed Dec 1, 2016
1 parent 54e4a0d commit 7b65099
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion fs/nfs/pnfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -411,7 +411,9 @@ pnfs_layout_remove_lseg(struct pnfs_layout_hdr *lo,
list_del_init(&lseg->pls_list);
/* Matched by pnfs_get_layout_hdr in pnfs_layout_insert_lseg */
atomic_dec(&lo->plh_refcount);
if (list_empty(&lo->plh_segs)) {
if (list_empty(&lo->plh_segs) &&
!test_bit(NFS_LAYOUT_RETURN_REQUESTED, &lo->plh_flags) &&
!test_bit(NFS_LAYOUT_RETURN, &lo->plh_flags)) {
if (atomic_read(&lo->plh_outstanding) == 0)
set_bit(NFS_LAYOUT_INVALID_STID, &lo->plh_flags);
clear_bit(NFS_LAYOUT_BULK_RECALL, &lo->plh_flags);
Expand Down

0 comments on commit 7b65099

Please sign in to comment.