public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [BUG] Failed writes marked clean?
@ 2002-11-08 20:29 Ross Biro
  2002-11-08 20:53 ` Linus Torvalds
  2002-11-08 20:57 ` Andrew Morton
  0 siblings, 2 replies; 7+ messages in thread
From: Ross Biro @ 2002-11-08 20:29 UTC (permalink / raw)
  To: linux-kernel


Perhaps I'm reading the code incorrectly, but in kernel versions 2.4.18 
and 2.5.46 it looks to me like in the case of a write, ll_rw_block 
always clears the dirty bit.  In the event of an error, nothing resets 
the dirty bit and the uptodate flag is cleared.  This means that if the 
same block needs to be read again, the buffer cache will see that the 
buffer is not uptodate and attempt to read the old contents of the 
buffer off of the device.  If the read suceeds the kernel ends up 
corrupting data.

It seems to me that a better solution would be to mark the buffer as 
dirty and uptodate and then attempt to propogate the error as far back 
as possible.  Ideally something can be done to correct the problem at a 
higher level.  Before I dive in and attempt to do something about this, 
I wanted to make sure I was not missing anything important.  So am I 
full of it, or could this really be a problem?

    Ross



^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2002-11-15 11:31 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-11-08 20:29 [BUG] Failed writes marked clean? Ross Biro
2002-11-08 20:53 ` Linus Torvalds
2002-11-08 20:57 ` Andrew Morton
2002-11-08 21:30   ` Ross Biro
2002-11-08 23:35   ` Theodore Ts'o
2002-11-09  1:29     ` Bernd Eckenfels
2002-11-12 20:04     ` Pavel Machek

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox