Skip to content

Commit 0e27ffd

Browse files
committed
gfs2: Truncate address space when flipping GFS2_DIF_JDATA flag
jira LE-2349 Rebuild_History Non-Buildable kernel-4.18.0-553.40.1.el8_10 commit-author Andreas Gruenbacher <[email protected]> commit 7c9d922 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]> (cherry picked from commit 7c9d922) Signed-off-by: Jonathan Maple <[email protected]>
1 parent 59464a2 commit 0e27ffd

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
@@ -273,6 +273,7 @@ static int do_gfs2_set_flags(struct file *filp, u32 reqflags, u32 mask,
273273
error = filemap_fdatawait(inode->i_mapping);
274274
if (error)
275275
goto out;
276+
truncate_inode_pages(inode->i_mapping, 0);
276277
if (new_flags & GFS2_DIF_JDATA)
277278
gfs2_ordered_del_inode(ip);
278279
}

0 commit comments

Comments
 (0)