• Home
  • Raw
  • Download

Lines Matching +full:a +full:- +full:facing

1 // SPDX-License-Identifier: GPL-2.0+
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()
59 * If we're facing a fatal signal, bail out. Store the cancellation 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()
88 * certain to have the next operation be a read there. This is 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()
153 * If we're an unlinked directory, the parent /won't/ have a link in xchk_parent_validate()
156 expected_nlink = VFS_I(sc->ip)->i_nlink == 0 ? 0 : 1; in xchk_parent_validate()
160 * cancel the scrub transaction. Since we're don't know a in xchk_parent_validate()
162 * cleanup (which allocates what would be a nested transaction) in xchk_parent_validate()
163 * if the parent pointer erroneously points to a file, we 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()
187 * its alleged parent for a forward reference. If we can grab 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()
227 * If we're an unlinked directory, the parent /won't/ have a link 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()
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()
262 /* Scrub a parent pointer. */
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()
275 * a directory that has one entry pointing to us. in xchk_parent()
277 if (!S_ISDIR(VFS_I(sc->ip)->i_mode)) in xchk_parent()
278 return -ENOENT; in xchk_parent()
280 /* We're not a special inode, are we? */ in xchk_parent()
281 if (!xfs_verify_dir_ino(mp, sc->ip->i_ino)) { in xchk_parent()
287 * The VFS grabs a read or write lock via i_rwsem before it reads in xchk_parent()
288 * or writes to a directory. If we've gotten this far we've in xchk_parent()
290 * getting a write lock on i_rwsem. Therefore, it is safe for us 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()
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()
327 * If we failed to lock the parent inode even after a retry, just mark in xchk_parent()
330 if ((sc->flags & XCHK_TRY_HARDER) && error == -EDEADLOCK) { in xchk_parent()