]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
gfs2: inode directory consistency checks
authorAndreas Gruenbacher <agruenba@redhat.com>
Thu, 26 Mar 2026 21:56:26 +0000 (22:56 +0100)
committerAndreas Gruenbacher <agruenba@redhat.com>
Tue, 7 Apr 2026 20:20:00 +0000 (22:20 +0200)
commitb89e487bfcbc172e686a547fec4bc4072035a73b
treed615e4dc6272e2ea7b7beef4b6347f55dfc42fc1
parentbb47cce7a1eea1d9d165260328270ddc39e19526
gfs2: inode directory consistency checks

In gfs2_dinode_in(), only allow directories to have the GFS2_DIF_EXHASH
flag set.  This will prevent other parts of the code from treating
regular inodes as directories based on the presence of that flag.

In sweep_bh_for_rgrps() and __gfs2_free_blocks(), check if the
GFS2_DIF_EXHASH flag is set instead of checking if i_depth is non-zero.
This matches what the directory code does.  (The i_depth checks were
introduced in commit 6d3117b412951 ("GFS2: Wipe directory hash table
metadata when deallocating a directory").)

Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
fs/gfs2/bmap.c
fs/gfs2/glops.c
fs/gfs2/rgrp.c