Skip to content

Commit 6e33017

Browse files
Darrick J. Wongcmaiolino
authored andcommitted
xfs: fix data fork format filtering during inode repair
Coverity noticed that xrep_dinode_bad_metabt_fork never runs because XFS_DINODE_FMT_META_BTREE is always filtered out in the mode selection switch of xrep_dinode_check_dfork. Metadata btrees are allowed only in the data forks of regular files, so add this case explicitly. I guess this got fubard during a refactoring prior to 6.13 and I didn't notice until now. :/ Coverity-id: 1617714 Signed-off-by: "Darrick J. Wong" <djwong@kernel.org> Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Carlos Maiolino <cem@kernel.org>
1 parent 66314e9 commit 6e33017

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

fs/xfs/scrub/inode_repair.c

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1055,9 +1055,17 @@ xrep_dinode_check_dfork(
10551055
return true;
10561056
break;
10571057
case S_IFREG:
1058-
if (fmt == XFS_DINODE_FMT_LOCAL)
1058+
switch (fmt) {
1059+
case XFS_DINODE_FMT_LOCAL:
10591060
return true;
1060-
fallthrough;
1061+
case XFS_DINODE_FMT_EXTENTS:
1062+
case XFS_DINODE_FMT_BTREE:
1063+
case XFS_DINODE_FMT_META_BTREE:
1064+
break;
1065+
default:
1066+
return true;
1067+
}
1068+
break;
10611069
case S_IFLNK:
10621070
case S_IFDIR:
10631071
switch (fmt) {

0 commit comments

Comments
 (0)