Skip to contentSkip to conversation

cifs: set mapping error when page writeback fails in writepage or launder_pages

PATCH Applied Jeff Layton 2 participants 2 messages May 25, 2017 – Jun 23, 2017

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 cifs: set mapping error when page writeback fails in writepage or launder_pages

---
 fs/cifs/file.c | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)
fs/cifs/file.c +7 -5
index 0fd081bd2a2f..5009860dbdc6 100644
@@ -2234,14 +2234,16 @@ cifs_writepage_locked(struct page *page, struct writeback_control *wbc)
 	set_page_writeback(page);
 retry_write:
 	rc = cifs_partialpagewrite(page, 0, PAGE_SIZE);
-	if (rc == -EAGAIN && wbc->sync_mode == WB_SYNC_ALL)
-		goto retry_write;
-	else if (rc == -EAGAIN)
+	if (rc == -EAGAIN) {
+		if (wbc->sync_mode == WB_SYNC_ALL)
+			goto retry_write;
 		redirty_page_for_writepage(wbc, page);
-	else if (rc != 0)
+	} else if (rc != 0) {
 		SetPageError(page);
-	else
+		mapping_set_error(page->mapping, rc);
+	} else {
 		SetPageUptodate(page);
+	}
 	end_page_writeback(page);
 	put_page(page);
 	free_xid(xid);
Signature · 1 line
2.9.4
Applied
#1 lore raw

merged into cifs-2.6.git for-next

Quoted 40 lines · Jeff Layton
---
 fs/cifs/file.c | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)
fs/cifs/file.c +7 -6
index 0fd081bd2a2f..5009860dbdc6 100644
@@ -2234,14 +2234,16 @@ cifs_writepage_locked(struct page *page, struct writeback_control *wbc)
        set_page_writeback(page);
 retry_write:
        rc = cifs_partialpagewrite(page, 0, PAGE_SIZE);
-       if (rc == -EAGAIN && wbc->sync_mode == WB_SYNC_ALL)
-               goto retry_write;
-       else if (rc == -EAGAIN)
+       if (rc == -EAGAIN) {
+               if (wbc->sync_mode == WB_SYNC_ALL)
+                       goto retry_write;
                redirty_page_for_writepage(wbc, page);
-       else if (rc != 0)
+       } else if (rc != 0) {
                SetPageError(page);
-       else
+               mapping_set_error(page->mapping, rc);
+       } else {
                SetPageUptodate(page);
+       }
        end_page_writeback(page);
        put_page(page);
        free_xid(xid);
--

2.9.4

--
To unsubscribe from this list: send the line "unsubscribe linux-cifs" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

Signature · 3 lines
Thanks,

Steve