Commit 5b19d284 authored by Jaegeuk Kim's avatar Jaegeuk Kim

f2fs: avoid fsync() failure caused by EAGAIN in writepage()

pageout() in MM traslates EAGAIN, so calls handle_write_error()
 -> mapping_set_error() -> set_bit(AS_EIO, ...).
 file_write_and_wait_range() will see EIO error, which is critical
 to return value of fsync() followed by atomic_write failure to user.
Signed-off-by: default avatarJaegeuk Kim <jaegeuk@kernel.org>
parent 17c50035
...@@ -1904,7 +1904,13 @@ static int __write_data_page(struct page *page, bool *submitted, ...@@ -1904,7 +1904,13 @@ static int __write_data_page(struct page *page, bool *submitted,
redirty_out: redirty_out:
redirty_page_for_writepage(wbc, page); redirty_page_for_writepage(wbc, page);
if (!err) /*
* pageout() in MM traslates EAGAIN, so calls handle_write_error()
* -> mapping_set_error() -> set_bit(AS_EIO, ...).
* file_write_and_wait_range() will see EIO error, which is critical
* to return value of fsync() followed by atomic_write failure to user.
*/
if (!err || wbc->for_reclaim)
return AOP_WRITEPAGE_ACTIVATE; return AOP_WRITEPAGE_ACTIVATE;
unlock_page(page); unlock_page(page);
return err; return err;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment