[lkml]   [2001]   [Apr]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
    SubjectRe: [PATCH] SMP race in ext2 - metadata corruption.

    On Thu, 26 Apr 2001, Linus Torvalds wrote:

    > Note that I think all these arguments are fairly bogus. Doing things like
    > "dump" on a live filesystem is stupid and dangerous (in my opinion it is
    > stupid and dangerous to use "dump" at _all_, but that's a whole 'nother
    > discussion in itself), and there really are no valid uses for opening a
    > block device that is already mounted. More importantly, I don't think
    > anybody actually does.


    > The fact that you _can_ do so makes the patch valid, and I do agree with
    > Al on the "least surprise" issue. I've already applied the patch, in fact.
    > But the fact is that nobody should ever do the thing that could cause
    > problems.

    IMO the real issue is in fuzzy rules for use of wait_on_buffer(). There is
    one case when it's 100% correct - when we had done ll_rw_block() on that
    bh at earlier point and want to make sure that it's completed. And there
    is a lot of uses that are kinda-sorta correct for UP, but break on SMP.
    unmap_buffer() was similar to that race. So are races in minix, sysvfs and
    ufs. So is one in block_write() and here the problem is quite real - it's
    not as idiotic as device/mounted fs races.

    Basically, all legitimate cases are ones where we would be very unhappy
    about buffer being not uptodate afterwards.
    getblk(); if (!buffer_uptodate) wait_on_buffer();
    is not in that class. It _is_ OK on UP as long as we don't block, but on
    SMP it doesn't guarantee anything - buffer_head can be in any state
    when we are done. IMO all such places require fixing.

    How about adding
    if (!buffer_uptodate(bh)) {
    printk(KERN_ERR "IO error or racy use of wait_on_buffer()");
    in the end of wait_on_buffer() for a while?

    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to
    More majordomo info at
    Please read the FAQ at

     \ /
      Last update: 2005-03-22 12:52    [W:0.023 / U:0.060 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site