From: Matthew Bobrowski <mbobrowski@mbobrowski.org>
To: Ritesh Harjani <riteshh@linux.ibm.com>
Cc: tytso@mit.edu, jack@suse.cz, adilger.kernel@dilger.ca,
linux-ext4@vger.kernel.org, linux-fsdevel@vger.kernel.org,
david@fromorbit.com, hch@infradead.org, darrick.wong@oracle.com
Subject: Re: [PATCH v2 5/6] ext4: introduce direct IO write path using iomap infrastructure
Date: Tue, 10 Sep 2019 20:31:47 +1000 [thread overview]
Message-ID: <20190910103147.GA10579@bobrowski> (raw)
In-Reply-To: <20190909092617.07ECB42041@d06av24.portsmouth.uk.ibm.com>
On Mon, Sep 09, 2019 at 02:56:15PM +0530, Ritesh Harjani wrote:
> On 9/9/19 4:49 AM, Matthew Bobrowski wrote:
> > +/*
> > + * For a write that extends the inode size, ext4_dio_write_iter() will
> > + * wait for the write to complete. Consequently, operations performed
> > + * within this function are still covered by the inode_lock().
> > + */
> Maybe add a comment that on success this returns 0.
OK, can do.
> > +static int ext4_dio_write_end_io(struct kiocb *iocb, ssize_t size, int error,
> > + unsigned int flags)
> > +{
> > + int ret = 0;
> No need to initialize ret.
>
>
> > + loff_t offset = iocb->ki_pos;
> > + struct inode *inode = file_inode(iocb->ki_filp);
> > +
> > + if (error) {
> > + ret = ext4_handle_failed_inode_extension(inode, offset + size);
> > + return ret ? ret : error;
> > + }
> > +
> > + if (flags & IOMAP_DIO_UNWRITTEN) {
> > + ret = ext4_convert_unwritten_extents(NULL, inode,
> > + offset, size);
> > + if (ret)
> > + return ret;
> > + }
> > +
> > + if (offset + size > i_size_read(inode)) {
> > + ret = ext4_handle_inode_extension(inode, offset, size, 0);
> > + if (ret)
> > + return ret;
> > + }
> > + return ret;
> Directly return 0, since if it falls here it mans it is a success case.
> You are anyway returning error from above error paths.
OK, sure.
--<M>--
next prev parent reply other threads:[~2019-09-10 10:31 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-09-08 23:18 [PATCH v2 0/6] ext4: port direct IO to iomap infrastructure Matthew Bobrowski
2019-09-08 23:18 ` [PATCH v2 1/6] ext4: introduce direct IO read path using " Matthew Bobrowski
2019-09-09 7:48 ` Ritesh Harjani
2019-09-08 23:19 ` [PATCH v2 2/6] ext4: move inode extension/truncate code out from ext4_iomap_end() Matthew Bobrowski
2019-09-09 8:17 ` Ritesh Harjani
2019-09-10 10:26 ` Matthew Bobrowski
2019-09-10 11:16 ` Ritesh Harjani
2019-09-08 23:19 ` [PATCH v2 3/6] iomap: modify ->end_io() calling convention Matthew Bobrowski
2019-09-08 23:32 ` Matthew Bobrowski
2019-09-08 23:19 ` [PATCH v2 4/6] ext4: reorder map.m_flags checks in ext4_iomap_begin() Matthew Bobrowski
2019-09-09 8:30 ` Ritesh Harjani
2019-09-08 23:19 ` [PATCH v2 5/6] ext4: introduce direct IO write path using iomap infrastructure Matthew Bobrowski
2019-09-09 9:20 ` Ritesh Harjani
2019-09-09 9:26 ` Ritesh Harjani
2019-09-09 14:32 ` Ritesh Harjani
2019-09-10 11:20 ` Matthew Bobrowski
2019-09-10 10:31 ` Matthew Bobrowski [this message]
2019-09-11 8:08 ` Ritesh Harjani
2019-09-11 12:39 ` Matthew Bobrowski
2019-09-08 23:20 ` [PATCH v2 6/6] ext4: cleanup legacy buffer_head direct IO code Matthew Bobrowski
2019-09-09 9:36 ` Ritesh Harjani
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=20190910103147.GA10579@bobrowski \
--to=mbobrowski@mbobrowski.org \
--cc=adilger.kernel@dilger.ca \
--cc=darrick.wong@oracle.com \
--cc=david@fromorbit.com \
--cc=hch@infradead.org \
--cc=jack@suse.cz \
--cc=linux-ext4@vger.kernel.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=riteshh@linux.ibm.com \
--cc=tytso@mit.edu \
/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.