hulk inclusion category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/IAJ2ZJ
--------------------------------
This reverts commit 812ffba3b83c86bba38fd087fa41fe2f08f7acb6.
Commit 812ffba3b83c ("NFS: Don't interrupt file writeout due to fatal errors") tries to keep writing back when hit fatal errors. However, since page->mapping will be set as NULL in nfs_write_error_remove_page() and it will be used in nfs_create_request(), null-ptr-deref will be triggered if we don't stop it immediately.
Fixes: 812ffba3b83c ("NFS: Don't interrupt file writeout due to fatal errors") Signed-off-by: Li Lingfeng lilingfeng3@huawei.com --- fs/nfs/write.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/fs/nfs/write.c b/fs/nfs/write.c index e4b1ce488637..706ed79e23e2 100644 --- a/fs/nfs/write.c +++ b/fs/nfs/write.c @@ -662,7 +662,7 @@ static int nfs_page_async_flush(struct nfs_pageio_descriptor *pgio, return ret; out_launder: nfs_write_error_remove_page(req); - return 0; + return ret; }
static int nfs_do_writepage(struct page *page, struct writeback_control *wbc,