Tarantool development patches archive
 help / color / mirror / Atom feed
From: Cyrill Gorcunov <gorcunov@gmail.com>
To: Vladislav Shpilevoy <v.shpilevoy@tarantool.org>
Cc: tml <tarantool-patches@dev.tarantool.org>
Subject: Re: [Tarantool-patches] [PATCH] fio/coio: handle partial writes
Date: Wed, 10 Jun 2020 10:52:57 +0300	[thread overview]
Message-ID: <20200610075257.GO134822@grain> (raw)
In-Reply-To: <cba903ec-3032-fae2-21da-41a39468a16e@tarantool.org>

On Wed, Jun 10, 2020 at 12:55:04AM +0200, Vladislav Shpilevoy wrote:
> Hi! Thanks for the patch!
> 
> See 4 comments below.
> 
> On 21/04/2020 23:39, Cyrill Gorcunov wrote:
> > Writting less bytes than requested is perfectly fine.
> 
> 1. 'Writting' -> 'Writing'.

Yup, thanks!

> > +
> > +	while (left > 0) {
> > +		INIT_COEIO_FILE(eio);
> > +		chunk = left;
> > +
> > +		ERROR_INJECT(ERRINJ_COIO_WRITE_CHUNK, {
> > +			chunk = 1;
> > +		});
> > +
> > +		req = eio_write(fd, (void *)buf + pos, chunk,
> 
> 2. As it was fairly noticed by Timur in one of my
> patches for lsregion - lets better avoid 'void' pointer
> arithmetic. And use uint8_t * or char *.

OK (though the compilers we work with support this kind of arithmetics
pretty well, moreover we already depend heavilty on gcc/llvm extensions,
but no problem, will update).

> > +				offset + pos, EIO_PRI_DEFAULT,
> > +				coio_complete, &eio);
> > +		res = coio_wait_done(req, &eio);
> > +		if (res < 0) {
> > +			pos = -1;
> 
> 3. What if eio_write() returns EAGAIN/EINTR/WOULDBLOCK? Can it
> happen at all? Can it happen, if the descriptor is not
> blocking? Can it happen if the underlying FS is a network
> file system, like sshfs via FUSE?
> 
> Coio socket library handles these errors and retries them.

This patch doesn't address retries. Strictly speaking we should
(for example coio_preadn does). But I think it is separate issue.
I'll file a bug.

> 
> 4. Please
> 
> - Add the issue reference, like this:
> 
> 	--
> 	-- gh-4651: ...
> 	--
> 
> - Start sentences from a capital letter, and finish with dot.

Sure, thanks!

  reply	other threads:[~2020-06-10  7:53 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-21 21:39 Cyrill Gorcunov
2020-05-06 17:08 ` Alexander Turenko
2020-05-15  9:00   ` Cyrill Gorcunov
2020-06-09 16:55     ` Alexander Turenko
2020-06-09 22:55     ` Vladislav Shpilevoy
2020-06-09 22:55 ` Vladislav Shpilevoy
2020-06-10  7:52   ` Cyrill Gorcunov [this message]
2020-06-11 19:36     ` Vladislav Shpilevoy
2020-06-11 19:43       ` Cyrill Gorcunov
2020-06-11 19:56         ` Vladislav Shpilevoy
2020-06-11 20:12           ` Cyrill Gorcunov
2020-06-11 19:56 ` Vladislav Shpilevoy
  -- strict thread matches above, loose matches on Subject: below --
2019-11-26 18:05 [Tarantool-patches] [PATCH] fio/coio: Handle " Cyrill Gorcunov
2019-12-04  9:44 ` Cyrill Gorcunov

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=20200610075257.GO134822@grain \
    --to=gorcunov@gmail.com \
    --cc=tarantool-patches@dev.tarantool.org \
    --cc=v.shpilevoy@tarantool.org \
    --subject='Re: [Tarantool-patches] [PATCH] fio/coio: handle partial writes' \
    /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