NFSv4.1: Fall back to ordinary i/o through the mds if we have no layout segment
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
diff --git a/fs/nfs/pnfs.c b/fs/nfs/pnfs.c
index 69a0c3f..cc807fe 100644
--- a/fs/nfs/pnfs.c
+++ b/fs/nfs/pnfs.c
@@ -1066,6 +1066,10 @@
req->wb_bytes,
IOMODE_READ,
GFP_KERNEL);
+ /* If no lseg, fall back to read through mds */
+ if (pgio->pg_lseg == NULL)
+ nfs_pageio_init_read_mds(pgio, pgio->pg_inode);
+
}
EXPORT_SYMBOL_GPL(pnfs_generic_pg_init_read);
@@ -1080,6 +1084,9 @@
req->wb_bytes,
IOMODE_RW,
GFP_NOFS);
+ /* If no lseg, fall back to write through mds */
+ if (pgio->pg_lseg == NULL)
+ nfs_pageio_init_write_mds(pgio, pgio->pg_inode, pgio->pg_ioflags);
}
EXPORT_SYMBOL_GPL(pnfs_generic_pg_init_write);