linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [patch] linux likes to kill bad inodes
@ 2001-04-22 12:10 Pavel Machek
  2001-04-25 13:29 ` Chris Mason
                   ` (2 more replies)
  0 siblings, 3 replies; 14+ messages in thread
From: Pavel Machek @ 2001-04-22 12:10 UTC (permalink / raw)
  To: viro, kernel list; +Cc: torvalds

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.

[Thanx to Jan Kara]							    
								Pavel

--- clean/fs/inode.c	Wed Apr  4 23:58:04 2001
+++ linux/fs/inode.c	Sun Apr 22 14:04:46 2001
@@ -179,7 +179,7 @@
 
 static inline void write_inode(struct inode *inode, int sync)
 {
-	if (inode->i_sb && inode->i_sb->s_op && inode->i_sb->s_op->write_inode)
+	if (inode->i_sb && inode->i_sb->s_op && inode->i_sb->s_op->write_inode && !is_bad_inode(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

^ permalink raw reply	[flat|nested] 14+ messages in thread
[parent not found: <no.id>]

end of thread, other threads:[~2001-04-30 23:23 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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
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 23:22   ` Linus Torvalds
2001-04-30 22:33 ` David S. Miller
     [not found] <no.id>
2001-04-27 23:30 ` Andreas Dilger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).