linux-raid.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Neil Brown <neilb@suse.de>
To: Bill Davidsen <davidsen@tmr.com>
Cc: linux-raid@vger.kernel.org, ssmeenk@freshdot.net
Subject: Re: Data corruption on software raid.
Date: Mon, 19 Mar 2007 09:16:12 +1100	[thread overview]
Message-ID: <17917.47660.761394.926259@notabene.brown> (raw)
In-Reply-To: message from Bill Davidsen on Sunday March 18

On Sunday March 18, davidsen@tmr.com wrote:
> 
> This may be due to a characteristic of RAID1, which I believe Neil 
> described when discussing "check" failures in using RAID1 for swap. In 
> some cases, the data is being written from a user buffer, which is 
> changing. and the RAID software does two write, one to each device, 
> resulting in the data in the buffer changing as the write occurs. More 
> on this at the end.

While you can get different data written to different devices in a
RAID1, this difference is NEVER visible above the filesystem.

It is mostly likely to happen with swap and, if it does, the swap
system will never try to read that data back.
It can conceivably happen with regular filesystems, but only if a file
is being changed immediately before being truncated.  Some of the blocks
that were in the file might end up different on each device.  But
the data in those blocks will never be read (because the file has been
truncated). 

So this could not explain the current problem.

> 
> I do have a thought which MIGHT address this issue in a general way, 
> perhaps Neil will share he opinion. When writing to any array with 
> multiple copies which are written from user buffers, perhaps the code 
> could set the page(s) as copy on write. Then if the program tried to 
> modify the data it could be done safely. When the write to all drives 
> was complete, the COW could be cleared, and if the page had not been 
> modified very little overhead would be generated. If the page had been 
> modified, then the original would no longer be mapped to a process and 
> could be released.
> 
> Neil, what think you? This would be e general solution to the mismatched 
> multiple copies issue, assuming that it could be done at all.

Copy-on-write is not as easy as it sounds.  Trying to trigger COW from
the md driver would be incredibly messy and wouldn't solve any serious
problem.

NeilBrown

  reply	other threads:[~2007-03-18 22:16 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-03-18 13:16 Data corruption on software raid Sander Smeenk
2007-03-18 14:02 ` Justin Piszcz
2007-03-18 16:50   ` Bill Davidsen
2007-03-18 17:38     ` Sander Smeenk
     [not found]       ` <45FD870C.3020403@tmr.com>
2007-03-18 22:00         ` Sander Smeenk
2007-03-18 15:17 ` Wolfgang Denk
2007-03-18 17:09 ` Bill Davidsen
2007-03-18 22:16   ` Neil Brown [this message]
2007-03-18 22:19 ` Neil Brown
  -- strict thread matches above, loose matches on Subject: below --
2008-04-07 23:43 Data corruption on software RAID Mikulas Patocka
2008-04-08 10:22 ` Helge Hafting
2008-04-08 11:14   ` Mikulas Patocka
2008-04-09 18:33 ` Bill Davidsen
2008-04-10  3:07   ` Mikulas Patocka
2008-04-10 14:21     ` Bill Davidsen
2008-04-11  2:55       ` Mikulas Patocka
2008-04-10  6:14 ` Mario 'BitKoenig' Holbe

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=17917.47660.761394.926259@notabene.brown \
    --to=neilb@suse.de \
    --cc=davidsen@tmr.com \
    --cc=linux-raid@vger.kernel.org \
    --cc=ssmeenk@freshdot.net \
    /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;
as well as URLs for NNTP newsgroup(s).