From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754076AbeDXJbx (ORCPT ); Tue, 24 Apr 2018 05:31:53 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:60302 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752789AbeDXJbv (ORCPT ); Tue, 24 Apr 2018 05:31:51 -0400 Date: Tue, 24 Apr 2018 11:31:47 +0200 From: Cornelia Huck To: Dong Jia Shi Cc: linux-kernel@vger.kernel.org, linux-s390@vger.kernel.org, kvm@vger.kernel.org, borntraeger@de.ibm.com, bjsdjshi@linux.ibm.com, pasic@linux.ibm.com, pmorel@linux.ibm.com, Halil Pasic Subject: Re: [PATCH v2 1/5] vfio: ccw: fix cleanup if cp_prefetch fails Message-ID: <20180424113147.139e2e0b.cohuck@redhat.com> In-Reply-To: <20180423110113.59385-2-bjsdjshi@linux.vnet.ibm.com> References: <20180423110113.59385-1-bjsdjshi@linux.vnet.ibm.com> <20180423110113.59385-2-bjsdjshi@linux.vnet.ibm.com> Organization: Red Hat GmbH MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 23 Apr 2018 13:01:09 +0200 Dong Jia Shi wrote: > From: Halil Pasic > > If the translation of a channel program fails, we may end up attempting > to clean up (free, unpin) stuff that never got translated (and allocated, > pinned) in the first place. > > By adjusting the lengths of the chains accordingly (so the element that > failed, and all subsequent elements are excluded) cleanup activities > based on false assumptions can be avoided. > > Let's make sure cp_free works properly after cp_prefetch returns with an > error by setting ch_len of a ccw chain to the number of the translated > CCWs on that chain. > > Acked-by: Pierre Morel > Reviewed-by: Dong Jia Shi > Signed-off-by: Halil Pasic > Signed-off-by: Dong Jia Shi > --- > drivers/s390/cio/vfio_ccw_cp.c | 13 ++++++++++++- > 1 file changed, 12 insertions(+), 1 deletion(-) Thanks, applied. I'll probably send a pull req after lunch. [Some procedural notes: I've created a new vfio-ccw-fixes branch based on the s390 fixes branch for easier handling. Things targeted for the next release will go on the vfio-ccw branch on top of the s390 features branch, as before. Does that work for everybody? (And I am the only vfio-ccw maintainer with a kernel.org account, right?)]