Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 31349 - checkfs in baselayout. Does not handle fsck return codes correctly.
Summary: checkfs in baselayout. Does not handle fsck return codes correctly.
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All Linux
: High normal
Assignee: Martin Schlemmer (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-10-17 06:40 UTC by phceac
Modified: 2003-10-27 10:40 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
Proposed patch for /etc/init.d/checkfs. (checkfs.patch,2.97 KB, patch)
2003-10-17 06:46 UTC, phceac
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description phceac 2003-10-17 06:40:38 UTC
Checkfs drops to shell on return value 1 - should continue.
Does not reboot if fsck returnvalue has bit 2 set (ie retval=2,3,6,7,10,11,etc).
I suspect that reboot is only required if we're on the root fs, but know if
that's guaranteed...should handle it anyway.
 
I'd already fixed this on my machine (i think), but it seems daft not to share...
The patch is a bit long, as it contains lots of info messages when fsck errors
occur.
It also contains some debugging cruft near the beginning, which allows to test
its behaviour without rebooting. DO NOT ENABLE THE DEBUGGING STUFF IF YOU HAVE
RAID/MD/LVM. I haven't tested it with any of those, don't know what it would do.
 
Hope this helps someone!
Charlie


Reproducible: Always
Steps to Reproduce:
1. Crash computer
2.  if fsck retval is 1, drops to shell.
3.  ( haven't been able to force a return value with bit2 set)
Comment 1 phceac 2003-10-17 06:46:10 UTC
Created attachment 19358 [details, diff]
Proposed patch for /etc/init.d/checkfs.

Hmmm...the patch is half as long as the script...perhaps I got a bit carried
away.
I've tested this to the best of my ability, but please audit it well - I'd
hate
to  have ruined someone's filesystems.
Comment 2 Martin Schlemmer (RETIRED) gentoo-dev 2003-10-17 12:17:27 UTC
I do not see why we should handle anything not handled now.  If return is
2 or 3, it will not drop you to console, as it did fix whatever.  Anything
else we do not handle, or need investigation.

As for the reboot one - its not your root (/) partition, so not mounted,
so no reboot needed.

The only thing needing change, is this test:

--
elif [ "${retval}" -gt 1 -a "${retval}" -lt 4 ]
--

that should read:

--
elif [ "${retval}" -ge 1 -a "${retval}" -le 3 ]
--
Comment 3 phceac 2003-10-17 16:21:17 UTC
Fair enough!!  That was the problem that originally got me.
 ( though reiserfs looks like it can return 2 - if I read right - when it
needs a rebuild-tree, whatever that means. If that happens, it means that
current checkfs will mount a filesystem with errors, checkroot will reboot
repeatedly. Perhaps I got this wrong, or else it must be extremely rare...perhaps
only with hardware failure?   )

I would like to have an echo of any non-zero fsck return value - it's useful
information, and I'd never have had that last coronary if I'd seen it!!!
 

Comment 4 Martin Schlemmer (RETIRED) gentoo-dev 2003-10-27 10:40:36 UTC
Fixed in CVS.