Skip to content

Commit 2a40a14

Browse files
Andreas Gruenbachergregkh
authored andcommitted
gfs2: Truncate address space when flipping GFS2_DIF_JDATA flag
commit 7c9d9223802fbed4dee1ae301661bf346964c9d2 upstream. 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]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 754df8c commit 2a40a14

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
@@ -250,6 +250,7 @@ static int do_gfs2_set_flags(struct inode *inode, u32 reqflags, u32 mask)
250250
error = filemap_fdatawait(inode->i_mapping);
251251
if (error)
252252
goto out;
253+
truncate_inode_pages(inode->i_mapping, 0);
253254
if (new_flags & GFS2_DIF_JDATA)
254255
gfs2_ordered_del_inode(ip);
255256
}

0 commit comments

Comments
 (0)