Public bug reported:

xfs_repair mistakenly returns status 1 instead of 0 for any "clean" xfs-
filesystem if there "-v" and "-n" options are used together.

# xfs_repair -V
xfs_repair version 4.3.0

Run xfs_repair w/o -v:

# xfs_repair -n /dev/DEV; echo Status=$?
Phase 1 - find and verify superblock...
Phase 2 - using internal log
        - zero log...
        - scan filesystem freespace and inode maps...
        - found root inode chunk
Phase 3 - for each AG...
        - scan (but don't clear) agi unlinked lists...
        - process known inodes and perform inode discovery...
        - agno = 0
        - agno = 1
        - agno = 2
        - agno = 3
        - process newly discovered inodes...
Phase 4 - check for duplicate blocks...
        - setting up duplicate extent list...
        - check for inodes claiming duplicate blocks...
        - agno = 0
        - agno = 1
        - agno = 2
        - agno = 3
No modify flag set, skipping phase 5
Phase 6 - check inode connectivity...
        - traversing filesystem ...
        - traversal finished ...
        - moving disconnected inodes to lost+found ...
Phase 7 - verify link counts...
No modify flag set, skipping filesystem flush and exiting.
Status=0

Add -v:

===========
Actual result:
===========

# xfs_repair -v -n /dev/DEV; echo Status=$?
Phase 1 - find and verify superblock...
        - block cache size set to 185752 entries
Phase 2 - using internal log
        - zero log...
zero_log: head block 2 tail block 2
        - scan filesystem freespace and inode maps...
        - found root inode chunk
Phase 3 - for each AG...
        - scan (but don't clear) agi unlinked lists...
        - process known inodes and perform inode discovery...
        - agno = 0
        - agno = 1
        - agno = 2
        - agno = 3
        - process newly discovered inodes...
Phase 4 - check for duplicate blocks...
        - setting up duplicate extent list...
        - check for inodes claiming duplicate blocks...
        - agno = 0
        - agno = 1
        - agno = 2
        - agno = 3
No modify flag set, skipping phase 5
Phase 6 - check inode connectivity...
        - traversing filesystem ...
        - agno = 0
        - agno = 1
        - agno = 2
        - agno = 3
        - traversal finished ...
        - moving disconnected inodes to lost+found ...
Phase 7 - verify link counts...
No modify flag set, skipping filesystem flush and exiting.

        XFS_REPAIR Summary    Fri Mar 18 18:18:37 2016

Phase           Start           End             Duration
Phase 1:        03/18 18:18:37  03/18 18:18:37  
Phase 2:        03/18 18:18:37  03/18 18:18:37  
Phase 3:        03/18 18:18:37  03/18 18:18:37  
Phase 4:        03/18 18:18:37  03/18 18:18:37  
Phase 5:        Skipped
Phase 6:        03/18 18:18:37  03/18 18:18:37  
Phase 7:        03/18 18:18:37  03/18 18:18:37  

Total run time: 
Status=1

=============
Expected result:
=============
Status=0

** Affects: xfsprogs (Ubuntu)
     Importance: Undecided
         Status: New

** Attachment added: "log of useful commands for this issue"
   https://bugs.launchpad.net/bugs/1559219/+attachment/4603455/+files/bug.log

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1559219

Title:
  "xfs_repair -n -v" always returns status 1

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/xfsprogs/+bug/1559219/+subscriptions

-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to