LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: "Nate Diller" <nate.diller@gmail.com>
To: "David Brownell" <david-b@pacbell.net>
Cc: "Nate Diller" <nate@agami.com>, "Andrew Morton" <akpm@osdl.org>,
	"Alan Cox" <alan@lxorguk.ukuu.org.uk>,
	"Trond Myklebust" <trond.myklebust@fys.uio.no>,
	"Benjamin LaHaise" <bcrl@kvack.org>,
	"Alexander Viro" <viro@zeniv.linux.org.uk>,
	"Suparna Bhattacharya" <suparna@in.ibm.com>,
	"Kenneth W Chen" <kenneth.w.chen@intel.com>,
	"David Brownell" <dbrownell@users.sourceforge.net>,
	"Christoph Hellwig" <hch@infradead.org>,
	linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org,
	netdev@vger.kernel.org, ocfs2-devel@oss.oracle.com,
	linux-aio@kvack.org, xfs-masters@oss.sgi.com
Subject: Re: [PATCH -mm 4/10][RFC] aio: convert aio_complete to file_endio_t
Date: Tue, 16 Jan 2007 01:21:24 -0800	[thread overview]
Message-ID: <5c49b0ed0701160121t7d65de92u74454f2debb86ea2@mail.gmail.com> (raw)
In-Reply-To: <200701152153.49260.david-b@pacbell.net>

On 1/15/07, David Brownell <david-b@pacbell.net> wrote:
> On Monday 15 January 2007 5:54 pm, Nate Diller wrote:
> > --- a/drivers/usb/gadget/inode.c      2007-01-12 14:42:29.000000000 -0800
> > +++ b/drivers/usb/gadget/inode.c      2007-01-12 14:25:34.000000000 -0800
> > @@ -559,35 +559,32 @@ static int ep_aio_cancel(struct kiocb *i
> >       return value;
> >  }
> >
> > -static ssize_t ep_aio_read_retry(struct kiocb *iocb)
> > +static int ep_aio_read_retry(struct kiocb *iocb)
> >  {
> >       struct kiocb_priv       *priv = iocb->private;
> > -     ssize_t                 len, total;
> > -     int                     i;
> > +     ssize_t                 total;
> > +     int                     i, err = 0;
> >
> >       /* we "retry" to get the right mm context for this: */
> >
> >       /* copy stuff into user buffers */
> >       total = priv->actual;
> > -     len = 0;
> >       for (i=0; i < priv->nr_segs; i++) {
> >               ssize_t this = min((ssize_t)(priv->iv[i].iov_len), total);
> >
> >               if (copy_to_user(priv->iv[i].iov_base, priv->buf, this)) {
> > -                     if (len == 0)
> > -                             len = -EFAULT;
> > +                     err = -EFAULT;
>
> Discarding the capability to report partial success, e.g. that the first N
> bytes were properly transferred?  I don't see any virtue in that change.
> Quite the opposite in fact.
>
> I think you're also expecting that if N bytes were requested, that's always
> how many will be received.  That's not true for packetized I/O such as USB
> isochronous transfers ... where it's quite legit (and in some cases routine)
> for the other end to send packets that are shorter than the maximum allowed.
> Sending a zero length packet is not the same as sending no packet at all,
> for another example.

I will convert this (usb) code to use the standard completion path,
which you will notice *gained* the ability to properly report both an
error and a partial success as part of this patch.  In fact, fixing
this up was my intention when I wrote this patch, and the later patch
was a compromise intended to get this whole bundle out for review in a
timely manner :)

NATE

  reply	other threads:[~2007-01-16  9:21 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-01-16  1:54 [PATCH -mm 0/10][RFC] aio: make struct kiocb private Nate Diller
2007-01-16  1:54 ` [PATCH -mm 7/10][RFC] aio: make __blockdev_direct_IO use file_endio_t Nate Diller
2007-01-16  1:54 ` [PATCH -mm 4/10][RFC] aio: convert aio_complete to file_endio_t Nate Diller
2007-01-16  5:53   ` David Brownell
2007-01-16  9:21     ` Nate Diller [this message]
2007-01-16  1:54 ` [PATCH -mm 5/10][RFC] aio: make blk_directIO use file_endio_t Nate Diller
2007-01-16  1:54 ` [PATCH -mm 8/10][RFC] aio: make direct_IO aops " Nate Diller
2007-01-16  1:54 ` [PATCH -mm 1/10][RFC] aio: scm remove struct siocb Nate Diller
2007-01-16  1:54 ` [PATCH -mm 6/10][RFC] aio: make nfs_directIO use file_endio_t Nate Diller
2007-01-16  1:54 ` [PATCH -mm 10/10][RFC] aio: convert file aio to file_endio_t Nate Diller
2007-01-16  1:54 ` [PATCH -mm 2/10][RFC] aio: net use struct socket for io Nate Diller
2007-01-16  5:44   ` Stephen Hemminger
2007-01-16 10:24     ` Evgeniy Polyakov
2007-01-16  1:54 ` [PATCH -mm 9/10][RFC] aio: usb gadget remove aio file ops Nate Diller
2007-01-16  6:05   ` David Brownell
2007-01-16  9:13     ` Nate Diller
2007-01-16 18:36       ` David Brownell
2007-01-16  1:54 ` [PATCH -mm 3/10][RFC] aio: use iov_length instead of ki_left Nate Diller
2007-01-16  2:14   ` Christoph Hellwig
2007-01-16  5:37     ` Nate Diller
2007-01-16 23:36       ` Ingo Oeser
2007-01-18  4:27     ` Vectored AIO breakage for sockets and pipes ? Suparna Bhattacharya
2007-01-18 21:40       ` Zach Brown
2007-01-16  3:23 ` [PATCH -mm 0/10][RFC] aio: make struct kiocb private Christoph Hellwig
2007-01-16  4:25   ` Nate Diller
2007-01-16  8:22     ` David Brownell
2007-01-17 21:52     ` Benjamin LaHaise
2007-01-17 23:30       ` Nate Diller

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=5c49b0ed0701160121t7d65de92u74454f2debb86ea2@mail.gmail.com \
    --to=nate.diller@gmail.com \
    --cc=akpm@osdl.org \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=bcrl@kvack.org \
    --cc=david-b@pacbell.net \
    --cc=dbrownell@users.sourceforge.net \
    --cc=hch@infradead.org \
    --cc=kenneth.w.chen@intel.com \
    --cc=linux-aio@kvack.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nate@agami.com \
    --cc=netdev@vger.kernel.org \
    --cc=ocfs2-devel@oss.oracle.com \
    --cc=suparna@in.ibm.com \
    --cc=trond.myklebust@fys.uio.no \
    --cc=viro@zeniv.linux.org.uk \
    --cc=xfs-masters@oss.sgi.com \
    --subject='Re: [PATCH -mm 4/10][RFC] aio: convert aio_complete to file_endio_t' \
    /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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).