Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752454AbdFURg2 (ORCPT ); Wed, 21 Jun 2017 13:36:28 -0400 Received: from out3-smtp.messagingengine.com ([66.111.4.27]:52371 "EHLO out3-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751108AbdFURg1 (ORCPT ); Wed, 21 Jun 2017 13:36:27 -0400 X-ME-Sender: X-Sasl-enc: ChPEUoIMAti4uZfBCw+7xYFgY46cDxU8Ijx8HTVeOKjI 1498066586 Date: Wed, 21 Jun 2017 11:36:24 -0600 From: Michael Sartain To: Steven Rostedt Cc: linux-kernel@vger.kernel.org Subject: Re: [PATCH v3 4/6] Fix read / write data offsets in read / write loops Message-ID: <20170621173622.yrwfi3quuq4l27hd@mikesart-cos> References: <207b0ce25f6b26cad5497bdd5e3c42ce4d9c1b50.1497486273.git.mikesart@fastmail.com> <20170621092914.3f653151@gandalf.local.home> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170621092914.3f653151@gandalf.local.home> User-Agent: NeoMutt/20170306 (1.8.0) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1294 Lines: 34 On Wed, Jun 21, 2017 at 09:29:14AM -0400, Steven Rostedt wrote: > On Wed, 14 Jun 2017 18:27:59 -0600 > Michael Sartain wrote: > > > The tot variable in __do_write and do_read is incremented with the amount read > > / written, but subsequent times through the loop the calls continue to use the > > original data pointer. > > > > Signed-off-by: Michael Sartain > > --- > > trace-cmd-local.h | 2 +- > > trace-input.c | 2 +- > > 2 files changed, 2 insertions(+), 2 deletions(-) > > > > diff --git a/trace-cmd-local.h b/trace-cmd-local.h > > index 8595a8a..b8ab35b 100644 > > --- a/trace-cmd-local.h > > +++ b/trace-cmd-local.h > > @@ -31,7 +31,7 @@ static ssize_t __do_write(int fd, const void *data, size_t size) > > ssize_t w; > > > > do { > > - w = TEMP_FAILURE_RETRY(write(fd, data, size - tot)); > > + w = TEMP_FAILURE_RETRY(write(fd, data + tot, size - tot)); > > Good catch. I'm going to modify this to remove the TEMP_FAILURE_RETRY() > though. I'll hopefully get this pushed out later today, and we could > add the write_intr() and friends later. I've got a couple other patches ready to submit. I'll wait for your push, rebase those, and add a TEMP_FAILURE_RETRY -> *_intr() patch with those. Thanks much Steve. -Mike