]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
gfs2: Fix case in which ail writes are done to jdata holes
authorBob Peterson <rpeterso@redhat.com>
Thu, 12 Nov 2020 16:02:48 +0000 (10:02 -0600)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 24 Nov 2020 12:38:54 +0000 (13:38 +0100)
commitb950dcc0e1660b6d731c64fde0c0583460c27f70
tree6f1d0ca7e4d2ee0446d49205e0a05792c49c5059
parent72d9927b7bdc51ebdac7ff8e65fd7a9ca30f248e
gfs2: Fix case in which ail writes are done to jdata holes

[ Upstream commit 4e79e3f08e576acd51dffb4520037188703238b3 ]

Patch b2a846dbef4e ("gfs2: Ignore journal log writes for jdata holes")
tried (unsuccessfully) to fix a case in which writes were done to jdata
blocks, the blocks are sent to the ail list, then a punch_hole or truncate
operation caused the blocks to be freed. In other words, the ail items
are for jdata holes. Before b2a846dbef4e, the jdata hole caused function
gfs2_block_map to return -EIO, which was eventually interpreted as an
IO error to the journal, and then withdraw.

This patch changes function gfs2_get_block_noalloc, which is only used
for jdata writes, so it returns -ENODATA rather than -EIO, and when
-ENODATA is returned to gfs2_ail1_start_one, the error is ignored.
We can safely ignore it because gfs2_ail1_start_one is only called
when the jdata pages have already been written and truncated, so the
ail1 content no longer applies.

Signed-off-by: Bob Peterson <rpeterso@redhat.com>
Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
fs/gfs2/aops.c
fs/gfs2/log.c