Received: by 10.192.165.148 with SMTP id m20csp4526754imm; Tue, 24 Apr 2018 04:24:37 -0700 (PDT) X-Google-Smtp-Source: AIpwx48Qk8HkOMal0N4S9HlDkwPDaJXCUy+bnoQHs73kOZdKyy6v/mlwAK5rXi6u6oDOxyK9owii X-Received: by 10.101.83.197 with SMTP id z5mr10791622pgr.413.1524569077767; Tue, 24 Apr 2018 04:24:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524569077; cv=none; d=google.com; s=arc-20160816; b=nWzYGX6GXYkWCksmUi4QfRymLWXD8E77QqXhA/l997JHMobJUPYr5Oi+feY9MtdX+F ep73KBqQCCQ91T89ogWiobGYQfAXpgFZDl/FYhRnpEMxPJin/gKlxCbPVLSE7ZPZmyTa IBf6dSYN58H6TmUFar4zLzadG08NGzoaHtPeqrjyp/9pfvHWNEOCzLZZKXnL5zDH9aP3 6g3Jics8rAJubL44w01sk2yxP73z2IsIyHzV2rEno1zYVN/jgPWeSzjGJS8DuyRhHdgs UKj5GEtw+nFqMsdfEgB8vBifOeOBvEdieKigGxxmATBDTWwoMjKoPBDkhhIdN5Nexkul 5YVw== 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=yyuQYtkXR3Ycp2zxF9Q3YBGTgil/vs1F1gORA2rA7E8=; b=usXs8riYRdtryLxgVPR5tcJ08+QEs3CidGGfK0fr/TtzG33RynrZ/99ov5AbVvvbAY 6S0cHklkOATaowLPoQd41VeKT16YYvL3X3+rm/oOhTlzNuTdoz+Ajl74QhaX/ZbU4p+G m/j5Qk6ngSqnFL1U9pmZISGTsMhJt3LC/D8LK2w07Wv+WrUGTzNKCDW9wTIwuCDZjaPZ 2QQ5AXdPo5kHuan9fgD30Q6suZOxezr0gWLn7qj841bRYrPLWFk7zqhJ2Yos+8JqQ2xl g5YHAu9C8kf9fhhY8x2ZnQ9chFYDBFOsJ5OlDB6WWavNiutpkxBX+9Jgatkcp6V1Rn1i LGKQ== 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 m10si11538119pge.245.2018.04.24.04.24.23; Tue, 24 Apr 2018 04:24:37 -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 S1754066AbeDXJbx (ORCPT + 99 others); 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 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 1AA2A4173D2C; Tue, 24 Apr 2018 09:31:51 +0000 (UTC) Received: from gondolin (dhcp-192-222.str.redhat.com [10.33.192.222]) by smtp.corp.redhat.com (Postfix) with ESMTP id B88C610F1BF2; Tue, 24 Apr 2018 09:31:49 +0000 (UTC) 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 X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.5]); Tue, 24 Apr 2018 09:31:51 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.5]); Tue, 24 Apr 2018 09:31:51 +0000 (UTC) for IP:'10.11.54.3' DOMAIN:'int-mx03.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 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?)]