Skip to content

Commit

Permalink
nfs/flexfiles: Use the layout segment for reading unless it a IOMODE_…
Browse files Browse the repository at this point in the history
…RW and reading is disabled

Signed-off-by: Tom Haynes <loghyr@primarydata.com>
Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
  • Loading branch information
Tom Haynes authored and Anna Schumaker committed May 26, 2016
1 parent fb1084e commit 602c4cd
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions fs/nfs/flexfilelayout/flexfilelayout.c
Original file line number Diff line number Diff line change
Expand Up @@ -830,7 +830,8 @@ ff_layout_pg_init_read(struct nfs_pageio_descriptor *pgio,
int ds_idx;

/* Use full layout for now */
if (!pgio->pg_lseg) {
if (!pgio->pg_lseg || ff_layout_avoid_read_on_rw(pgio->pg_lseg)) {
pnfs_put_lseg(pgio->pg_lseg);
pgio->pg_lseg = pnfs_update_layout(pgio->pg_inode,
req->wb_context,
0,
Expand All @@ -840,9 +841,9 @@ ff_layout_pg_init_read(struct nfs_pageio_descriptor *pgio,
if (IS_ERR(pgio->pg_lseg)) {
pgio->pg_error = PTR_ERR(pgio->pg_lseg);
pgio->pg_lseg = NULL;
return;
}
}

/* If no lseg, fall back to read through mds */
if (pgio->pg_lseg == NULL)
goto out_mds;
Expand Down

0 comments on commit 602c4cd

Please sign in to comment.