Re: ramdisk corruption problems - was: RE: pivot_root and initrd kern el panic woes

From: Tachino Nobuhiro (tachino@open.nm.fujitsu.co.jp)
Date: Thu Dec 20 2001 - 20:38:54 EST


At Thu, 20 Dec 2001 11:46:23 -0800,
Linus Torvalds wrote:
>
> The problem is that having buffers doesn't necessarily always mean that
> they are valid, nor that _all_ of them are valid.

  If following sequence occurs, ramdisk_readpage() may clear the valid buffer
data. I'm not sure whether this really occurs, but if it does,
I think lock_buffer()/unlock_buffer() may be required.

        CPU1 CPU2
---------------------------------------------------------------------------
        call ext2_alloc_branch() call ramdisk_readpage()

        bh = getblk();
        lock_buffer(bh);

        write data to bh.
                                                ramdisk_readpage()
                                                if (!buffer_uptodate(bh))
                                                        do memset()

        mark_buffer_uptodate()
        unlock_buffer(bh);
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Sun Dec 23 2001 - 21:00:24 EST