iomap: pass writeback errors to the mapping
authorDarrick J. Wong <djwong@kernel.org>
Wed, 11 Aug 2021 01:32:55 +0000 (18:32 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 18 Sep 2021 11:40:29 +0000 (13:40 +0200)
commitfca514f25c4d714d80aac858986b33dd092fefaf
treee270131c394bd3f40a298e874bf67a0acb9f9720
parent49e2bcb7cf580f83fec96b29bf2b3774bdf1b930
iomap: pass writeback errors to the mapping

[ Upstream commit b69eea82d37d9ee7cfb3bf05103549dd4ed5ffc3 ]

Modern-day mapping_set_error has the ability to squash the usual
negative error code into something appropriate for long-term storage in
a struct address_space -- ENOSPC becomes AS_ENOSPC, and everything else
becomes EIO.  iomap squashes /everything/ to EIO, just as XFS did before
that, but this doesn't make sense.

Fix this by making it so that we can pass ENOSPC to userspace when
writeback fails due to space problems.

Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
fs/iomap/buffered-io.c