public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "Petr Vandrovec" <VANDROVE@vc.cvut.cz>
To: "Theodore Ts'o" <tytso@mit.edu>
Cc: Duncan Sands <baldrick@wanadoo.fr>,
	Linux Kernel <linux-kernel@vger.kernel.org>,
	ext2-devel@lists.sourceforge.net, adilger@clusterfs.com
Subject: Re: [Ext2-devel] Re: Htree ate my hard drive, was: post-hal
Date: Fri, 1 Nov 2002 14:41:28 +0200	[thread overview]
Message-ID: <6457F663908@vcnet.vc.cvut.cz> (raw)

On 31 Oct 02 at 17:03, Theodore Ts'o wrote:
> On Thu, Oct 31, 2002 at 01:19:23PM +0200, Petr Vandrovec wrote:
> >     
> > Nobody answered it at that time, and it happened at least 5 times
> > again to me - until I modified initscripts to do unconditional
> > reboot if "fsck /" did ANY modifications to filesystem.
> > 
> 
> In fact, e2fsck should return an exit code which indicates that the
> systme should be rebooted if an fsck the root filesystem makes any
> changes to the filesystem.  See the man page to fsck(8) for a
> definition of fsck's exit codes, but if (exit_status & 2) is non-zero,
> the init scripts **should** reboot.  

There is something wrong then...
 
> Unfortunately, not all distributions get this right.  However, your
> analysis is right.  If fsck needs to make any modifications to the
> root filesystem, which is mounted read-only, it is possible for the
> corrupted filesystem elements to still be cached in memory, and then
> written back out to disk when the filesystem is remounted read/write.  

Debian does:

force=""
fix="-a"
spinner="-C"
fsck $spinner $force $fix /
if [ $? -gt 1 ]
then
   echo "fsck failed..."
   ...
   /sbin/sulogin
   reboot -f
fi

which would catch return value '2' or any combination of 2 with anything
else. But fsck returns 1 - File system errors corrected. I just added 
check for $? -eq 1, doing immediate reboot in such case in 
/etc/init.d/checkroot.sh.

But I must admit that I did not checked whether 'system should be rebooted'
bit was not generated by e2fsck, or whether it was dropped by fsck wrapper,
or whether there is some addon patch in Debian fsck package.

System is debian unstable, currently using (e2)fsck 1.30-WIP, 30-Sep-2002.
                                            Best regards,
                                                Petr Vandrovec
                                                vandrove@vc.cvut.cz
                                                

                 reply	other threads:[~2002-11-01 13:35 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=6457F663908@vcnet.vc.cvut.cz \
    --to=vandrove@vc.cvut.cz \
    --cc=adilger@clusterfs.com \
    --cc=baldrick@wanadoo.fr \
    --cc=ext2-devel@lists.sourceforge.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tytso@mit.edu \
    /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