From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp60.i.mail.ru (smtp60.i.mail.ru [217.69.128.40]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id CDF1C469710 for ; Wed, 6 May 2020 20:08:32 +0300 (MSK) Date: Wed, 6 May 2020 20:08:18 +0300 From: Alexander Turenko Message-ID: <20200506170818.xhs2yda3oz6426az@tkn_work_nb> References: <20200421213930.28713-1-gorcunov@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20200421213930.28713-1-gorcunov@gmail.com> Subject: Re: [Tarantool-patches] [PATCH] fio/coio: handle partial writes List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Cyrill Gorcunov Cc: Vladislav Shpilevoy , tml > issue https://github.com/tarantool/tarantool/issues/4651 > branch gorcunov/gh-4651-partial-write > diff --git a/src/lib/core/coio_file.c b/src/lib/core/coio_file.c > index e2345567c..e290214bc 100644 > --- a/src/lib/core/coio_file.c > +++ b/src/lib/core/coio_file.c > @@ -164,10 +164,30 @@ coio_file_close(int fd) > ssize_t > coio_pwrite(int fd, const void *buf, size_t count, off_t offset) > { In Febrary ([1]) we start discussing whether the loop should be in fio or in coio. coio_p?write() returns amount of written bytes, so it seems logical to keep it performing one write and move the loop to src/lua/fio.c. To be honest, I don't sure here. If you have a reason to keep the logic here, please, explain it. I'll CC Vlad, maybe he has more strong vision here. [1]: https://lists.tarantool.org/pipermail/tarantool-patches/2020-February/014403.html > @@ -201,6 +221,11 @@ static void > coio_do_write(eio_req *req) > { > struct coio_file_task *eio = (struct coio_file_task *)req->data; > + > + ERROR_INJECT(ERRINJ_COIO_WRITE_CHUNK, { > + eio->write.count = 1; > + }); Why not set it right in coio_write() to don't spread the logic? > diff --git a/test/app/fio.result b/test/app/fio.result > index 783fa4fab..73fbd29e5 100644 > --- a/test/app/fio.result > +++ b/test/app/fio.result > @@ -776,6 +776,12 @@ file5 = fio.pathjoin(tree, 'file.5') > file6 = fio.pathjoin(tree, 'file.6') > --- > ... > +file7 = fio.pathjoin(tree, 'file.7') > +--- > +... > +file8 = fio.pathjoin(tree, 'file.8') > +--- > +... Nit: SOP now requires to add a test file with gh-... name when fixing a bug.