From: Pavel Machek <pavel@suse.cz>
To: Chris Mason <mason@suse.com>,
viro@math.psu.edu, kernel list <linux-kernel@vger.kernel.org>,
jack@atrey.karlin.mff.cuni.cz
Cc: torvalds@transmeta.com
Subject: Re: [patch] linux likes to kill bad inodes
Date: Fri, 27 Apr 2001 00:28:54 +0200 [thread overview]
Message-ID: <20010427002853.A11426@bug.ucw.cz> (raw)
In-Reply-To: <20010425220120.A1540@bug.ucw.cz> <466810000.988230486@tiny>
In-Reply-To: <466810000.988230486@tiny>; from Chris Mason on Wed, Apr 25, 2001 at 04:28:06PM -0400
Hi!
> >> > I had a temporary disk failure (played with acpi too much). What
> >> > happened was that disk was not able to do anything for five minutes
> >> > or so. When disk recovered, linux happily overwrote all inodes it
> >> > could not read while disk was down with zeros -> massive disk
> >> > corruption.
> >> >
> >> > Solution is not to write bad inodes back to disk.
> >> >
> >>
> >> Wouldn't we rather make it so bad inodes don't get marked dirty at all?
> >
> > I guess this is cheaper: we can mark inode dirty at 1000 points, but
> > you only write it at one point.
>
> Whoops, I worded that poorly. To me, it seems like a bug to dirty a bad
> inode. If this patch works, it is because somewhere, somebody did
> something with a bad inode, and thought the operation worked (otherwise,
> why dirty it?).
>
> So yes, even if we dirty them in a 1000 different places, we need to find
> the one place that believes it can do something worthwhile to a bad inode.
Okay, so what about following patch, followed by attempt to debug it?
[I'd really like to get patch it; killing user's data without good
reason seems evil to me, and this did quite a lot of damage to my
$HOME.]
Pavel
PS: Only filesystem at use at time of problem was ext2, and it was
ext2 iinode that got killed.
--- clean/fs/inode.c Wed Apr 4 23:58:04 2001
+++ linux/fs/inode.c Fri Apr 27 00:25:46 2001
@@ -179,6 +179,10 @@
static inline void write_inode(struct inode *inode, int sync)
{
+ if (is_bad_inode(inode)) {
+ printk(KERN_CRIT "Cowardly refusing to kill your inode\n");
+ return;
+ }
if (inode->i_sb && inode->i_sb->s_op && inode->i_sb->s_op->write_inode)
inode->i_sb->s_op->write_inode(inode, sync);
}
--
I'm pavel@ucw.cz. "In my country we have almost anarchy and I don't care."
Panos Katsaloulis describing me w.r.t. patents at discuss@linmodems.org
next prev parent reply other threads:[~2001-04-27 14:16 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-04-22 12:10 [patch] linux likes to kill bad inodes Pavel Machek
2001-04-25 13:29 ` Chris Mason
2001-04-25 20:01 ` Pavel Machek
2001-04-25 20:28 ` Chris Mason
2001-04-26 9:28 ` Pavel Machek
2001-04-26 9:33 ` Jan Kara
2001-04-26 22:28 ` Pavel Machek [this message]
2001-04-27 14:36 ` Chris Mason
2001-04-27 22:07 ` Andreas Dilger
2001-04-27 22:14 ` Linus Torvalds
2001-04-30 22:28 ` Alan Cox
2001-04-30 22:33 ` David S. Miller
2001-04-30 23:22 ` Linus Torvalds
[not found] <no.id>
2001-04-27 23:30 ` Andreas Dilger
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=20010427002853.A11426@bug.ucw.cz \
--to=pavel@suse.cz \
--cc=jack@atrey.karlin.mff.cuni.cz \
--cc=linux-kernel@vger.kernel.org \
--cc=mason@suse.com \
--cc=torvalds@transmeta.com \
--cc=viro@math.psu.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