From: mkletzan@redhat.com (Martin Kletzander)
To: kernelnewbies@lists.kernelnewbies.org
Subject: Char device write repeating
Date: Wed, 5 Oct 2016 08:29:16 +0200 [thread overview]
Message-ID: <20161005062916.GE16414@wheatley> (raw)
In-Reply-To: <20161004150557.GB25308@kroah.com>
On Tue, Oct 04, 2016 at 05:05:57PM +0200, Greg KH wrote:
>On Tue, Oct 04, 2016 at 10:58:16AM -0400, Kenneth Adam Miller wrote:
>> I have a character device that I am calling write on and which is succeeding,
>> but which is repeatedly executing. I have hard coded the return value to one,
Correct me if I'm wrong, I'm just a self-thought newbie, but this ^^
sounds to me like the problem. Because the write should return how many
bytes were written (or error), the function is being called until it's
been all written. If you just want to be called once and you don't care
what the data are (which is the weird thing in the first place), I think
you should return the length you got as an argument.
>> so I don't think the userland standard library is retrying but I could be
>> wrong. Can anybody tell me why write would be re-executed by the kernel and how
>> to fix it? I dont actually copy_from_user, I just need this in order to signal
>> kernel land.
>
>Do you have a pointer to your code somewhere? This is a very common bug
>that people have...
>
>thanks,
>
>greg k-h
>
>_______________________________________________
>Kernelnewbies mailing list
>Kernelnewbies at kernelnewbies.org
>https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 801 bytes
Desc: Digital signature
Url : http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20161005/f0fb88d5/attachment.bin
next prev parent reply other threads:[~2016-10-05 6:29 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <CAK7rcp8HTmpVDZHDMw75Oep1eGS+efs5EUUh26mFvWmXaFVGCg@mail.gmail.com>
[not found] ` <CAK7rcp9akHJ4E1Ms9HwsNWTpnDjPyGcf8OE+an2bRDCbVLAO7g@mail.gmail.com>
[not found] ` <CAK7rcp-1GfT3M9bNA-STDhgXjO9WX+SCZoAGZgYo_uZZjA-TAA@mail.gmail.com>
[not found] ` <CAK7rcp9yVW2m9pRCB=dTFrN6Pey+_1FukP2xfizaKY5_T5RP6Q@mail.gmail.com>
[not found] ` <CAK7rcp9BGzQTM0y=kHhqiJru45g1tbusgtkBRaw9jLM=R4UdsQ@mail.gmail.com>
2016-10-04 14:58 ` Char device write repeating Kenneth Adam Miller
2016-10-04 15:05 ` Greg KH
2016-10-04 18:42 ` Daniel.
2016-10-05 12:44 ` François
2016-10-05 6:29 ` Martin Kletzander [this message]
2016-10-05 11:30 ` Kenneth Adam Miller
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=20161005062916.GE16414@wheatley \
--to=mkletzan@redhat.com \
--cc=kernelnewbies@lists.kernelnewbies.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.