Skip to content

Commit 7c9d922

Browse files
author
Andreas Gruenbacher
committed
gfs2: Truncate address space when flipping GFS2_DIF_JDATA flag
Truncate an inode's address space when flipping the GFS2_DIF_JDATA flag: depending on that flag, the pages in the address space will either use buffer heads or iomap_folio_state structs, and we cannot mix the two. Reported-by: Kun Hu <[email protected]>, Jiaji Qin <[email protected]> Signed-off-by: Andreas Gruenbacher <[email protected]>
1 parent ead64b2 commit 7c9d922

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

fs/gfs2/file.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -251,6 +251,7 @@ static int do_gfs2_set_flags(struct inode *inode, u32 reqflags, u32 mask)
251251
error = filemap_fdatawait(inode->i_mapping);
252252
if (error)
253253
goto out;
254+
truncate_inode_pages(inode->i_mapping, 0);
254255
if (new_flags & GFS2_DIF_JDATA)
255256
gfs2_ordered_del_inode(ip);
256257
}

0 commit comments

Comments
 (0)