pNFS: Always set NFS_LAYOUT_RETURN_REQUESTED with lo->plh_return_iomode
authorTrond Myklebust <trond.myklebust@primarydata.com>
Mon, 15 Feb 2016 17:56:17 +0000 (12:56 -0500)
committerTrond Myklebust <trond.myklebust@primarydata.com>
Mon, 15 Feb 2016 18:03:30 +0000 (13:03 -0500)
When setting the layout return mode, we must always also set the
NFS_LAYOUT_RETURN_REQUESTED flag to ensure that we send a layoutreturn.
Otherwise pnfs_error_mark_layout_for_return() could set the mode, but
fail to send the layoutreturn because another is already in flight.

Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
fs/nfs/pnfs.c

index 8d9fa4e40e89c7579ae336c45dcd5a29f943c6bf..5064f23ca8ccfb24ef60472f0694c23f2f9af895 100644 (file)
@@ -1738,6 +1738,7 @@ pnfs_set_plh_return_iomode(struct pnfs_layout_hdr *lo, enum pnfs_iomode iomode)
        if (lo->plh_return_iomode != 0)
                iomode = IOMODE_ANY;
        lo->plh_return_iomode = iomode;
+       set_bit(NFS_LAYOUT_RETURN_REQUESTED, &lo->plh_flags);
 }
 
 /**
@@ -1777,8 +1778,6 @@ pnfs_mark_matching_lsegs_return(struct pnfs_layout_hdr *lo,
                        remaining++;
                        set_bit(NFS_LSEG_LAYOUTRETURN, &lseg->pls_flags);
                        pnfs_set_plh_return_iomode(lo, return_range->iomode);
-                       set_bit(NFS_LAYOUT_RETURN_REQUESTED,
-                                       &lo->plh_flags);
                }
        return remaining;
 }