flexfiles: remove pointless setting of NFS_LAYOUT_RETURN_REQUESTED
authorJeff Layton <jlayton@poochiereds.net>
Tue, 17 May 2016 16:28:43 +0000 (12:28 -0400)
committerAnna Schumaker <Anna.Schumaker@Netapp.com>
Tue, 17 May 2016 19:48:11 +0000 (15:48 -0400)
Setting just the NFS_LAYOUT_RETURN_REQUESTED flag doesn't do anything,
unless there are lsegs that are also being marked for return. At the
point where that happens this flag is also set, so these set_bit calls
don't do anything useful.

Signed-off-by: Jeff Layton <jeff.layton@primarydata.com>
Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
fs/nfs/flexfilelayout/flexfilelayout.c
fs/nfs/flexfilelayout/flexfilelayoutdev.c

index 3bac2094c175babb4b99357bf50fa1cba034734a..40bccb2c06d16f8a614b6b8d35662a33d9eedc83 100644 (file)
@@ -1270,8 +1270,6 @@ static int ff_layout_read_done_cb(struct rpc_task *task,
                                        hdr->pgio_mirror_idx + 1,
                                        &hdr->pgio_mirror_idx))
                        goto out_eagain;
-               set_bit(NFS_LAYOUT_RETURN_REQUESTED,
-                       &hdr->lseg->pls_layout->plh_flags);
                pnfs_read_resend_pnfs(hdr);
                return task->tk_status;
        case -NFS4ERR_RESET_TO_MDS:
index 8242ab327feed0dc87f8824254e15c37b4f5c44a..bb598923b2efd489682f5268ea4055f22fa7059c 100644 (file)
@@ -394,13 +394,7 @@ nfs4_ff_layout_prepare_ds(struct pnfs_layout_segment *lseg, u32 ds_idx,
                                         mirror, lseg->pls_range.offset,
                                         lseg->pls_range.length, NFS4ERR_NXIO,
                                         OP_ILLEGAL, GFP_NOIO);
-               if (!fail_return) {
-                       if (ff_layout_has_available_ds(lseg))
-                               set_bit(NFS_LAYOUT_RETURN_REQUESTED,
-                                       &lseg->pls_layout->plh_flags);
-                       else
-                               pnfs_error_mark_layout_for_return(ino, lseg);
-               } else
+               if (fail_return || !ff_layout_has_available_ds(lseg))
                        pnfs_error_mark_layout_for_return(ino, lseg);
                ds = NULL;
        }