summaryrefslogtreecommitdiff
path: root/fs/xfs/scrub/scrub.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/xfs/scrub/scrub.c')
-rw-r--r--fs/xfs/scrub/scrub.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/fs/xfs/scrub/scrub.c b/fs/xfs/scrub/scrub.c
index 668f94aab100..27a0b3502200 100644
--- a/fs/xfs/scrub/scrub.c
+++ b/fs/xfs/scrub/scrub.c
@@ -170,7 +170,7 @@ xchk_teardown(
if (sc->ip) {
if (sc->ilock_flags)
xfs_iunlock(sc->ip, sc->ilock_flags);
- xfs_irele(sc->ip);
+ xchk_irele(sc, sc->ip);
sc->ip = NULL;
}
if (sc->flags & XREP_ATOMIC_EXCHANGE) {
@@ -743,7 +743,8 @@ xfs_scrubv_metadata(
* consider setting dontcache at the end.
*/
if (v->sv_type < XFS_SCRUB_TYPE_NR &&
- meta_scrub_ops[v->sv_type].type == ST_INODE)
+ meta_scrub_ops[v->sv_type].type == ST_INODE &&
+ !(vhead->svh_flags & XFS_SCRUB_VEC_IFLAG_RETAIN_INODES))
set_dontcache = true;
trace_xchk_scrubv_item(mp, vhead, v);
@@ -760,7 +761,7 @@ xfs_scrubv_metadata(
if (ip && (VFS_I(ip)->i_generation != vhead->svh_gen ||
(xfs_is_metadata_inode(ip) &&
!S_ISDIR(VFS_I(ip)->i_mode)))) {
- xfs_irele(ip);
+ __xchk_irele(ip, set_dontcache);
ip = NULL;
}
}
@@ -815,8 +816,6 @@ xfs_scrubv_metadata(
* If we're holding the only reference to this inode and the scan was
* clean, mark it dontcache so that we don't pollute the cache.
*/
- if (set_dontcache && atomic_read(&VFS_I(ip)->i_count) == 1)
- d_mark_dontcache(VFS_I(ip));
- xfs_irele(ip);
+ __xchk_irele(ip, set_dontcache);
return error;
}