Re: [PATCH][2/2] ide-tape: small cleanups - handle copy_to|from_user() failures

From: Bill Davidsen (davidsen_at_tmr.com)
Date: 11/29/04

  • Next message: George Anzinger: "A problem with xconfig"
    Date:	Mon, 29 Nov 2004 17:47:10 -0500
    To: Alan Cox <alan@lxorguk.ukuu.org.uk>
    
    

    Alan Cox wrote:
    > On Sul, 2004-11-28 at 16:32, Jesper Juhl wrote:
    >
    >> #endif /* IDETAPE_DEBUG_BUGS */
    >> count = min((unsigned int)(bh->b_size - atomic_read(&bh->b_count)), (unsigned int)n);
    >>- copy_from_user(bh->b_data + atomic_read(&bh->b_count), buf, count);
    >>+ if (copy_from_user(bh->b_data + atomic_read(&bh->b_count), buf, count))
    >>+ return -EFAULT;
    >> n -= count;
    >> atomic_add(count, &bh->b_count);
    >> buf += count;
    >
    >
    > If you do this then you don't fix up tape->bh for further operations.
    > Have you tested these changes including the I/O errors ?

    But (a) do you have enough information to backout or fixup correctly?
    And (b) won't this result in the whole i/o being treated as invalid?

    -- 
        -bill davidsen (davidsen@tmr.com)
    "The secret to procrastination is to put things off until the
      last possible moment - but no longer"  -me
    -
    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/
    

  • Next message: George Anzinger: "A problem with xconfig"

    Relevant Pages

    • Re: [PATCH] ReiserFS I/O error Handling [was Re: kernel BUG at fs/reiserfs/prints.c:339! kernel 2.6.
      ... > controller, or the cable connecting them, but somehow hdb1 started ... > getting I/O errors. ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Re: Odd data corruption problem with LVM/ReiserFS
      ... > correct data from tar. ... Then run find again and you'll again get I/O errors. ... take any DM snapshots when you experienced that corruption? ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Re: Odd data corruption problem with LVM/ReiserFS
      ... > The weird thing is I did not see any I/O errors in my logs, ... > take any DM snapshots when you experienced that corruption? ... The fun part is that I got the I/O errors for varying ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Re: Odd data corruption problem with LVM/ReiserFS
      ... Both filesystems have issues when restoring from backup (i.e. very heavy ... The symptoms are _not_ I/O errors (but until I see logs I wouldn't believe ... A reboot fixes this for both ext3 and reiserfs. ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • [PATCH] ReiserFS v3 I/O error handling
      ... graceless it is in handling critical I/O errors. ... ReiserFS doesn't offer the admin any such choice, ... These patches have seen a lot of testing in the SuSE Linux Enterprise ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)