From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Cooper Subject: Re: [PATCH v2 for-4.6 3/3] tools/libxl: Only continue stream operations if the stream is still in progress Date: Tue, 28 Jul 2015 16:21:14 +0100 Message-ID: <55B79DEA.2040801@citrix.com> References: <1438015647-25377-1-git-send-email-andrew.cooper3@citrix.com> <1438015647-25377-4-git-send-email-andrew.cooper3@citrix.com> <21943.34423.586101.713988@mariner.uk.xensource.com> <55B78A21.3070402@citrix.com> <21943.39885.704950.477219@mariner.uk.xensource.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <21943.39885.704950.477219@mariner.uk.xensource.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Ian Jackson Cc: Wei Liu , Ian Campbell , Xen-devel List-Id: xen-devel@lists.xenproject.org On 28/07/15 16:12, Ian Jackson wrote: > Andrew Cooper writes ("Re: [PATCH v2 for-4.6 3/3] tools/libxl: Only continue stream operations if the stream is still in progress"): >> Imagine a scenario whereby some error has occured and >> check_all_finished() has _abort()'ed the tasks, but the save helper was >> already on the way out, signalling success. > ... >> It is only save to stream_continue() if the stream is currently in use, >> which is not a guaranteed situation in this function even if rc is 0. erm s/save/safe/ > Hrm. Yes. > > What do you think about putting the inuse check in stream_continue ? That would work on the stream_read side but not the stream_write side, but is not really correct IMO. The _inuse() check is needed because the save helper callback is not sure whether the stream is in use or not. This is a property of the save helper callback, rather than the stream. Pushing the _inuse() check into the next layer would function, but it adds extra _inuse() checks to other codepaths which should be fatal if they failed in other contexts. Would resubmitting with extra comments explaining this suffice? ~Andrew