mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Ramesh Sudini" <rameshred@hotmail.com>
To: kernoulas@sisifus.ceid.upatras.gr
Cc: linux-kernel@vger.kernel.org
Subject: Re: Copy_to_user and copy_from_user
Date: Mon, 09 Aug 2004 13:26:45 +0000	[thread overview]
Message-ID: <BAY12-F12qunLOyDc4100039e06@hotmail.com> (raw)


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/


             reply	other threads:[~2004-08-09 13:26 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-08-09 13:26 Ramesh Sudini [this message]
  -- strict thread matches above, loose matches on Subject: below --
2004-08-03 20:45 Ramesh Sudini
2004-08-03 18:07 ` Kernoulas

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=BAY12-F12qunLOyDc4100039e06@hotmail.com \
    --to=rameshred@hotmail.com \
    --cc=kernoulas@sisifus.ceid.upatras.gr \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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®