Received: by 10.192.165.148 with SMTP id m20csp145965imm; Fri, 20 Apr 2018 04:37:38 -0700 (PDT) X-Google-Smtp-Source: AIpwx49o/B6VQLlTjJhDBLGk8xjJ+8v0GIcbzVcsoUW7WCw6PZze+4rOa1IDQI5zNzvlnHmOqHCh X-Received: by 10.99.95.14 with SMTP id t14mr7941667pgb.94.1524224258295; Fri, 20 Apr 2018 04:37:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524224258; cv=none; d=google.com; s=arc-20160816; b=aVqjPnTu+niI6lwzlBclIczsUiBzWOL4cU3sZKytEGPQitjcjqjJvsx1xei9wdfQGC BQqQctLvjnFqiTMARirGtSVqX+GyS5VCosxYAsDlbZXflZR75M97ij5urgvIpavUFnns m0Ugx+6C2BJmvG3nRrGwc8AnP+zYPJM+SfrpEBDhWL2K79DK9e6cAcKF9BRQFdPxfP3M XC2BWpg1W2wtc1EsJItbjLHu/zbLhQm9H7BpMuU95bRt8eKIwqVG3MQCHKhNmSBtM3dk z3dMMrfHxKTW4P1bKYdRYUJg/eChHaRJ+FoHiCsXkGHBdk1sf9zGsmyPGo1GDnVYWLox 0KBQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :organization:references:in-reply-to:message-id:subject:cc:to:from :date:arc-authentication-results; bh=HAmUwR0aSZuNU7qLh3ETLqnlHZFvAAhinyUON6JL3X8=; b=jtOEVGioWhlPSukPVmGekRwti3+bMbl6sos6575ONdsMGPx0bmnz4dxcxirs/7hMzX wPHIO8HSlBrMRYa9Q6C49vmCgLhuuYDnViAKh4I+d3TtFcb7PlGUcDDema009AT1SAvg NIxMFYl0p7O6t3qsJ4Fkk0O3xrEMRcmSPqBsurlTYex/P8KmjHP2DARv6JvllVOQ1u55 vdDyFsbyzm8adGgVvWKzK/M3A9dc4OD2gRjdNN0EgaZgpRino9PfJ3xb9nILIm2lRsCR VXfWrkoW/3gYNALeewBiB0hmcV0I5Pr7ziucaGDhrRokF4K9A67e1PEnJfml6pI3+uLO LsHw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e2si5620144pfm.220.2018.04.20.04.37.24; Fri, 20 Apr 2018 04:37:38 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754681AbeDTLgU (ORCPT + 99 others); Fri, 20 Apr 2018 07:36:20 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:46806 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1754549AbeDTLgS (ORCPT ); Fri, 20 Apr 2018 07:36:18 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 39DDB722ED; Fri, 20 Apr 2018 11:36:18 +0000 (UTC) Received: from gondolin (dhcp-192-222.str.redhat.com [10.33.192.222]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1D3CE2166BAE; Fri, 20 Apr 2018 11:36:16 +0000 (UTC) Date: Fri, 20 Apr 2018 13:36:14 +0200 From: Cornelia Huck To: Halil Pasic Cc: Dong Jia Shi , Pierre Morel , linux-kernel@vger.kernel.org, linux-s390@vger.kernel.org, kvm@vger.kernel.org, borntraeger@de.ibm.com Subject: Re: [PATCH 1/4] vfio: ccw: fix cleanup if cp_prefetch fails Message-ID: <20180420133614.20e3c6ae.cohuck@redhat.com> In-Reply-To: <59687ed1-befb-a861-7b91-40859ac00bb7@linux.vnet.ibm.com> References: <20180321020822.86255-1-bjsdjshi@linux.vnet.ibm.com> <20180321020822.86255-2-bjsdjshi@linux.vnet.ibm.com> <682d8b1c-5aca-7015-043b-a3f1446bf378@linux.vnet.ibm.com> <20180322022248.GB12194@bjsdjshi@linux.vnet.ibm.com> <54fd02cd-bd0b-889b-c40f-f9a32aa25d77@linux.vnet.ibm.com> <20180326142839.23bfc4f6.cohuck@redhat.com> <20180327014200.GH12194@bjsdjshi@linux.vnet.ibm.com> <59687ed1-befb-a861-7b91-40859ac00bb7@linux.vnet.ibm.com> Organization: Red Hat GmbH MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.2]); Fri, 20 Apr 2018 11:36:18 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.2]); Fri, 20 Apr 2018 11:36:18 +0000 (UTC) for IP:'10.11.54.6' DOMAIN:'int-mx06.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'cohuck@redhat.com' RCPT:'' Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 20 Apr 2018 12:54:26 +0200 Halil Pasic wrote: > ping > > I think get this fixed. Better sooner than later. > > On 03/27/2018 03:42 AM, Dong Jia Shi wrote: > > * Cornelia Huck [2018-03-26 14:28:39 +0200]: > > > > [...] > > > >>> By the way, since you will propose a new version, > >>> you have a long description of the cp_prefetch function in the code. > >>> I think you should modify it according to the changes and describe how and > >>> why the ch_len field of each chain is used and changed by this function. > >>> > >>> Something like: > >>> > >>> " > >>> For each chain composing the channel program: > >>> On entry ch_len hold the count of CCW to be translated. > >> > >> s/hold/holds/ ? > >> > > Sure. > > > >>> On exit ch_len is adjusted to the count of successfully translated CCW. > >>> > >>> This allows cp_free to find in ch_len the count of CCW to free in a chain. > >>> " > >>> > >>> Could also be inside the commit message. > >>> > >>> Pierre > >>> > >>> > >>>> > >>>>>> 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 | 9 ++++++++- > >>>>>> 1 file changed, 8 insertions(+), 1 deletion(-) > >>>>>> > >>>>>> diff --git a/drivers/s390/cio/vfio_ccw_cp.c b/drivers/s390/cio/vfio_ccw_cp.c > >>>>>> index d9a2fffd034b..2be114db02f9 100644 > >>>>>> --- a/drivers/s390/cio/vfio_ccw_cp.c > >>>>>> +++ b/drivers/s390/cio/vfio_ccw_cp.c > >>>>>> @@ -749,11 +749,18 @@ int cp_prefetch(struct channel_program *cp) > >>>>>> for (idx = 0; idx < len; idx++) { > >>>>>> ret = ccwchain_fetch_one(chain, idx, cp); > >>>>>> if (ret) > >>>>>> - return ret; > >>>>>> + goto out_err; > >>>>>> } > >>>>>> } > >>>>>> > >>>>>> return 0; > >>>>>> +out_err: > >>>>>> + /* Only cleanup the chain elements that where actually translated. */ > >> > >> s/where/were/ > > Ok. > > > >> > >>>>>> + chain->ch_len = idx; > >>>>>> + list_for_each_entry_continue(chain, &cp->ccwchain_list, next) { > >>>>>> + chain->ch_len = 0; > >>>>>> + } > >>>>>> + return ret; > >>>>>> } > >>>>>> > >>>>>> /** > >>>>>> > >>> > >> > > > Hm, it seems that drowned in other patches... can I get a re-send, please?