From: "Darrick J. Wong" <darrick.wong@oracle.com>
To: Zorro Lang <zlang@redhat.com>
Cc: linux-xfs@vger.kernel.org, xfs@oss.sgi.com
Subject: Re: [PATCH v2] xfs_repair: update the manual content about xfs_repair exit status
Date: Tue, 13 Sep 2016 09:32:26 -0700 [thread overview]
Message-ID: <20160913163226.GE9314@birch.djwong.org> (raw)
In-Reply-To: <1473782076-9137-1-git-send-email-zlang@redhat.com>
On Tue, Sep 13, 2016 at 11:54:36PM +0800, Zorro Lang wrote:
> The man 8 xfs_repair said "xfs_repair run without the -n option will
> always return a status code of 0". That's not correct.
>
> xfs_repair will return 2 if it finds a fs log which needs to be
> replayed or cleared, 1 if runtime error is encountered, and 0 for
> all other cases.
>
> Signed-off-by: Zorro Lang <zlang@redhat.com>
> ---
>
> Hi,
>
> V2 patch did below things:
> - change the description for xfs_repair
> - remove the description for "xfs_repair -L"
>
> Thanks,
> Zorro
>
> man/man8/xfs_repair.8 | 7 ++++++-
> 1 file changed, 6 insertions(+), 1 deletion(-)
>
> diff --git a/man/man8/xfs_repair.8 b/man/man8/xfs_repair.8
> index 1b4d9e3..e45fd90 100644
> --- a/man/man8/xfs_repair.8
> +++ b/man/man8/xfs_repair.8
> @@ -504,12 +504,17 @@ that is known to be free. The entry is therefore invalid and is deleted.
> This message refers to a large directory.
> If the directory were small, the message would read "junking entry ...".
> .SH EXIT STATUS
> +.TP
> .B xfs_repair \-n
> (no modify node)
> will return a status of 1 if filesystem corruption was detected and
> 0 if no filesystem corruption was detected.
> +.TP
> .B xfs_repair
> -run without the \-n option will always return a status code of 0.
> +run without the \-n option will return a status code of 2 if it finds a
> +filesystem log which needs to be replayed(by a mount/umount cycle) or
> +cleared(by -L option), 1 if a runtime error is encountered, and 0 in all
> +other cases, whether or not filesystem corruption was detected.
So... I'd rather the documentation about the return code reflect the
status of the filesystem -- 2 means "unclean log, replay it or zap it",
1 means "errors encountered, fs may not be correct", and 0 /should/ mean
"fs is correct".
OTOH I don't know for sure that xfs_repair always cleans up the fs on
the first try. From my fuzzing experiments a few years ago this seems
to be the case nearly all the time (unlike e2fsck) but not 100%. ISTR
asking Dave about this, and I think he said that the FS should be clean
if repair returns 0. But I'll let him reiterate that if it's true;
don't trust my crummy memory, that's why I have filesystems. ;)
--D
> .SH BUGS
> The filesystem to be checked and repaired must have been
> unmounted cleanly using normal system administration procedures
> --
> 2.7.4
>
> _______________________________________________
> xfs mailing list
> xfs@oss.sgi.com
> http://oss.sgi.com/mailman/listinfo/xfs
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
next prev parent reply other threads:[~2016-09-13 16:32 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-09-13 15:54 [PATCH v2] xfs_repair: update the manual content about xfs_repair exit status Zorro Lang
2016-09-13 16:17 ` Eric Sandeen
2016-09-13 16:32 ` Darrick J. Wong [this message]
2016-09-13 16:57 ` Eric Sandeen
2016-09-13 21:48 ` Dave Chinner
2016-09-13 21:52 ` Eric Sandeen
2016-09-14 1:34 ` Dave Chinner
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20160913163226.GE9314@birch.djwong.org \
--to=darrick.wong@oracle.com \
--cc=linux-xfs@vger.kernel.org \
--cc=xfs@oss.sgi.com \
--cc=zlang@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).