Skip to content

Commit 75690e5

Browse files
Darrick J. Wongcmaiolino
authored andcommitted
xfs: don't report metadata inodes to fserror
Internal metadata inodes are not exposed to userspace programs, so it makes no sense to pass them to the fserror functions (aka fsnotify). Instead, report metadata file problems as general filesystem corruption. Fixes: 5eb4cb1 ("xfs: convey metadata health events to the health monitor") Signed-off-by: "Darrick J. Wong" <djwong@kernel.org> Reviewed-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Carlos Maiolino <cmaiolino@redhat.com> Signed-off-by: Carlos Maiolino <cem@kernel.org>
1 parent 94014a2 commit 75690e5

1 file changed

Lines changed: 14 additions & 2 deletions

File tree

fs/xfs/xfs_health.c

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -314,6 +314,18 @@ xfs_rgno_mark_sick(
314314
xfs_rtgroup_put(rtg);
315315
}
316316

317+
static inline void xfs_inode_report_fserror(struct xfs_inode *ip)
318+
{
319+
/* Report metadata inodes as general filesystem corruption */
320+
if (xfs_is_internal_inode(ip)) {
321+
fserror_report_metadata(ip->i_mount->m_super, -EFSCORRUPTED,
322+
GFP_NOFS);
323+
return;
324+
}
325+
326+
fserror_report_file_metadata(VFS_I(ip), -EFSCORRUPTED, GFP_NOFS);
327+
}
328+
317329
/* Mark the unhealthy parts of an inode. */
318330
void
319331
xfs_inode_mark_sick(
@@ -339,7 +351,7 @@ xfs_inode_mark_sick(
339351
inode_state_clear(VFS_I(ip), I_DONTCACHE);
340352
spin_unlock(&VFS_I(ip)->i_lock);
341353

342-
fserror_report_file_metadata(VFS_I(ip), -EFSCORRUPTED, GFP_NOFS);
354+
xfs_inode_report_fserror(ip);
343355
if (mask)
344356
xfs_healthmon_report_inode(ip, XFS_HEALTHMON_SICK, old_mask,
345357
mask);
@@ -371,7 +383,7 @@ xfs_inode_mark_corrupt(
371383
inode_state_clear(VFS_I(ip), I_DONTCACHE);
372384
spin_unlock(&VFS_I(ip)->i_lock);
373385

374-
fserror_report_file_metadata(VFS_I(ip), -EFSCORRUPTED, GFP_NOFS);
386+
xfs_inode_report_fserror(ip);
375387
if (mask)
376388
xfs_healthmon_report_inode(ip, XFS_HEALTHMON_CORRUPT, old_mask,
377389
mask);

0 commit comments

Comments
 (0)