aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTom Haynes <thomas.haynes@primarydata.com>2016-05-25 10:31:13 -0400
committerAnna Schumaker <Anna.Schumaker@Netapp.com>2016-05-26 08:40:51 -0400
commit602c4cd452d93355166daf8a662c84a5f85d2856 (patch)
treea856f19f99a0c69144a685e5ab0d7bc7e80c88cf
parentfb1084e3320555eca0fb86c9eaad5429ee761282 (diff)
nfs/flexfiles: Use the layout segment for reading unless it a IOMODE_RW and reading is disabled
Signed-off-by: Tom Haynes <loghyr@primarydata.com> Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
-rw-r--r--fs/nfs/flexfilelayout/flexfilelayout.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/fs/nfs/flexfilelayout/flexfilelayout.c b/fs/nfs/flexfilelayout/flexfilelayout.c
index 40bccb2c06d1..a7aeb7407252 100644
--- a/fs/nfs/flexfilelayout/flexfilelayout.c
+++ b/fs/nfs/flexfilelayout/flexfilelayout.c
@@ -830,7 +830,8 @@ ff_layout_pg_init_read(struct nfs_pageio_descriptor *pgio,
830 int ds_idx; 830 int ds_idx;
831 831
832 /* Use full layout for now */ 832 /* Use full layout for now */
833 if (!pgio->pg_lseg) { 833 if (!pgio->pg_lseg || ff_layout_avoid_read_on_rw(pgio->pg_lseg)) {
834 pnfs_put_lseg(pgio->pg_lseg);
834 pgio->pg_lseg = pnfs_update_layout(pgio->pg_inode, 835 pgio->pg_lseg = pnfs_update_layout(pgio->pg_inode,
835 req->wb_context, 836 req->wb_context,
836 0, 837 0,
@@ -840,9 +841,9 @@ ff_layout_pg_init_read(struct nfs_pageio_descriptor *pgio,
840 if (IS_ERR(pgio->pg_lseg)) { 841 if (IS_ERR(pgio->pg_lseg)) {
841 pgio->pg_error = PTR_ERR(pgio->pg_lseg); 842 pgio->pg_error = PTR_ERR(pgio->pg_lseg);
842 pgio->pg_lseg = NULL; 843 pgio->pg_lseg = NULL;
843 return;
844 } 844 }
845 } 845 }
846
846 /* If no lseg, fall back to read through mds */ 847 /* If no lseg, fall back to read through mds */
847 if (pgio->pg_lseg == NULL) 848 if (pgio->pg_lseg == NULL)
848 goto out_mds; 849 goto out_mds;