|
@@ -1880,15 +1880,28 @@ pnfs_try_to_read_data(struct nfs_pgio_header *hdr,
|
|
return trypnfs;
|
|
return trypnfs;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+/* Resend all requests through pnfs. */
|
|
|
|
+int pnfs_read_resend_pnfs(struct nfs_pgio_header *hdr)
|
|
|
|
+{
|
|
|
|
+ struct nfs_pageio_descriptor pgio;
|
|
|
|
+
|
|
|
|
+ nfs_pageio_init_read(&pgio, hdr->inode, false, hdr->completion_ops);
|
|
|
|
+ return nfs_pageio_resend(&pgio, hdr);
|
|
|
|
+}
|
|
|
|
+EXPORT_SYMBOL_GPL(pnfs_read_resend_pnfs);
|
|
|
|
+
|
|
static void
|
|
static void
|
|
pnfs_do_read(struct nfs_pageio_descriptor *desc, struct nfs_pgio_header *hdr)
|
|
pnfs_do_read(struct nfs_pageio_descriptor *desc, struct nfs_pgio_header *hdr)
|
|
{
|
|
{
|
|
const struct rpc_call_ops *call_ops = desc->pg_rpc_callops;
|
|
const struct rpc_call_ops *call_ops = desc->pg_rpc_callops;
|
|
struct pnfs_layout_segment *lseg = desc->pg_lseg;
|
|
struct pnfs_layout_segment *lseg = desc->pg_lseg;
|
|
enum pnfs_try_status trypnfs;
|
|
enum pnfs_try_status trypnfs;
|
|
|
|
+ int err = 0;
|
|
|
|
|
|
trypnfs = pnfs_try_to_read_data(hdr, call_ops, lseg);
|
|
trypnfs = pnfs_try_to_read_data(hdr, call_ops, lseg);
|
|
- if (trypnfs == PNFS_NOT_ATTEMPTED)
|
|
|
|
|
|
+ if (trypnfs == PNFS_TRY_AGAIN)
|
|
|
|
+ err = pnfs_read_resend_pnfs(hdr);
|
|
|
|
+ if (trypnfs == PNFS_NOT_ATTEMPTED || err)
|
|
pnfs_read_through_mds(desc, hdr);
|
|
pnfs_read_through_mds(desc, hdr);
|
|
}
|
|
}
|
|
|
|
|