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
- Previous message: Randy.Dunlap: "Re: [PATCH] CKRM: 3/10 CKRM: Core ckrm, rcfs"
- In reply to: Alan Cox: "Re: [PATCH][2/2] ide-tape: small cleanups - handle copy_to|from_user() failures"
- Next in thread: Jesper Juhl: "Re: [PATCH][2/2] ide-tape: small cleanups - handle copy_to|from_user() failures"
- Reply: Jesper Juhl: "Re: [PATCH][2/2] ide-tape: small cleanups - handle copy_to|from_user() failures"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
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/
- Previous message: Randy.Dunlap: "Re: [PATCH] CKRM: 3/10 CKRM: Core ckrm, rcfs"
- In reply to: Alan Cox: "Re: [PATCH][2/2] ide-tape: small cleanups - handle copy_to|from_user() failures"
- Next in thread: Jesper Juhl: "Re: [PATCH][2/2] ide-tape: small cleanups - handle copy_to|from_user() failures"
- Reply: Jesper Juhl: "Re: [PATCH][2/2] ide-tape: small cleanups - handle copy_to|from_user() failures"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|
|