diff options
author | Jeff Layton <jlayton@redhat.com> | 2017-05-25 06:59:52 -0400 |
---|---|---|
committer | Steve French <smfrench@gmail.com> | 2017-07-05 19:51:04 -0500 |
commit | 97b37f241672c6b369486ac270de5ab14eb354ea (patch) | |
tree | 5e0991902ba303a2150447a64096778adc1c335e /fs/cifs/file.c | |
parent | 1955880b2ca6b81739c0550f92c639705ec6b327 (diff) | |
download | lwn-97b37f241672c6b369486ac270de5ab14eb354ea.tar.gz lwn-97b37f241672c6b369486ac270de5ab14eb354ea.zip |
cifs: set mapping error when page writeback fails in writepage or launder_pages
Signed-off-by: Jeff Layton <jlayton@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Jan Kara <jack@suse.cz>
Signed-off-by: Steve French <smfrench@gmail.com>
Diffstat (limited to 'fs/cifs/file.c')
-rw-r--r-- | fs/cifs/file.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/fs/cifs/file.c b/fs/cifs/file.c index fcef70602b27..dec70b304269 100644 --- a/fs/cifs/file.c +++ b/fs/cifs/file.c @@ -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); |