[Tarantool-patches] [PATCH] fio/coio: handle partial writes

Cyrill Gorcunov gorcunov at gmail.com
Wed Jun 10 10:52:57 MSK 2020


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!


More information about the Tarantool-patches mailing list