• Home
  • Raw
  • Download

Lines Matching +full:look +full:- +full:up

1 // SPDX-License-Identifier: GPL-2.0+
20 /* Set us up to scrub parents. */
31 /* Look for an entry in a parent pointing to this inode. */
41 /* Look for a single entry in a directory pointing to an inode. */
55 if (spc->ino == ino) in xchk_parent_actor()
56 spc->nlink++; in xchk_parent_actor()
63 if (xchk_should_terminate(spc->sc, &error)) in xchk_parent_actor()
64 spc->cancelled = true; in xchk_parent_actor()
78 .ino = sc->ip->i_ino, in xchk_parent_count_parent_dentries()
87 * If there are any blocks, read-ahead block 0 as we're almost in xchk_parent_count_parent_dentries()
93 if (parent->i_df.if_nextents > 0) in xchk_parent_count_parent_dentries()
105 parent->i_d.di_size); in xchk_parent_count_parent_dentries()
108 error = xfs_readdir(sc->tp, parent, &spc.dc, bufsize); in xchk_parent_count_parent_dentries()
112 error = -EAGAIN; in xchk_parent_count_parent_dentries()
135 struct xfs_mount *mp = sc->mp; in xchk_parent_validate()
143 if (sc->sm->sm_flags & XFS_SCRUB_OFLAG_CORRUPT) in xchk_parent_validate()
147 if (sc->ip->i_ino == dnum) { in xchk_parent_validate()
156 expected_nlink = VFS_I(sc->ip)->i_nlink == 0 ? 0 : 1; in xchk_parent_validate()
167 * If _iget returns -EINVAL then the parent inode number is garbage in xchk_parent_validate()
168 * and the directory is corrupt. If the _iget returns -EFSCORRUPTED in xchk_parent_validate()
169 * or -EFSBADCRC then the parent is corrupt which is a cross in xchk_parent_validate()
172 error = xfs_iget(mp, sc->tp, dnum, XFS_IGET_UNTRUSTED, 0, &dp); in xchk_parent_validate()
173 if (error == -EINVAL) { in xchk_parent_validate()
174 error = -EFSCORRUPTED; in xchk_parent_validate()
180 if (dp == sc->ip || !S_ISDIR(VFS_I(dp)->i_mode)) { in xchk_parent_validate()
208 xfs_iunlock(sc->ip, sc->ilock_flags); in xchk_parent_validate()
209 sc->ilock_flags = 0; in xchk_parent_validate()
221 error = xchk_ilock_inverted(sc->ip, XFS_IOLOCK_EXCL); in xchk_parent_validate()
224 sc->ilock_flags = XFS_IOLOCK_EXCL; in xchk_parent_validate()
228 * to us. Otherwise, it should have one link. We have to re-set in xchk_parent_validate()
229 * it here because we dropped the lock on sc->ip. in xchk_parent_validate()
231 expected_nlink = VFS_I(sc->ip)->i_nlink == 0 ? 0 : 1; in xchk_parent_validate()
233 /* Look up '..' to see if the inode changed. */ in xchk_parent_validate()
234 error = xfs_dir_lookup(sc->tp, sc->ip, &xfs_name_dotdot, &dnum, NULL); in xchk_parent_validate()
239 if (dnum != dp->i_ino) { in xchk_parent_validate()
267 struct xfs_mount *mp = sc->mp; in xchk_parent()
274 * If we're a directory, check that the '..' link points up to in xchk_parent()
277 if (!S_ISDIR(VFS_I(sc->ip)->i_mode)) in xchk_parent()
278 return -ENOENT; in xchk_parent()
281 if (!xfs_verify_dir_ino(mp, sc->ip->i_ino)) { in xchk_parent()
293 sc->ilock_flags &= ~(XFS_ILOCK_EXCL | XFS_MMAPLOCK_EXCL); in xchk_parent()
294 xfs_iunlock(sc->ip, XFS_ILOCK_EXCL | XFS_MMAPLOCK_EXCL); in xchk_parent()
296 /* Look up '..' */ in xchk_parent()
297 error = xfs_dir_lookup(sc->tp, sc->ip, &xfs_name_dotdot, &dnum, NULL); in xchk_parent()
306 if (sc->ip == mp->m_rootip) { in xchk_parent()
307 if (sc->ip->i_ino != mp->m_sb.sb_rootino || in xchk_parent()
308 sc->ip->i_ino != dnum) in xchk_parent()
330 if ((sc->flags & XCHK_TRY_HARDER) && error == -EDEADLOCK) { in xchk_parent()