[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#876994: marked as done (initramfs-tools: fsck return code 2 is ignored)



Your message dated Wed, 27 Sep 2017 15:55:35 +0200
with message-id <1506520535.2852.93.camel@decadent.org.uk>
and subject line Re: Bug#876994: initramfs-tools: fsck return code 2 is ignored
has caused the Debian Bug report #876994,
regarding initramfs-tools: fsck return code 2 is ignored
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact owner@bugs.debian.org
immediately.)


-- 
876994: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=876994
Debian Bug Tracking System
Contact owner@bugs.debian.org with problems
--- Begin Message ---
Package: initramfs-tools
Version: 0.130
Severity: normal

Dear Maintainer,

I took a look at the scripts/functions file and it seems that in
_checkfs_once() the return code 2 is considered as "File system check
failed but did not detect errors" and the initramfs is not panicing.

>From the fsck manpage:

    The exit code returned by fsck is the sum of the following conditions:
           2      System should be rebooted

I think the initramfs should not try to mount and use the filesystem
after this error occurs and therefor it should panic.

I attached a patch to fix the problem.

Regards,
Sven

*** patch
--- a/scripts/functions Wed Sep 27 10:25:28 2017 +0200
+++ b/scripts/functions Wed Sep 27 15:37:12 2017 +0200
@@ -345,6 +345,7 @@
        fi
        FSCK_LOGFILE=/run/initramfs/fsck.log
        FSCK_STAMPFILE=/run/initramfs/fsck-${NAME#/}
+       FSCK_REBOOT=/run/initramfs/fsck-reboot
 
        TYPE=$(get_fstype "$1")
 
@@ -392,11 +393,17 @@
        # NOTE: "failure" is defined as exiting with a return code of
        # 4, possibly or-ed with other flags. A return code of 1
        # indicates that file system errors were corrected but that
-       # the boot may proceed.
+       # the boot may proceed. A return code of 2, possibly or-ed with other flags,
+       # indicates that the system should be rebooted.
        #
        if [ "$FSCKCODE" -eq 32 ]
        then
                log_warning_msg "File system check was interrupted by user"
+       elif [ $((FSCKCODE & 2)) -eq 2 ]
+       then
+               log_failure_msg "File system check of the $NAME filesystem failed. Needs reboot."
+               > /run/initramfs/fsck-reboot
+               return 1
        elif [ $((FSCKCODE & 4)) -eq 4 ]
        then
                log_failure_msg "File system check of the $NAME filesystem failed"

--- End Message ---
--- Begin Message ---
On Wed, 2017-09-27 at 13:41 +0000, Sven Haardiek wrote:
> Package: initramfs-tools
> Version: 0.130
> Severity: normal
> 
> Dear Maintainer,
> 
> I took a look at the scripts/functions file and it seems that in
> _checkfs_once() the return code 2 is considered as "File system check
> failed but did not detect errors" and the initramfs is not panicing.
> 
> > From the fsck manpage:
> 
>     The exit code returned by fsck is the sum of the following
> conditions:
>            2      System should be rebooted
> 
> I think the initramfs should not try to mount and use the filesystem
> after this error occurs and therefor it should panic.
[...]

This error code applies only if fsck modifies a filesystem  while it is
already mounted.  We always run fsck before mounting, so this can't
happen.

Ben.

-- 
Ben Hutchings
Larkinson's Law: All laws are basically false.

Attachment: signature.asc
Description: This is a digitally signed message part


--- End Message ---

Reply to: