Skip to content

Commit ee38e6b

Browse files
Andreas Gruenbachermehmetb0
Andreas Gruenbacher
authored andcommitted
gfs2: Truncate address space when flipping GFS2_DIF_JDATA flag
BugLink: https://bugs.launchpad.net/bugs/2098441 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]> Signed-off-by: Noah Wager <[email protected]> Signed-off-by: Koichiro Den <[email protected]>
1 parent cf45860 commit ee38e6b

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
@@ -257,6 +257,7 @@ static int do_gfs2_set_flags(struct inode *inode, u32 reqflags, u32 mask,
257257
error = filemap_fdatawait(inode->i_mapping);
258258
if (error)
259259
goto out;
260+
truncate_inode_pages(inode->i_mapping, 0);
260261
if (new_flags & GFS2_DIF_JDATA)
261262
gfs2_ordered_del_inode(ip);
262263
}

0 commit comments

Comments
 (0)