mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Petr Vandrovec" <VANDROVE@vc.cvut.cz>
To: Patrick Mochel <mochel@osdl.org>
Cc: <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] read() from driverfs files can read more bytes
Date: Thu, 7 Feb 2002 18:25:57 +0100	[thread overview]
Message-ID: <11240BA04440@vcnet.vc.cvut.cz> (raw)

On  7 Feb 02 at 8:45, Patrick Mochel wrote:
> On Thu, 7 Feb 2002, Andrey Panin wrote:
> > Attached patch adds check that returned value is less then requested 
> > byte count. I know that actual callback function device_read_status()
> > should also be fixed, but I found this bug after midnight and 
> > decided to sleep a little :)
> 
> That sanity check was in there, once upon a time. However, in moving the 
> weight from the driver callbacks to the driverfs read_file() and 
> write_file(), it must have got dropped...
> 
> Thank you. It's been applied and will be pushed forward.

[I have only 2.5.3 sources here yet]

Can you also check for size >= PAGE_SIZE on enter to entry->show()
procedure? It looks ugly to me that each driver has to check for this
constant unless it wants to smash some innocent kernel memory.

And neither of driverfs_read_file nor driverfs_write_file supports
semantic we use with other filesystems: If at least one byte was 
read/written, return byte count (even if error happens). Only if zero 
bytes was written, return error code.
                                Thanks,
                                            Petr Vandrovec
                                            vandrove@vc.cvut.cz


             reply	other threads:[~2002-02-07 17:26 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-02-07 17:25 Petr Vandrovec [this message]
2002-02-07 17:43 ` Patrick Mochel
2002-02-07 18:11 Thomas Hood
2002-02-07 18:15 Petr Vandrovec
2002-02-07 18:27 ` Patrick Mochel
2002-02-08 19:18   ` Pavel Machek
2002-02-07 20:11 Petr Vandrovec
2002-02-07 20:21 ` Patrick Mochel
2002-02-07 20:26   ` Alexander Viro
2002-02-07 20:59     ` Patrick Mochel
2002-02-07 21:37       ` Alexander Viro

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=11240BA04440@vcnet.vc.cvut.cz \
    --to=vandrove@vc.cvut.cz \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mochel@osdl.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®