mirror of
https://github.com/torvalds/linux.git
synced 2026-03-13 21:26:14 +01:00
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: 5eb4cb18e4 ("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>
This commit is contained in:
parent
94014a23e9
commit
75690e5fdd
1 changed files with 14 additions and 2 deletions
|
|
@ -314,6 +314,18 @@ xfs_rgno_mark_sick(
|
|||
xfs_rtgroup_put(rtg);
|
||||
}
|
||||
|
||||
static inline void xfs_inode_report_fserror(struct xfs_inode *ip)
|
||||
{
|
||||
/* Report metadata inodes as general filesystem corruption */
|
||||
if (xfs_is_internal_inode(ip)) {
|
||||
fserror_report_metadata(ip->i_mount->m_super, -EFSCORRUPTED,
|
||||
GFP_NOFS);
|
||||
return;
|
||||
}
|
||||
|
||||
fserror_report_file_metadata(VFS_I(ip), -EFSCORRUPTED, GFP_NOFS);
|
||||
}
|
||||
|
||||
/* Mark the unhealthy parts of an inode. */
|
||||
void
|
||||
xfs_inode_mark_sick(
|
||||
|
|
@ -339,7 +351,7 @@ xfs_inode_mark_sick(
|
|||
inode_state_clear(VFS_I(ip), I_DONTCACHE);
|
||||
spin_unlock(&VFS_I(ip)->i_lock);
|
||||
|
||||
fserror_report_file_metadata(VFS_I(ip), -EFSCORRUPTED, GFP_NOFS);
|
||||
xfs_inode_report_fserror(ip);
|
||||
if (mask)
|
||||
xfs_healthmon_report_inode(ip, XFS_HEALTHMON_SICK, old_mask,
|
||||
mask);
|
||||
|
|
@ -371,7 +383,7 @@ xfs_inode_mark_corrupt(
|
|||
inode_state_clear(VFS_I(ip), I_DONTCACHE);
|
||||
spin_unlock(&VFS_I(ip)->i_lock);
|
||||
|
||||
fserror_report_file_metadata(VFS_I(ip), -EFSCORRUPTED, GFP_NOFS);
|
||||
xfs_inode_report_fserror(ip);
|
||||
if (mask)
|
||||
xfs_healthmon_report_inode(ip, XFS_HEALTHMON_CORRUPT, old_mask,
|
||||
mask);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue