On Sat, Jun 16, 2001 at 05:15:44PM +1000, Andrew Morton wrote:
>
> It seems that if e2fsck deletes an orphaned inode, and the check otherwise
> comes up clean, it prints "***** FILE SYSTEM WAS MODIFIED *****" and
> yields a non-zero exit code.
>
> This is confusing my recovery testing scripts - they think something
> went wrong.
Hmm.... The man page for fsck documents exit code 1 as "filesystem
errors corrected", and so the question is whether or not cleaning up
after orphaned inodes is "an error" or not. One could easily argue
that it's not a "filesystem error".
I suspect that for most things it doesn't matter, since most boot
scripts treat exit codes 0 and 1 identifically. I can see how for
your testing framework it would be useful to distinguish between these
two cases.
Patching e2fsck to do this is relatively easy, although the simple way
of doing things would require us to write out the inode and block
bitmaps after doing the orphan cleanup. That's a bit of wasted disk
activity, but the problem is that tracking of when filesystems are
modified is done at a very low level, and e2fsck had made the
fundamental assumption that changes to filesystems only happened when
fixing filesystem problems. On the other hand, I may want to fix this
the hard way, since the directory hashing changes will also require
e2fsck to make changes without those changes implying filesystem
errors.
- Ted