Blame SOURCES/xfsprogs-4.5.0-xfs_repair-rtino-version.patch

4a5a34
commit 643f6acc4bb2d799bebd54c973949c1a90eb26a3
4a5a34
Author: Eric Sandeen <sandeen@redhat.com>
4a5a34
Date:   Tue Jun 21 12:55:15 2016 +1000
4a5a34
4a5a34
    xfs_repair: set rsumino version to 2
4a5a34
    
4a5a34
    If we run xfs/033 with "-m crc=0", the test fails with a repair
4a5a34
    output difference:
4a5a34
    
4a5a34
         Phase 7 - verify and correct link counts...
4a5a34
        +resetting inode INO nlinks from 0 to 1
4a5a34
         done
4a5a34
    
4a5a34
    This is because when we zero out the realtime summary inode and
4a5a34
    rebuild it, we set its version to 1, then set its ip->i_d.di_nlink
4a5a34
    to 1.  This is a little odd, because v1 inodes store their link
4a5a34
    count in di_onlink...
4a5a34
    
4a5a34
    Then, later in repair we call xfs_inode_from_disk(), which sees the
4a5a34
    version one inode, and converts it to version 2 in part by copying
4a5a34
    di_onlink to di_nlink.  But we never *set* di_onlink, so di_nlink
4a5a34
    gets reset to zero, and this error is discovered later in repair.
4a5a34
    
4a5a34
    Interestingly, mk_rbmino() was changed in 138659f1 to set version 2;
4a5a34
    it looks like mk_rsumino was just missed.
4a5a34
    
4a5a34
    Signed-off-by: Eric Sandeen <sandeen@redhat.com>
4a5a34
    Reviewed-by: Dave Chinner <dchinner@redhat.com>
4a5a34
    Signed-off-by: Dave Chinner <david@fromorbit.com>
4a5a34
4a5a34
Index: xfsprogs-4.5.0/repair/phase6.c
4a5a34
===================================================================
4a5a34
--- xfsprogs-4.5.0.orig/repair/phase6.c
4a5a34
+++ xfsprogs-4.5.0/repair/phase6.c
4a5a34
@@ -507,7 +507,7 @@ mk_rbmino(xfs_mount_t *mp)
4a5a34
 			error);
4a5a34
 	}
4a5a34
 
4a5a34
-	vers = xfs_sb_version_hascrc(&mp->m_sb) ? 3 : 1;
4a5a34
+	vers = xfs_sb_version_hascrc(&mp->m_sb) ? 3 : 2;
4a5a34
 	memset(&ip->i_d, 0, xfs_icdinode_size(vers));
4a5a34
 
4a5a34
 	ip->i_d.di_magic = XFS_DINODE_MAGIC;
4a5a34
@@ -766,7 +766,7 @@ mk_rsumino(xfs_mount_t *mp)
4a5a34
 			error);
4a5a34
 	}
4a5a34
 
4a5a34
-	vers = xfs_sb_version_hascrc(&mp->m_sb) ? 3 : 1;
4a5a34
+	vers = xfs_sb_version_hascrc(&mp->m_sb) ? 3 : 2;
4a5a34
 	memset(&ip->i_d, 0, xfs_icdinode_size(vers));
4a5a34
 
4a5a34
 	ip->i_d.di_magic = XFS_DINODE_MAGIC;