Skip to content

Commit d3039c0

Browse files
AstralBobAndreas Gruenbacher
authored andcommitted
Revert "gfs2: Ignore journal log writes for jdata holes"
This reverts commit b2a846d. That commit changed the behavior of function gfs2_block_map to return -ENODATA in cases where a hole (IOMAP_HOLE) is encountered and create is false. While that fixed the intended problem for jdata, it also broke other callers of gfs2_block_map such as some jdata block reads. Before the patch, an encountered hole would be skipped and the buffer seen as unmapped by the caller. The patch changed the behavior to return -ENODATA, which is interpreted as an error by the caller. The -ENODATA return code should be restricted to the specific case where jdata holes are encountered during ail1 writes. That will be done in a later patch. Signed-off-by: Bob Peterson <rpeterso@redhat.com> Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
1 parent bc92381 commit d3039c0

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

fs/gfs2/bmap.c

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1301,12 +1301,8 @@ int gfs2_block_map(struct inode *inode, sector_t lblock,
13011301
trace_gfs2_bmap(ip, bh_map, lblock, create, 1);
13021302

13031303
ret = gfs2_iomap_get(inode, pos, length, flags, &iomap, &mp);
1304-
if (!ret && iomap.type == IOMAP_HOLE) {
1305-
if (create)
1306-
ret = gfs2_iomap_alloc(inode, &iomap, &mp);
1307-
else
1308-
ret = -ENODATA;
1309-
}
1304+
if (create && !ret && iomap.type == IOMAP_HOLE)
1305+
ret = gfs2_iomap_alloc(inode, &iomap, &mp);
13101306
release_metapath(&mp);
13111307
if (ret)
13121308
goto out;

0 commit comments

Comments
 (0)