Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp3219532imj; Mon, 18 Feb 2019 22:53:55 -0800 (PST) X-Google-Smtp-Source: AHgI3IavXsHdHLVHThjq1LcybaRDhWyNLhTUfXzFqHRxE8f4EbuRBuuEIUJjaGoZz/XouCwlc3Qj X-Received: by 2002:a62:7592:: with SMTP id q140mr28217860pfc.164.1550559235888; Mon, 18 Feb 2019 22:53:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550559235; cv=none; d=google.com; s=arc-20160816; b=oQQ6vzR0EAwgOZjSVkAHOkorNvlc1B4kDp7mS1KI369TtQW84IX8CqKWbSVzP/PxWO d9J5bCNz77+WgNsutMJkFbGwvV+AZc9WFUHT+b7lfN98Y/acOfcigfmlPUiaJVUCHB1z iXrQjo023SjK9tnxaLT+n7nbQ5IzfX+hIzmcqYg9hSuEAinOdMvsdBMkfPCHckhq+SBX qLiTeNthgBQD+bMOKLASP/LWgcZEmp1AdPJyaW7xgNYlhfcVVEGq4GsiJRJMnbb86ZXd Fk4AThrwQ73UhLZhBz6n+TvKdquffDBxEtPsfyEu8AdlO7za27SY/jduZ5unEa2ZLRAv J9yg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=y/m6/GA7QO3NaTBHFmru3ZdJLlqE68MJRJ6inSTlCoA=; b=JomOZjpOd5zwynxZzuX0n4U80P/kt9Cg3QHiJBBG4lxGjW4LsQh8+7q49p5rX7LE6l 6Wb9t2Di1OJTmYhZM33Md6E0ZTN7qBteZxg6uDk0/K598tyi3vV9ix9cK6xxTVrlDJHp HnWbMCJmrURXbtrdFvo4PAizRTjAMFm2DsZ56RfKP5/7Qfgfbj8WGAG4EVnsj3457Leg 24iqTaCXE0Fu1p8LcO7t+KQtjEnXp5Uhp3ROSWOGW9SEZyWIA8LX1A5RTlJM8qSfILFv DUUFqbljBlcX3KEYfDLARwiHOsFhgl7w9cHSJd6hkA9qTnh1kgjrI+J4hVujw5mbrB0r hc5g== 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 t11si14205678pgp.209.2019.02.18.22.53.40; Mon, 18 Feb 2019 22:53:55 -0800 (PST) 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 S1726693AbfBSGve (ORCPT + 99 others); Tue, 19 Feb 2019 01:51:34 -0500 Received: from mx1.redhat.com ([209.132.183.28]:38608 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725763AbfBSGve (ORCPT ); Tue, 19 Feb 2019 01:51:34 -0500 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 6E09286676; Tue, 19 Feb 2019 06:51:34 +0000 (UTC) Received: from [10.72.12.172] (ovpn-12-172.pek2.redhat.com [10.72.12.172]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 607B85D6AA; Tue, 19 Feb 2019 06:51:28 +0000 (UTC) Subject: Re: [PATCH net] vhost: correctly check the return value of translate_desc() in log_used() To: Stephen Hemminger Cc: mst@redhat.com, kvm@vger.kernel.org, virtualization@lists.linux-foundation.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org References: <20190215075324.18891-1-jasowang@redhat.com> <20190215084502.23feed0e@shemminger-XPS-13-9360> From: Jason Wang Message-ID: Date: Tue, 19 Feb 2019 14:51:26 +0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.4.0 MIME-Version: 1.0 In-Reply-To: <20190215084502.23feed0e@shemminger-XPS-13-9360> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Tue, 19 Feb 2019 06:51:34 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2019/2/16 上午12:45, Stephen Hemminger wrote: > On Fri, 15 Feb 2019 15:53:24 +0800 > Jason Wang wrote: > >> When fail, translate_desc() returns negative value, otherwise the >> number of iovs. So we should fail when the return value is negative >> instead of a blindly check against zero. >> >> Reported-by: Stephen Hemminger >> Fixes: cc5e71075947 ("vhost: log dirty page correctly") >> Signed-off-by: Jason Wang > Looks good. It is best to put the Addresses-Coverity-Id tag on these kind > of bug fixes so that the automated tools see it. Ok. Will do this in V2. Thanks