Skip to content

Commit 2a40a14

Browse files
Andreas Gruenbachergregkh
authored andcommitted
gfs2: Truncate address space when flipping GFS2_DIF_JDATA flag
commit 7c9d922 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 <huk23@m.fudan.edu.cn>, Jiaji Qin <jjtan24@m.fudan.edu.cn> Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 754df8c commit 2a40a14

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

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)