All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dave Chinner <david@fromorbit.com>
To: Raphael Carvalho <raphael.scarv@gmail.com>
Cc: Goldwyn Rodrigues <rgoldwyn@suse.de>,
	linux-block@vger.kernel.org, linux-fsdevel@vger.kernel.org,
	darrick.wong@oracle.com, Goldwyn Rodrigues <rgoldwyn@suse.com>
Subject: Re: [PATCH 2/2] xfs: remove assert to check bytes returned
Date: Fri, 19 Jan 2018 15:51:39 +1100	[thread overview]
Message-ID: <20180119045139.GN16421@dastard> (raw)
In-Reply-To: <CACz=WefRiobqX4vfEif2BebQcWjHkeCKE26DFXoxZvGUJ3Hq1w@mail.gmail.com>

On Fri, Jan 19, 2018 at 02:23:16AM -0200, Raphael Carvalho wrote:
> On Fri, Jan 19, 2018 at 1:57 AM, Dave Chinner <david@fromorbit.com> wrote:
> >
> > On Thu, Jan 18, 2018 at 06:57:41PM -0600, Goldwyn Rodrigues wrote:
> > > From: Goldwyn Rodrigues <rgoldwyn@suse.com>
> > >
> > > Since we can return less than count in case of partial direct
> > > writes, remove the ASSERT.
> > >
> > > Signed-off-by: Goldwyn Rodrigues <rgoldwyn@suse.com>
> > > ---
> > >  fs/xfs/xfs_file.c | 6 ------
> > >  1 file changed, 6 deletions(-)
> > >
> > > diff --git a/fs/xfs/xfs_file.c b/fs/xfs/xfs_file.c
> > > index 8601275cc5e6..8fc4dbf66910 100644
> > > --- a/fs/xfs/xfs_file.c
> > > +++ b/fs/xfs/xfs_file.c
> > > @@ -590,12 +590,6 @@ xfs_file_dio_aio_write(
> > >       ret = iomap_dio_rw(iocb, from, &xfs_iomap_ops, xfs_dio_write_end_io);
> > >  out:
> > >       xfs_iunlock(ip, iolock);
> > > -
> > > -     /*
> > > -      * No fallback to buffered IO on errors for XFS, direct IO will either
> > > -      * complete fully or fail.
> > > -      */
> > > -     ASSERT(ret < 0 || ret == count);
> > >       return ret;
> > >  }
> >
> > Acked-by: Dave Chinner <dchinner@redhat.com>
> 
> 
> Is this really correct?

Yes.

> Isn't this check with regards to DIO
> submission?

Yes, if there is an error during submission.

But it also checked synchronous IO completion (i.e. error or bytes
written), because iomap_dio_rw() waits for non-AIO DIO to complete
and returns the IO completion status in that case.

> The bytes written is returned in a different asynchronous
> path due to AIO support, no?!

That is correct. For AIO we'll get -EIOCBQUEUED here on successful
submission.

Cheers,

Dave.
-- 
Dave Chinner
david@fromorbit.com

  reply	other threads:[~2018-01-19  4:52 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-19  0:57 [PATCH v5 1/2] Return bytes transferred for partial direct I/O Goldwyn Rodrigues
2018-01-19  0:57 ` [PATCH 2/2] xfs: remove assert to check bytes returned Goldwyn Rodrigues
2018-01-19  3:57   ` Dave Chinner
2018-01-19  4:23     ` Raphael Carvalho
2018-01-19  4:51       ` Dave Chinner [this message]
2018-01-19  2:13 ` [PATCH v5 1/2] Return bytes transferred for partial direct I/O Al Viro
2018-01-19  3:59   ` Dave Chinner
2018-01-19  6:31     ` Darrick J. Wong
2018-01-19  6:33       ` Al Viro
2018-01-20 19:47         ` Al Viro
2018-01-21  2:57           ` Goldwyn Rodrigues
2018-01-21  2:11 ` Andi Kleen
2018-01-21  2:23   ` Goldwyn Rodrigues
2018-01-21  3:07     ` Jens Axboe
2018-01-21 12:06       ` Goldwyn Rodrigues
2018-01-22 18:08         ` Andi Kleen
2018-01-22 19:10       ` Andreas Dilger
2018-01-22 19:13         ` Jens Axboe
2018-01-23  3:18           ` Goldwyn Rodrigues
2018-01-23  3:28             ` Jens Axboe
2018-01-23  6:35               ` Matthew Wilcox
2018-01-25 18:01                 ` Goldwyn Rodrigues
2018-01-24  0:19               ` Andreas Dilger
2018-01-22 22:25       ` Elliott, Robert (Persistent Memory)
2018-01-22 22:25         ` Elliott, Robert (Persistent Memory)
2018-01-22 23:14         ` Jens Axboe
2018-01-22 23:24           ` Bart Van Assche
2018-01-22 23:24             ` Bart Van Assche
2018-01-22 23:27             ` Jens Axboe
  -- strict thread matches above, loose matches on Subject: below --
2018-01-29 14:57 [PATCH v6 " Goldwyn Rodrigues
2018-01-29 14:57 ` [PATCH 2/2] xfs: remove assert to check bytes returned Goldwyn Rodrigues
2018-01-29 18:50   ` Jens Axboe

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=20180119045139.GN16421@dastard \
    --to=david@fromorbit.com \
    --cc=darrick.wong@oracle.com \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=raphael.scarv@gmail.com \
    --cc=rgoldwyn@suse.com \
    --cc=rgoldwyn@suse.de \
    /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.