[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200721011509.GB15516@casper.infradead.org>
Date: Tue, 21 Jul 2020 02:15:09 +0100
From: Matthew Wilcox <willy@...radead.org>
To: Damien Le Moal <Damien.LeMoal@....com>
Cc: Kanchan Joshi <joshiiitr@...il.com>,
"hch@...radead.org" <hch@...radead.org>,
Jens Axboe <axboe@...nel.dk>,
Kanchan Joshi <joshi.k@...sung.com>,
"viro@...iv.linux.org.uk" <viro@...iv.linux.org.uk>,
"bcrl@...ck.org" <bcrl@...ck.org>,
"asml.silence@...il.com" <asml.silence@...il.com>,
"linux-fsdevel@...r.kernel.org" <linux-fsdevel@...r.kernel.org>,
Matias Bj??rling <mb@...htnvm.io>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"linux-aio@...ck.org" <linux-aio@...ck.org>,
"io-uring@...r.kernel.org" <io-uring@...r.kernel.org>,
"linux-block@...r.kernel.org" <linux-block@...r.kernel.org>,
Selvakumar S <selvakuma.s1@...sung.com>,
Nitesh Shetty <nj.shetty@...sung.com>,
Javier Gonzalez <javier.gonz@...sung.com>
Subject: Re: [PATCH v3 4/4] io_uring: add support for zone-append
On Tue, Jul 21, 2020 at 12:59:59AM +0000, Damien Le Moal wrote:
> On 2020/07/21 5:17, Kanchan Joshi wrote:
> > On Mon, Jul 20, 2020 at 10:44 PM Matthew Wilcox <willy@...radead.org> wrote:
> >> struct io_uring_cqe {
> >> __u64 user_data; /* sqe->data submission passed back */
> >> - __s32 res; /* result code for this event */
> >> - __u32 flags;
> >> + union {
> >> + struct {
> >> + __s32 res; /* result code for this event */
> >> + __u32 flags;
> >> + };
> >> + __s64 res64;
> >> + };
> >> };
> >>
> >> Return the value in bytes in res64, or a negative errno. Done.
> >
> > I concur. Can do away with bytes-copied. It's either in its entirety
> > or not at all.
> >
>
> SAS SMR drives may return a partial completion. So the size written may be less
> than requested, but not necessarily 0, which would be an error anyway since any
> condition that would lead to 0B being written will cause the drive to fail the
> command with an error.
Why might it return a short write? And, given how assiduous programmers
are about checking for exceptional conditions, is it useful to tell
userspace "only the first 512 bytes of your 2kB write made it to storage"?
Or would we rather just tell userspace "you got an error" and _not_
tell them that the first N bytes made it to storage?
> Also, the completed size should be in res in the first cqe to follow io_uring
> current interface, no ?. The second cqe would use the res64 field to return the
> written offset. Wasn't that the plan ?
two cqes for one sqe seems like a bad idea to me.
Powered by blists - more mailing lists