Skip to content

Commit fee5150

Browse files
author
Andreas Gruenbacher
committed
gfs2: Fix iomap buffered write support for journaled files (2)
It turns out that the fix in commit 6636c3cc56 is bad; the assertion that the iomap code no longer creates buffer heads is incorrect for filesystems that set the IOMAP_F_BUFFER_HEAD flag. Instead, what's happening is that gfs2_iomap_begin_write treats all files that have the jdata flag set as journaled files, which is incorrect as long as those files are inline ("stuffed"). We're handling stuffed files directly via the page cache, which is why we ended up with pages without buffer heads in gfs2_page_add_databufs. Fix this by handling stuffed journaled files correctly in gfs2_iomap_begin_write. This reverts commit 6636c3cc5690c11631e6366cf9a28fb99c8b25bb. Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
1 parent dc480fe commit fee5150

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

fs/gfs2/bmap.c

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -975,10 +975,6 @@ static void gfs2_iomap_journaled_page_done(struct inode *inode, loff_t pos,
975975
{
976976
struct gfs2_inode *ip = GFS2_I(inode);
977977

978-
if (!page_has_buffers(page)) {
979-
create_empty_buffers(page, inode->i_sb->s_blocksize,
980-
(1 << BH_Dirty)|(1 << BH_Uptodate));
981-
}
982978
gfs2_page_add_databufs(ip, page, offset_in_page(pos), copied);
983979
}
984980

@@ -1061,7 +1057,7 @@ static int gfs2_iomap_begin_write(struct inode *inode, loff_t pos,
10611057
}
10621058
}
10631059
release_metapath(&mp);
1064-
if (gfs2_is_jdata(ip))
1060+
if (!gfs2_is_stuffed(ip) && gfs2_is_jdata(ip))
10651061
iomap->page_done = gfs2_iomap_journaled_page_done;
10661062
return 0;
10671063

0 commit comments

Comments
 (0)