Re: [PATCH v4 6/6] io_uring: add support for zone-append

hch
2020-07-31T09:14:33Z

On Fri, Jul 31, 2020 at 08:14:22AM +0000, Damien Le Moal wrote:
>
> > This was one of the reason why we chose to isolate the operation by a
> > different IOCB flag and not by IOCB_APPEND alone.
>
> For zonefs, the plan is:
> * For the sync write case, zone append is always used.
> * For the async write case, if we see IOCB_APPEND, then zone append BIOs are
> used. If not, regular write BIOs are used.
>
> Simple enough I think. No need for a new flag.

Simple, but wrong. Sync vs async really doesn't matter, even sync
writes will have problems if there are other writers. We need a flag
for "report the actual offset for appending writes", and based on that
flag we need to not allow short writes (or split extents for real
file systems). We also need a fcntl or ioctl to report this max atomic
write size so that applications can rely on it.