summaryrefslogtreecommitdiffstats
path: root/fs/nfs/filelayout
diff options
context:
space:
mode:
authorTrond Myklebust <trond.myklebust@primarydata.com>2017-04-25 10:56:19 -0400
committerTrond Myklebust <trond.myklebust@primarydata.com>2017-04-25 10:56:19 -0400
commitb3230e80a6d115d2eb50fe3f4794ad04d84766de (patch)
treec0b55ff70d1643c37656e44b87d9f18e3256b58f /fs/nfs/filelayout
parentf30cb757f680f965ba8a2e53cb3588052a01aeb5 (diff)
downloadlinux-stable-b3230e80a6d115d2eb50fe3f4794ad04d84766de.tar.gz
linux-stable-b3230e80a6d115d2eb50fe3f4794ad04d84766de.tar.bz2
linux-stable-b3230e80a6d115d2eb50fe3f4794ad04d84766de.zip
pNFS: Ensure we check layout segment validity in the pg_init() callback
If we have a layout segment cached in pgio->pg_lseg, we should check it for validity before reusing it in a new RPC request. Otherwise, if we recoalesce, we can end up looping forever. Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
Diffstat (limited to 'fs/nfs/filelayout')
-rw-r--r--fs/nfs/filelayout/filelayout.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/nfs/filelayout/filelayout.c b/fs/nfs/filelayout/filelayout.c
index acd30baca461..d4174da89302 100644
--- a/fs/nfs/filelayout/filelayout.c
+++ b/fs/nfs/filelayout/filelayout.c
@@ -933,6 +933,7 @@ static void
filelayout_pg_init_read(struct nfs_pageio_descriptor *pgio,
struct nfs_page *req)
{
+ pnfs_generic_pg_check_layout(pgio);
if (!pgio->pg_lseg) {
pgio->pg_lseg = fl_pnfs_update_layout(pgio->pg_inode,
req->wb_context,
@@ -959,6 +960,7 @@ filelayout_pg_init_write(struct nfs_pageio_descriptor *pgio,
struct nfs_commit_info cinfo;
int status;
+ pnfs_generic_pg_check_layout(pgio);
if (!pgio->pg_lseg) {
pgio->pg_lseg = fl_pnfs_update_layout(pgio->pg_inode,
req->wb_context,