]> Git Repo - linux.git/commitdiff
gfs2: Truncate address space when flipping GFS2_DIF_JDATA flag
authorAndreas Gruenbacher <[email protected]>
Mon, 13 Jan 2025 18:31:28 +0000 (19:31 +0100)
committerAndreas Gruenbacher <[email protected]>
Tue, 14 Jan 2025 17:54:08 +0000 (18:54 +0100)
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]>
fs/gfs2/file.c

index 1e73cf87ff88b14ca7b2860624b186100d34f269..c9bb3be21d2ba7934581b7f1be358b4eee14bd91 100644 (file)
@@ -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);
        }
This page took 0.057855 seconds and 4 git commands to generate.