aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfs/pnfs.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/nfs/pnfs.c')
-rw-r--r--fs/nfs/pnfs.c21
1 files changed, 13 insertions, 8 deletions
diff --git a/fs/nfs/pnfs.c b/fs/nfs/pnfs.c
index 6be70f622b62..48ac5aad6258 100644
--- a/fs/nfs/pnfs.c
+++ b/fs/nfs/pnfs.c
@@ -1181,7 +1181,7 @@ pnfs_update_layout(struct inode *ino,
1181 struct nfs_client *clp = server->nfs_client; 1181 struct nfs_client *clp = server->nfs_client;
1182 struct pnfs_layout_hdr *lo; 1182 struct pnfs_layout_hdr *lo;
1183 struct pnfs_layout_segment *lseg = NULL; 1183 struct pnfs_layout_segment *lseg = NULL;
1184 bool first = false; 1184 bool first;
1185 1185
1186 if (!pnfs_enabled_sb(NFS_SERVER(ino))) 1186 if (!pnfs_enabled_sb(NFS_SERVER(ino)))
1187 goto out; 1187 goto out;
@@ -1215,10 +1215,9 @@ pnfs_update_layout(struct inode *ino,
1215 goto out_unlock; 1215 goto out_unlock;
1216 atomic_inc(&lo->plh_outstanding); 1216 atomic_inc(&lo->plh_outstanding);
1217 1217
1218 if (list_empty(&lo->plh_segs)) 1218 first = list_empty(&lo->plh_layouts) ? true : false;
1219 first = true;
1220
1221 spin_unlock(&ino->i_lock); 1219 spin_unlock(&ino->i_lock);
1220
1222 if (first) { 1221 if (first) {
1223 /* The lo must be on the clp list if there is any 1222 /* The lo must be on the clp list if there is any
1224 * chance of a CB_LAYOUTRECALL(FILE) coming in. 1223 * chance of a CB_LAYOUTRECALL(FILE) coming in.
@@ -1422,13 +1421,15 @@ EXPORT_SYMBOL_GPL(pnfs_generic_pg_test);
1422 1421
1423int pnfs_write_done_resend_to_mds(struct inode *inode, 1422int pnfs_write_done_resend_to_mds(struct inode *inode,
1424 struct list_head *head, 1423 struct list_head *head,
1425 const struct nfs_pgio_completion_ops *compl_ops) 1424 const struct nfs_pgio_completion_ops *compl_ops,
1425 struct nfs_direct_req *dreq)
1426{ 1426{
1427 struct nfs_pageio_descriptor pgio; 1427 struct nfs_pageio_descriptor pgio;
1428 LIST_HEAD(failed); 1428 LIST_HEAD(failed);
1429 1429
1430 /* Resend all requests through the MDS */ 1430 /* Resend all requests through the MDS */
1431 nfs_pageio_init_write(&pgio, inode, FLUSH_STABLE, compl_ops); 1431 nfs_pageio_init_write(&pgio, inode, FLUSH_STABLE, compl_ops);
1432 pgio.pg_dreq = dreq;
1432 while (!list_empty(head)) { 1433 while (!list_empty(head)) {
1433 struct nfs_page *req = nfs_list_entry(head->next); 1434 struct nfs_page *req = nfs_list_entry(head->next);
1434 1435
@@ -1463,7 +1464,8 @@ static void pnfs_ld_handle_write_error(struct nfs_write_data *data)
1463 if (!test_and_set_bit(NFS_IOHDR_REDO, &hdr->flags)) 1464 if (!test_and_set_bit(NFS_IOHDR_REDO, &hdr->flags))
1464 data->task.tk_status = pnfs_write_done_resend_to_mds(hdr->inode, 1465 data->task.tk_status = pnfs_write_done_resend_to_mds(hdr->inode,
1465 &hdr->pages, 1466 &hdr->pages,
1466 hdr->completion_ops); 1467 hdr->completion_ops,
1468 hdr->dreq);
1467} 1469}
1468 1470
1469/* 1471/*
@@ -1578,13 +1580,15 @@ EXPORT_SYMBOL_GPL(pnfs_generic_pg_writepages);
1578 1580
1579int pnfs_read_done_resend_to_mds(struct inode *inode, 1581int pnfs_read_done_resend_to_mds(struct inode *inode,
1580 struct list_head *head, 1582 struct list_head *head,
1581 const struct nfs_pgio_completion_ops *compl_ops) 1583 const struct nfs_pgio_completion_ops *compl_ops,
1584 struct nfs_direct_req *dreq)
1582{ 1585{
1583 struct nfs_pageio_descriptor pgio; 1586 struct nfs_pageio_descriptor pgio;
1584 LIST_HEAD(failed); 1587 LIST_HEAD(failed);
1585 1588
1586 /* Resend all requests through the MDS */ 1589 /* Resend all requests through the MDS */
1587 nfs_pageio_init_read(&pgio, inode, compl_ops); 1590 nfs_pageio_init_read(&pgio, inode, compl_ops);
1591 pgio.pg_dreq = dreq;
1588 while (!list_empty(head)) { 1592 while (!list_empty(head)) {
1589 struct nfs_page *req = nfs_list_entry(head->next); 1593 struct nfs_page *req = nfs_list_entry(head->next);
1590 1594
@@ -1615,7 +1619,8 @@ static void pnfs_ld_handle_read_error(struct nfs_read_data *data)
1615 if (!test_and_set_bit(NFS_IOHDR_REDO, &hdr->flags)) 1619 if (!test_and_set_bit(NFS_IOHDR_REDO, &hdr->flags))
1616 data->task.tk_status = pnfs_read_done_resend_to_mds(hdr->inode, 1620 data->task.tk_status = pnfs_read_done_resend_to_mds(hdr->inode,
1617 &hdr->pages, 1621 &hdr->pages,
1618 hdr->completion_ops); 1622 hdr->completion_ops,
1623 hdr->dreq);
1619} 1624}
1620 1625
1621/* 1626/*