]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
repair: fix messages from set_nlinks
authorChristoph Hellwig <hch@lst.de>
Fri, 2 Mar 2012 08:35:22 +0000 (08:35 +0000)
committerChristoph Hellwig <hch@lst.de>
Fri, 2 Mar 2012 08:35:22 +0000 (08:35 +0000)
Link counts are unsigned and need to be printed as such.  Also only
print the varning about upgrading the inode version if the inode was
version 1 before.

Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
repair/phase7.c

index 8c1131c907764a2363aae07ce9493c8e675fa1b0..bd1668e13de0d60674bd3e3dcf9e95f3c1dc298d 100644 (file)
@@ -40,19 +40,20 @@ set_nlinks(
 
        if (!no_modify) {
                *dirty = 1;
-               do_warn(_("resetting inode %" PRIu64 " nlinks from %d to %d\n"),
+               do_warn(_("resetting inode %" PRIu64 " nlinks from %u to %u\n"),
                        ino, dinoc->di_nlink, nrefs);
 
-               if (nrefs > XFS_MAXLINK_1)  {
+               if (dinoc->di_version == 1 && nrefs > XFS_MAXLINK_1)  {
                        ASSERT(fs_inode_nlink);
                        do_warn(
-_("nlinks %d will overflow v1 ino, ino %" PRIu64 " will be converted to version 2\n"),
+_("nlinks %u will overflow v1 ino, ino %" PRIu64 " will be converted to version 2\n"),
                                nrefs, ino);
 
                }
                dinoc->di_nlink = nrefs;
        } else  {
-               do_warn(_("would have reset inode %" PRIu64 " nlinks from %d to %d\n"),
+               do_warn(
+_("would have reset inode %" PRIu64 " nlinks from %u to %u\n"),
                        ino, dinoc->di_nlink, nrefs);
        }
 }