From: Tom Haynes <thomas.haynes@primarydata.com>
To: Trond Myklebust <trond.myklebust@primarydata.com>
Cc: Linux NFS Mailing list <linux-nfs@vger.kernel.org>,
Anna Schumaker <anna.schumaker@netapp.com>
Subject: [V2 2/3] nfs/flexfiles: Use the layout segment for reading unless it a IOMODE_RW and reading is disabled
Date: Wed, 25 May 2016 07:31:13 -0700 [thread overview]
Message-ID: <1464186674-104401-3-git-send-email-loghyr@primarydata.com> (raw)
In-Reply-To: <1464186674-104401-1-git-send-email-loghyr@primarydata.com>
Signed-off-by: Tom Haynes <loghyr@primarydata.com>
---
fs/nfs/flexfilelayout/flexfilelayout.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/fs/nfs/flexfilelayout/flexfilelayout.c b/fs/nfs/flexfilelayout/flexfilelayout.c
index 40bccb2..a7aeb74 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,
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,
@@ -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;
--
1.8.3.1
next prev parent reply other threads:[~2016-05-25 14:31 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-05-25 14:31 [V2 0/3] FF_FLAGS_NO_READ_IO Tom Haynes
2016-05-25 14:31 ` [V2 1/3] nfs/flexfiles: Helper function to detect FF_FLAGS_NO_READ_IO Tom Haynes
2016-05-25 14:31 ` Tom Haynes [this message]
2016-05-25 14:31 ` [V2 3/3] pnfs: pnfs_update_layout needs to consider if strict iomode checking is on Tom Haynes
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1464186674-104401-3-git-send-email-loghyr@primarydata.com \
--to=thomas.haynes@primarydata.com \
--cc=anna.schumaker@netapp.com \
--cc=linux-nfs@vger.kernel.org \
--cc=trond.myklebust@primarydata.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).