mirror of
https://github.com/raspberrypi/linux.git
synced 2025-12-06 01:49:46 +00:00
gfs2: Truncate address space when flipping GFS2_DIF_JDATA flag
commit 7c9d922380 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>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
7998e7efd1
commit
4dd57d1f0e
@@ -251,6 +251,7 @@ static int do_gfs2_set_flags(struct inode *inode, u32 reqflags, u32 mask)
|
||||
error = filemap_fdatawait(inode->i_mapping);
|
||||
if (error)
|
||||
goto out;
|
||||
truncate_inode_pages(inode->i_mapping, 0);
|
||||
if (new_flags & GFS2_DIF_JDATA)
|
||||
gfs2_ordered_del_inode(ip);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user