linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Nick Piggin <npiggin@suse.de>
To: Richard Kojedzinszky <krichy@tvnetwork.hu>
Cc: linux-ext4@vger.kernel.org, linux-fsdevel@vger.kernel.org
Subject: Re: minix/ext2 + rd problem
Date: Wed, 15 Oct 2008 16:05:23 +0200	[thread overview]
Message-ID: <20081015140523.GA30641@wotan.suse.de> (raw)
In-Reply-To: <alpine.DEB.1.10.0810150943350.3259@krichy.tvnetwork.hu>

On Wed, Oct 15, 2008 at 10:19:44AM +0200, Richard Kojedzinszky wrote:
> dear nick,
> 
> i have tried a sync after the remount, but that did not help. what helped 
> is dropping the cache by echoing 3 to /proc/sys/vm/drop_caches, but this 
> still didnt solve the problem in 100%, only in 95% of the cases.
> 
> But when i read the device with
> # dd if=/dev/ram0 iflag=direct ...
> then it worked. I think this bypassed some caches, and thus read the 
> actual data.
> 
> But a sad result is that I experienced with it, and only with ramdisk does 
> it work as expected. for example with a logical volume it behaves in the 
> wrong way.

I've reproduced this problem (ext2 image corruption flagged in e2fsck
even though it was remounted ro and marked clean in the sb).

Issuing a sync, then drop_caches, seems to fix it here for me.

On the other hand, I also see problems with inconsistencies even after
unmounting if I hold the /dev/ram0 device open with something else (which
causes the buffer cache not to be invalidated on unmount).

I think what is happening is that the block device is being modified
without going through the buffer cache (ie. via pagecache or direct
writes), but the buffer cache doesn't get invalidated. So you get stale
data when reading from /dev/ram0.

I don't think we're going to want the overhead in the kernel to detect
these kinds of aliases. It might be reasonable to flush the blockdev
on unmount and remount,ro after syncing the filesystem.

The old rd driver's backing store was actually its buffercache, so that
particular issue wouldn't cause aliasing.

Thanks,
Nick

       reply	other threads:[~2008-10-15 14:05 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <alpine.DEB.1.10.0810141631130.30331@krichy.tvnetwork.hu>
     [not found] ` <20081015041644.GA24613@wotan.suse.de>
     [not found]   ` <alpine.DEB.1.10.0810150943350.3259@krichy.tvnetwork.hu>
2008-10-15 14:05     ` Nick Piggin [this message]
2008-10-15 14:10       ` minix/ext2 + rd problem Richard Kojedzinszky
2008-10-15 14:34         ` Nick Piggin
2008-10-15 19:22           ` Matthew Wilcox
2008-10-16  3:48             ` Nick Piggin

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=20081015140523.GA30641@wotan.suse.de \
    --to=npiggin@suse.de \
    --cc=krichy@tvnetwork.hu \
    --cc=linux-ext4@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    /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).