The shortform parent ino verification code runs once in phase 3
(ino_discovery == true) and once in phase 4 (ino_discovery ==
false). This is unnecessary and leads to duplicate error messages if
repair replaces an invalid parent value with zero because zero is
still an invalid value. Skip the check in phase 4.
Signed-off-by: Brian Foster <bfoster@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
[sandeen: add comments suggested by Darrick during review]
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
* check parent (..) entry
*/
*parent = libxfs_dir2_sf_get_parent_ino(sfp);
+ /*
+ * If this function is called during inode discovery (phase 3), it will
+ * set a bad sf dir parent pointer to the root directory. This fixes
+ * the directory enough to pass the inode fork verifier in phase 6 when
+ * we try to reset the parent pointer to the correct value. There is no
+ * need to re-check the parent pointer during phase 4.
+ */
+ if (!ino_discovery)
+ return 0;
/*
* if parent entry is bogus, null it out. we'll fix it later .