]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
update for repair & man page changes.
authorNathan Scott <nathans@sgi.com>
Wed, 5 Jun 2002 01:22:08 +0000 (01:22 +0000)
committerNathan Scott <nathans@sgi.com>
Wed, 5 Jun 2002 01:22:08 +0000 (01:22 +0000)
doc/CHANGES
man/man8/mkfs.xfs.8
repair/dir2.c
repair/phase6.c

index f2780afebb5d87c3c7edc690872e5ed2f6af4804..eaad5d880dbc962204d7b6f81d747903a5481f3d 100644 (file)
@@ -1,3 +1,7 @@
+[cvs]
+       - Fix for xfs_repair mangling i8count for dir2_sf directories
+       - Minor mkfs.xfs man page update for blocksize limits on Linux
+
 xfsprogs-2.0.6 (30 May 2002)
        - Fix error returns from log recovery (affects xfs_repair).
        - Fix the way mkfs.xfs round downs the device when the last 
index c2f27e0f3dc65078e5f4e9aaa45585f23cde081d..0d1e59a92bf7d7b8479354889f8fdb52296eaaaf 100644 (file)
@@ -73,7 +73,7 @@ or in bytes with
 .BR size= .
 The default value is 4096 bytes (4 KB) on systems with a 4KB pagesize.
 The minimum value for block size is 512; the maximum is 65536 (64 KB).
-XFS on Linux currently only supports pagesize blocks.
+XFS on Linux currently only supports pagesize or smaller blocks.
 .TP
 .B \-d
 Data section options.
index dad3c777acc3a3b35b1c9bd9c65a65d8bb1327d6..e07b4ed681957c4f214e8bdca0ff9a7bbc968fc3 100644 (file)
@@ -845,10 +845,15 @@ process_sf_dir2(
        num_entries = INT_GET(sfp->hdr.count, ARCH_CONVERT);
        ino_dir_size = INT_GET(dip->di_core.di_size, ARCH_CONVERT);
        offset = XFS_DIR2_DATA_FIRST_OFFSET;
-       i8 = bad_offset = *repair = 0;
+       bad_offset = *repair = 0;
 
        ASSERT(ino_dir_size <= max_size);
 
+       /*
+        * Initialize i8 based on size of parent inode number.
+        */
+       i8 = (XFS_DIR2_SF_GET_INUMBER_ARCH(sfp, &sfp->hdr.parent, ARCH_CONVERT) > XFS_DIR2_MAX_SHORT_INUM);
+
        /* 
         * check for bad entry count
         */
index 4a7f221ca26969c250e835f13d95cd0c3c9b2bd9..bddd9b134c631c646754089b17e06ed141d7c123 100644 (file)
@@ -3066,7 +3066,7 @@ shortform_dir2_entry_check(xfs_mount_t    *mp,
        ifp = &ip->i_df;
        sfp = (xfs_dir2_sf_t *) ifp->if_u1.if_data;
        *ino_dirty = 0;
-       bytes_deleted = i8 = 0;
+       bytes_deleted = 0;
 
        max_size = ifp->if_bytes;
        ASSERT(ip->i_d.di_size <= ifp->if_bytes);
@@ -3079,6 +3079,11 @@ shortform_dir2_entry_check(xfs_mount_t   *mp,
         */
        add_inode_ref(current_irec, current_ino_offset);
 
+       /*
+        * Initialise i8 counter -- the parent inode number counts as well.
+        */
+       i8 = (XFS_DIR2_SF_GET_INUMBER_ARCH(sfp, &sfp->hdr.parent, ARCH_CONVERT) > XFS_DIR2_MAX_SHORT_INUM);
+
        /*
         * now run through entries, stop at first bad entry, don't need
         * to skip over '..' since that's encoded in its own field and
@@ -3150,12 +3155,24 @@ shortform_dir2_entry_check(xfs_mount_t  *mp,
                 * to where we think lost+found should be.  if that's
                 * the case, that's the one we created in phase 6.
                 * just skip it.  no need to process it and its ..
-                * link is already accounted for.  Also skip entries
-                * with bogus inode numbers if we're in no modify mode.
+                * link is already accounted for.
                 */
 
-               if ((lino == orphanage_ino && strcmp(fname, ORPHANAGE) == 0)
-                               || (no_modify && verify_inum(mp, lino))) {
+               if (lino == orphanage_ino && strcmp(fname, ORPHANAGE) == 0) {
+                       if (lino > XFS_DIR2_MAX_SHORT_INUM)
+                               i8++;
+                       next_sfep = (xfs_dir2_sf_entry_t *)
+                               ((__psint_t) sfep +
+                               XFS_DIR2_SF_ENTSIZE_BYENTRY(sfp, sfep));
+                       continue;
+               }
+
+               /*
+                * Also skip entries with bogus inode numbers if we're
+                * in no modify mode.
+                */
+
+               if (no_modify && verify_inum(mp, lino))  {
                        next_sfep = (xfs_dir2_sf_entry_t *)
                                ((__psint_t) sfep +
                                XFS_DIR2_SF_ENTSIZE_BYENTRY(sfp, sfep));
@@ -3202,14 +3219,9 @@ shortform_dir2_entry_check(xfs_mount_t   *mp,
                } else if (!inode_isadir(irec, ino_offset))  {
                        /*
                         * check easy case first, regular inode, just bump
-                        * the link count and continue
+                        * the link count
                         */
                        add_inode_reached(irec, ino_offset);
-
-                       next_sfep = (xfs_dir2_sf_entry_t *)
-                               ((__psint_t) sfep +
-                               XFS_DIR2_SF_ENTSIZE_BYENTRY(sfp, sfep));
-                       continue;
                } else  {
                        parent = get_inode_parent(irec, ino_offset);