* Re: Copy_to_user and copy_from_user
@ 2004-08-09 13:26 Ramesh Sudini
0 siblings, 0 replies; 3+ messages in thread
From: Ramesh Sudini @ 2004-08-09 13:26 UTC (permalink / raw)
To: kernoulas; +Cc: linux-kernel
Then, how do I make sure that all the data I wanted to be copied is infact
copied?? What are the scenarios where copy_to/from_user could fail and how
can I avoid it.
Thanks
-Ramesh
>
>No you cannot call it until all data has been copied. copy_{to,from}_user
>fails when a fault happens during the copy process. So you simply cannot
>try again... It will fault again.
>Well, not 100% true. An other running thread (same mm with the process
>which copies data) can "fix" the faulty adress space. Bad thread....
>
>Ramesh Sudini wrote:
>>Hi,
>>
>>If copy_from_user returns non zero value, then I do not see any driver(for
>>example PPP) try to copy the remaining data. It treats it as an error
>>scenario.
>>
>>Why is this? Shouldnt it have a while loop and attempt to copy_from_user
>>till all the data is copied??
>>
>>I am writing a driver and trying to understand what needs to be done in
>>case it returns a non-zero value? I have huge amount of data to be copied
>>from user space Ex: 3000byte messages.
>>
>>Can somebody suggest me what is the best I could do...(Please cc me
>>personally with your response)
>>
>>Thanks
>>Ramesh
>>
_________________________________________________________________
Express yourself instantly with MSN Messenger! Download today - it's FREE!
http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/
^ permalink raw reply [flat|nested] 3+ messages in thread
* Copy_to_user and copy_from_user
@ 2004-08-03 20:45 Ramesh Sudini
2004-08-03 18:07 ` Kernoulas
0 siblings, 1 reply; 3+ messages in thread
From: Ramesh Sudini @ 2004-08-03 20:45 UTC (permalink / raw)
To: linux-kernel, rameshred
Hi,
If copy_from_user returns non zero value, then I do not see any driver(for
example PPP) try to copy the remaining data. It treats it as an error
scenario.
Why is this? Shouldnt it have a while loop and attempt to copy_from_user
till all the data is copied??
I am writing a driver and trying to understand what needs to be done in case
it returns a non-zero value? I have huge amount of data to be copied from
user space Ex: 3000byte messages.
Can somebody suggest me what is the best I could do...(Please cc me
personally with your response)
Thanks
Ramesh
_________________________________________________________________
FREE pop-up blocking with the new MSN Toolbar get it now!
http://toolbar.msn.click-url.com/go/onm00200415ave/direct/01/
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Copy_to_user and copy_from_user
2004-08-03 20:45 Ramesh Sudini
@ 2004-08-03 18:07 ` Kernoulas
0 siblings, 0 replies; 3+ messages in thread
From: Kernoulas @ 2004-08-03 18:07 UTC (permalink / raw)
To: Ramesh Sudini; +Cc: linux-kernel
No you cannot call it until all data has been copied.
copy_{to,from}_user fails when a fault happens during the copy process.
So you simply cannot try again... It will fault again.
Well, not 100% true. An other running thread (same mm with the process
which copies data) can "fix" the faulty adress space. Bad thread....
Ramesh Sudini wrote:
> Hi,
>
> If copy_from_user returns non zero value, then I do not see any
> driver(for example PPP) try to copy the remaining data. It treats it as
> an error scenario.
>
> Why is this? Shouldnt it have a while loop and attempt to copy_from_user
> till all the data is copied??
>
> I am writing a driver and trying to understand what needs to be done in
> case it returns a non-zero value? I have huge amount of data to be
> copied from user space Ex: 3000byte messages.
>
> Can somebody suggest me what is the best I could do...(Please cc me
> personally with your response)
>
> Thanks
> Ramesh
>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2004-08-09 13:26 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-08-09 13:26 Copy_to_user and copy_from_user Ramesh Sudini
-- strict thread matches above, loose matches on Subject: below --
2004-08-03 20:45 Ramesh Sudini
2004-08-03 18:07 ` Kernoulas
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®