f2fs: avoid fsync() failure caused by EAGAIN in writepage()
authorJaegeuk Kim <jaegeuk@kernel.org>
Fri, 4 May 2018 06:26:02 +0000 (23:26 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 3 Aug 2018 05:50:37 +0000 (07:50 +0200)
commit4bbf1ce3a1e3efb6c746e0dbf5a5acb889b3b38b
treeb73ff4e7f1ccefd5b5bba1da41ae4e1fccadc70d
parent15239633dc559c22aea80b1627176d6bc181b2f7
f2fs: avoid fsync() failure caused by EAGAIN in writepage()

[ Upstream commit 5b19d284f5195a925dd015a6397bfce184097378 ]

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>
fs/f2fs/data.c