mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-13 14:24:11 +08:00
f2fs: avoid fsync() failure caused by EAGAIN in writepage()
[ Upstream commit 5b19d284f5
]
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: Jaegeuk Kim <jaegeuk@kernel.org>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
15239633dc
commit
4bbf1ce3a1
@ -1601,7 +1601,13 @@ out:
|
||||
|
||||
redirty_out:
|
||||
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;
|
||||
unlock_page(page);
|
||||
return err;
|
||||
|
Loading…
Reference in New Issue
Block a user