Lines Matching full:sc
34 struct xfs_scrub *sc) in xchk_setup_parent() argument
38 if (xchk_could_repair(sc)) { in xchk_setup_parent()
39 error = xrep_setup_parent(sc); in xchk_setup_parent()
44 return xchk_setup_inode_contents(sc, 0); in xchk_setup_parent()
52 struct xfs_scrub *sc; member
59 struct xfs_scrub *sc, in xchk_parent_actor() argument
72 if (!xchk_fblock_xref_process_error(sc, XFS_DATA_FORK, 0, &error)) in xchk_parent_actor()
75 if (sc->ip->i_ino == ino) in xchk_parent_actor()
78 if (xchk_should_terminate(spc->sc, &error)) in xchk_parent_actor()
114 struct xfs_scrub *sc, in xchk_parent_validate() argument
118 .sc = sc, in xchk_parent_validate()
121 struct xfs_mount *mp = sc->mp; in xchk_parent_validate()
128 if (sc->ip == mp->m_rootip) { in xchk_parent_validate()
129 if (sc->ip->i_ino != mp->m_sb.sb_rootino || in xchk_parent_validate()
130 sc->ip->i_ino != parent_ino) in xchk_parent_validate()
131 xchk_fblock_set_corrupt(sc, XFS_DATA_FORK, 0); in xchk_parent_validate()
136 if (sc->ip == mp->m_metadirip) { in xchk_parent_validate()
137 if (sc->ip->i_ino != mp->m_sb.sb_metadirino || in xchk_parent_validate()
138 sc->ip->i_ino != parent_ino) in xchk_parent_validate()
139 xchk_fblock_set_corrupt(sc, XFS_DATA_FORK, 0); in xchk_parent_validate()
144 if (sc->ip->i_ino == parent_ino) { in xchk_parent_validate()
145 xchk_fblock_set_corrupt(sc, XFS_DATA_FORK, 0); in xchk_parent_validate()
153 expected_nlink = VFS_I(sc->ip)->i_nlink == 0 ? 0 : 1; in xchk_parent_validate()
164 error = xchk_iget(sc, parent_ino, &dp); in xchk_parent_validate()
167 xchk_fblock_process_error(sc, XFS_DATA_FORK, 0, &error); in xchk_parent_validate()
170 if (!xchk_fblock_xref_process_error(sc, XFS_DATA_FORK, 0, &error)) in xchk_parent_validate()
172 if (dp == sc->ip || xrep_is_tempfile(dp) || in xchk_parent_validate()
174 xchk_fblock_set_corrupt(sc, XFS_DATA_FORK, 0); in xchk_parent_validate()
180 xchk_iunlock(sc, XFS_ILOCK_EXCL); in xchk_parent_validate()
181 xchk_ilock(sc, XFS_ILOCK_EXCL); in xchk_parent_validate()
192 xchk_set_incomplete(sc); in xchk_parent_validate()
197 if (xfs_is_metadir_inode(dp) != xfs_is_metadir_inode(sc->ip)) { in xchk_parent_validate()
198 xchk_fblock_set_corrupt(sc, XFS_DATA_FORK, 0); in xchk_parent_validate()
203 error = xchk_dir_walk(sc, dp, xchk_parent_actor, &spc); in xchk_parent_validate()
204 if (!xchk_fblock_xref_process_error(sc, XFS_DATA_FORK, 0, &error)) in xchk_parent_validate()
212 xchk_fblock_set_corrupt(sc, XFS_DATA_FORK, 0); in xchk_parent_validate()
217 xchk_irele(sc, dp); in xchk_parent_validate()
244 struct xfs_scrub *sc; member
272 struct xfs_scrub *sc, in xchk_parent_scan_dotdot() argument
288 error = xfs_parent_from_attr(sc->mp, attr_flags, name, namelen, value, in xchk_parent_scan_dotdot()
304 struct xfs_scrub *sc = pp->sc; in xchk_parent_pptr_and_dotdot() local
308 error = xchk_dir_lookup(sc, sc->ip, &xfs_name_dotdot, &pp->parent_ino); in xchk_parent_pptr_and_dotdot()
309 if (!xchk_fblock_process_error(sc, XFS_DATA_FORK, 0, &error)) in xchk_parent_pptr_and_dotdot()
311 if (!xfs_verify_dir_ino(sc->mp, pp->parent_ino)) { in xchk_parent_pptr_and_dotdot()
312 xchk_fblock_set_corrupt(sc, XFS_DATA_FORK, 0); in xchk_parent_pptr_and_dotdot()
317 if (xchk_inode_is_dirtree_root(sc->ip)) { in xchk_parent_pptr_and_dotdot()
318 if (sc->ip->i_ino != pp->parent_ino) in xchk_parent_pptr_and_dotdot()
319 xchk_fblock_set_corrupt(sc, XFS_DATA_FORK, 0); in xchk_parent_pptr_and_dotdot()
327 if (VFS_I(sc->ip)->i_nlink == 0) in xchk_parent_pptr_and_dotdot()
330 if (pp->sc->sm->sm_flags & XFS_SCRUB_OFLAG_CORRUPT) in xchk_parent_pptr_and_dotdot()
334 error = xchk_xattr_walk(sc, sc->ip, xchk_parent_scan_dotdot, NULL, pp); in xchk_parent_pptr_and_dotdot()
341 xchk_fblock_set_corrupt(sc, XFS_ATTR_FORK, 0); in xchk_parent_pptr_and_dotdot()
353 struct xfs_scrub *sc, in xchk_parent_lock_dir() argument
384 struct xfs_scrub *sc = pp->sc; in xchk_parent_dirent() local
392 error = xchk_dir_lookup(sc, dp, xname, &child_ino); in xchk_parent_dirent()
394 xchk_fblock_xref_set_corrupt(sc, XFS_ATTR_FORK, 0); in xchk_parent_dirent()
397 if (!xchk_fblock_xref_process_error(sc, XFS_ATTR_FORK, 0, &error)) in xchk_parent_dirent()
401 if (child_ino != sc->ip->i_ino) { in xchk_parent_dirent()
402 xchk_fblock_xref_set_corrupt(sc, XFS_ATTR_FORK, 0); in xchk_parent_dirent()
416 struct xfs_scrub *sc = pp->sc; in xchk_parent_iget() local
422 error = xfs_dir_ino_validate(sc->mp, parent_ino); in xchk_parent_iget()
424 xchk_fblock_set_corrupt(sc, XFS_ATTR_FORK, 0); in xchk_parent_iget()
428 error = xchk_iget(sc, parent_ino, &ip); in xchk_parent_iget()
430 xchk_fblock_set_corrupt(sc, XFS_ATTR_FORK, 0); in xchk_parent_iget()
433 if (!xchk_fblock_xref_process_error(sc, XFS_ATTR_FORK, 0, &error)) in xchk_parent_iget()
438 xchk_fblock_xref_set_corrupt(sc, XFS_ATTR_FORK, 0); in xchk_parent_iget()
444 xchk_fblock_xref_set_corrupt(sc, XFS_ATTR_FORK, 0); in xchk_parent_iget()
451 xchk_irele(sc, ip); in xchk_parent_iget()
462 struct xfs_scrub *sc, in xchk_parent_scan_attr() argument
485 error = xfs_parent_from_attr(sc->mp, attr_flags, name, namelen, value, in xchk_parent_scan_attr()
488 xchk_fblock_set_corrupt(sc, XFS_ATTR_FORK, 0); in xchk_parent_scan_attr()
493 if (parent_ino == sc->ip->i_ino) { in xchk_parent_scan_attr()
494 xchk_fblock_set_corrupt(sc, XFS_ATTR_FORK, 0); in xchk_parent_scan_attr()
507 lockmode = xchk_parent_lock_dir(sc, dp); in xchk_parent_scan_attr()
515 trace_xchk_parent_defer(sc->ip, &xname, dp->i_ino); in xchk_parent_scan_attr()
519 if (!xchk_fblock_xref_process_error(sc, XFS_ATTR_FORK, 0, in xchk_parent_scan_attr()
524 if (!xchk_fblock_xref_process_error(sc, XFS_ATTR_FORK, 0, in xchk_parent_scan_attr()
538 xchk_irele(sc, dp); in xchk_parent_scan_attr()
553 struct xfs_scrub *sc = pp->sc; in xchk_parent_revalidate_pptr() local
556 error = xfs_parent_lookup(sc->tp, sc->ip, xname, pptr, &pp->pptr_args); in xchk_parent_revalidate_pptr()
575 struct xfs_scrub *sc = pp->sc; in xchk_parent_slow_pptr() local
585 if (!xchk_fblock_xref_process_error(sc, XFS_ATTR_FORK, 0, in xchk_parent_slow_pptr()
600 lockmode = xchk_parent_lock_dir(sc, dp); in xchk_parent_slow_pptr()
602 trace_xchk_parent_slowpath(sc->ip, xname, dp->i_ino); in xchk_parent_slow_pptr()
610 xchk_iunlock(sc, sc->ilock_flags); in xchk_parent_slow_pptr()
613 trace_xchk_parent_ultraslowpath(sc->ip, xname, dp->i_ino); in xchk_parent_slow_pptr()
615 error = xchk_dir_trylock_for_pptrs(sc, dp, &lockmode); in xchk_parent_slow_pptr()
625 if (!xchk_fblock_xref_process_error(sc, XFS_ATTR_FORK, 0, &error)) in xchk_parent_slow_pptr()
633 xchk_irele(sc, dp); in xchk_parent_slow_pptr()
648 if (pp->sc->sm->sm_flags & XFS_SCRUB_OFLAG_CORRUPT) in xchk_parent_finish_slow_pptrs()
674 struct xfs_scrub *sc, in xchk_parent_count_pptr() argument
689 error = xfs_parent_from_attr(sc->mp, attr_flags, name, namelen, value, in xchk_parent_count_pptr()
707 struct xfs_scrub *sc = pp->sc; in xchk_parent_count_pptrs() local
716 error = xchk_xattr_walk(sc, sc->ip, xchk_parent_count_pptr, in xchk_parent_count_pptrs()
720 xchk_fblock_set_corrupt(sc, XFS_ATTR_FORK, 0); in xchk_parent_count_pptrs()
727 if (S_ISDIR(VFS_I(sc->ip)->i_mode)) { in xchk_parent_count_pptrs()
728 if (xchk_inode_is_dirtree_root(sc->ip)) in xchk_parent_count_pptrs()
731 if (VFS_I(sc->ip)->i_nlink == 0 && pp->pptrs_found > 0) in xchk_parent_count_pptrs()
732 xchk_ino_set_corrupt(sc, sc->ip->i_ino); in xchk_parent_count_pptrs()
733 else if (VFS_I(sc->ip)->i_nlink > 0 && in xchk_parent_count_pptrs()
735 xchk_ino_set_corrupt(sc, sc->ip->i_ino); in xchk_parent_count_pptrs()
742 if (xfs_has_metadir(sc->mp) && xchk_inode_is_sb_rooted(sc->ip)) in xchk_parent_count_pptrs()
745 if (VFS_I(sc->ip)->i_nlink != pp->pptrs_found) in xchk_parent_count_pptrs()
746 xchk_ino_set_corrupt(sc, sc->ip->i_ino); in xchk_parent_count_pptrs()
755 struct xfs_scrub *sc) in xchk_parent_pptr() argument
764 pp->sc = sc; in xchk_parent_pptr()
771 descr = xchk_xfile_ino_descr(sc, "slow parent pointer entries"); in xchk_parent_pptr()
778 descr = xchk_xfile_ino_descr(sc, "slow parent pointer names"); in xchk_parent_pptr()
784 error = xchk_xattr_walk(sc, sc->ip, xchk_parent_scan_attr, NULL, pp); in xchk_parent_pptr()
801 if (pp->sc->sm->sm_flags & XFS_SCRUB_OFLAG_CORRUPT) in xchk_parent_pptr()
817 if (S_ISDIR(VFS_I(sc->ip)->i_mode)) { in xchk_parent_pptr()
823 if (pp->sc->sm->sm_flags & XFS_SCRUB_OFLAG_CORRUPT) in xchk_parent_pptr()
847 struct xfs_scrub *sc) in xchk_parent() argument
849 struct xfs_mount *mp = sc->mp; in xchk_parent()
854 return xchk_parent_pptr(sc); in xchk_parent()
860 if (!S_ISDIR(VFS_I(sc->ip)->i_mode)) in xchk_parent()
864 if (!xfs_verify_dir_ino(mp, sc->ip->i_ino)) { in xchk_parent()
865 xchk_fblock_set_corrupt(sc, XFS_DATA_FORK, 0); in xchk_parent()
870 if (xchk_should_terminate(sc, &error)) in xchk_parent()
874 error = xchk_dir_lookup(sc, sc->ip, &xfs_name_dotdot, in xchk_parent()
876 if (!xchk_fblock_process_error(sc, XFS_DATA_FORK, 0, &error)) in xchk_parent()
879 xchk_fblock_set_corrupt(sc, XFS_DATA_FORK, 0); in xchk_parent()
887 error = xchk_parent_validate(sc, parent_ino); in xchk_parent()