summaryrefslogtreecommitdiff
path: root/fs
diff options
context:
space:
mode:
authorAndreas Gruenbacher <agruenba@redhat.com>2025-01-13 19:31:28 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2025-02-01 17:21:22 +0100
commit5bb1fd0855bb0abc7d97e44758d6ffed7882d2d0 (patch)
tree0927b5f6f15308d4498850099cf5729142db4ac0 /fs
parentffd294d346d185b70e28b1a28abe367bbfe53c04 (diff)
downloadlinux-5bb1fd0855bb0abc7d97e44758d6ffed7882d2d0.tar.gz
linux-5bb1fd0855bb0abc7d97e44758d6ffed7882d2d0.tar.bz2
linux-5bb1fd0855bb0abc7d97e44758d6ffed7882d2d0.zip
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 <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>
Diffstat (limited to 'fs')
-rw-r--r--fs/gfs2/file.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/fs/gfs2/file.c b/fs/gfs2/file.c
index 1e73cf87ff88..c9bb3be21d2b 100644
--- a/fs/gfs2/file.c
+++ b/fs/gfs2/file.c
@@ -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);
}