Skip to content

Commit

Permalink
gfs2: Fix iomap buffered write support for journaled files
Browse files Browse the repository at this point in the history
Commit 64bc06b broke buffered writes to journaled files (chattr
+j): we'll try to journal the buffer heads of the page being written to
in gfs2_iomap_journaled_page_done.  However, the iomap code no longer
creates buffer heads, so we'll BUG() in gfs2_page_add_databufs.  Fix
that by creating buffer heads ourself when needed.

Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
  • Loading branch information
Andreas Gruenbacher committed Oct 9, 2018
1 parent 0854ba5 commit dc480fe
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions fs/gfs2/bmap.c
Original file line number Diff line number Diff line change
Expand Up @@ -975,6 +975,10 @@ static void gfs2_iomap_journaled_page_done(struct inode *inode, loff_t pos,
{
struct gfs2_inode *ip = GFS2_I(inode);

if (!page_has_buffers(page)) {
create_empty_buffers(page, inode->i_sb->s_blocksize,
(1 << BH_Dirty)|(1 << BH_Uptodate));
}
gfs2_page_add_databufs(ip, page, offset_in_page(pos), copied);
}

Expand Down

0 comments on commit dc480fe

Please sign in to comment.