]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
Plug a repair problem when checking directories with an initial hole.
authorNathan Scott <nathans@sgi.com>
Fri, 19 Mar 2004 01:50:13 +0000 (01:50 +0000)
committerNathan Scott <nathans@sgi.com>
Fri, 19 Mar 2004 01:50:13 +0000 (01:50 +0000)
repair/phase6.c

index 4da14370c829736d6c234d01dcb7f4d362cb6def..df2374788b711291c6c691a20b9ee8fdd445d29a 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000-2002 Silicon Graphics, Inc.  All Rights Reserved.
+ * Copyright (c) 2000-2004 Silicon Graphics, Inc.  All Rights Reserved.
  *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms of version 2 of the GNU General Public License as
@@ -2718,13 +2718,16 @@ longform_dir2_entry_check(xfs_mount_t   *mp,
                next_da_bno = da_bno + mp->m_dirblkfsbs - 1;
                if (libxfs_bmap_next_offset(NULL, ip, &next_da_bno, XFS_DATA_FORK))
                        break;
-               if (libxfs_da_read_bufr(NULL, ip, da_bno, -1, &bp,
-                               XFS_DATA_FORK)) {
+               if (libxfs_da_read_bufr(NULL, ip, da_bno,
+                               da_bno == 0 ? -2 : -1, &bp, XFS_DATA_FORK)) {
                        do_error(_("can't read block %u for directory inode "
                                   "%llu\n"),
                                da_bno, ino);
                        /* NOTREACHED */
                }
+               /* is there a hole at the start? */
+               if (da_bno == 0 && bp == NULL)
+                       continue;
                longform_dir2_entry_check_data(mp, ip, num_illegal, need_dot,
                        stack, irec, ino_offset, &bp, hashtab, &freetab, da_bno,
                        isblock);