• Home
  • Raw
  • Download

Lines Matching +full:scrubber +full:- +full:done

1 // SPDX-License-Identifier: GPL-2.0-or-later
3 * Copyright (C) 2017-2023 Oracle. All Rights Reserved.
39 struct xfs_mount *mp = sc->mp; in xchk_setup_rtsummary()
48 error = xfile_create(descr, mp->m_rsumsize, &sc->xfile); in xchk_setup_rtsummary()
58 sc->buf = kvmalloc(mp->m_sb.sb_blocksize, XCHK_GFP_FLAGS); in xchk_setup_rtsummary()
59 if (!sc->buf) in xchk_setup_rtsummary()
60 return -ENOMEM; in xchk_setup_rtsummary()
62 error = xchk_install_live_inode(sc, mp->m_rsumip); in xchk_setup_rtsummary()
68 * careful to unlock it ourselves when we are done with the rtbitmap in xchk_setup_rtsummary()
72 xfs_ilock(mp->m_rbmip, XFS_ILOCK_SHARED | XFS_ILOCK_RTBITMAP); in xchk_setup_rtsummary()
87 return xfile_obj_load(sc->xfile, info, sizeof(xfs_suminfo_t), in xfsum_load()
97 return xfile_obj_store(sc->xfile, &info, sizeof(xfs_suminfo_t), in xfsum_store()
108 return xfile_obj_load(sc->xfile, info, nr_words << XFS_WORDLOG, in xfsum_copyout()
133 rbmoff = XFS_BITTOBLOCK(mp, rec->ar_startext); in xchk_rtsum_record_free()
134 lenlog = XFS_RTBLOCKLOG(rec->ar_extcount); in xchk_rtsum_record_free()
137 rtbno = rec->ar_startext * mp->m_sb.sb_rextsize; in xchk_rtsum_record_free()
138 rtlen = rec->ar_extcount * mp->m_sb.sb_rextsize; in xchk_rtsum_record_free()
141 xchk_ino_xref_set_corrupt(sc, mp->m_rbmip->i_ino); in xchk_rtsum_record_free()
142 return -EFSCORRUPTED; in xchk_rtsum_record_free()
151 trace_xchk_rtsum_record_free(mp, rec->ar_startext, rec->ar_extcount, in xchk_rtsum_record_free()
162 struct xfs_mount *mp = sc->mp; in xchk_rtsum_compute()
166 rtbmp_bytes = howmany_64(mp->m_sb.sb_rextents, NBBY); in xchk_rtsum_compute()
167 if (roundup_64(rtbmp_bytes, mp->m_sb.sb_blocksize) != in xchk_rtsum_compute()
168 mp->m_rbmip->i_disk_size) in xchk_rtsum_compute()
169 return -EFSCORRUPTED; in xchk_rtsum_compute()
171 return xfs_rtalloc_query_all(sc->mp, sc->tp, xchk_rtsum_record_free, in xchk_rtsum_compute()
180 struct xfs_mount *mp = sc->mp; in xchk_rtsum_compare()
187 for (off = 0; off < XFS_B_TO_FSB(mp, mp->m_rsumsize); off++) { in xchk_rtsum_compare()
192 if (sc->sm->sm_flags & XFS_SCRUB_OFLAG_CORRUPT) in xchk_rtsum_compare()
197 error = xfs_bmapi_read(mp->m_rsumip, off, 1, &map, &nmap, in xchk_rtsum_compare()
208 error = xfs_rtbuf_get(mp, sc->tp, off, 1, &bp); in xchk_rtsum_compare()
213 error = xfsum_copyout(sc, sumoff, sc->buf, mp->m_blockwsize); in xchk_rtsum_compare()
215 xfs_trans_brelse(sc->tp, bp); in xchk_rtsum_compare()
219 if (memcmp(bp->b_addr, sc->buf, in xchk_rtsum_compare()
220 mp->m_blockwsize << XFS_WORDLOG) != 0) in xchk_rtsum_compare()
223 xfs_trans_brelse(sc->tp, bp); in xchk_rtsum_compare()
224 sumoff += mp->m_blockwsize; in xchk_rtsum_compare()
235 struct xfs_mount *mp = sc->mp; in xchk_rtsummary()
238 /* Invoke the fork scrubber. */ in xchk_rtsummary()
240 if (error || (sc->sm->sm_flags & XFS_SCRUB_OFLAG_CORRUPT)) in xchk_rtsummary()
245 if (error == -EFSCORRUPTED) { in xchk_rtsummary()
250 xchk_ino_xref_set_corrupt(sc, mp->m_rbmip->i_ino); in xchk_rtsummary()
261 /* Unlock the rtbitmap since we're done with it. */ in xchk_rtsummary()
262 xfs_iunlock(mp->m_rbmip, XFS_ILOCK_SHARED | XFS_ILOCK_RTBITMAP); in xchk_rtsummary()