Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp4285326imm; Mon, 18 Jun 2018 12:13:57 -0700 (PDT) X-Google-Smtp-Source: ADUXVKKg/dnloBpxTgoiGBKHiEknNORNtYUBcj92rnvkg/7+BY+XguZBRRpGW7PdpRCn4DcgNYzx X-Received: by 2002:a17:902:4c:: with SMTP id 70-v6mr15350369pla.178.1529349237602; Mon, 18 Jun 2018 12:13:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529349237; cv=none; d=google.com; s=arc-20160816; b=lAwjxQ7+7e79K4FnIQQtoVWD0llP/9erjWCCxTf7CbDVGyEYr3wMw/uTeClCva4Y2x l6sl8eFT8yGAYBDSC2tyGdMed9IXH+HJ9MncMTSrn88Gy4svnVjPD92ff1aERWfa25jK 2jOLx1kOwIiD/6LGAE3WveNIFvqjygIUkbHPtVB+gRnUR8szeYr8CUuwgYQZTx5qG/Io 4ZAIDBN+lXMrHC63OSAnIx6KPzSz2ONSi8I2xNQyGYdyrGnzc2Kfz8TzZUbEu3T8b+ni v5QoWU/HXbitbbZ7uhxaMqXf0nEfeedEKe97IxtxUaHnUSy4BkfeM9hUi9H7aY3MOd/k Wutg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=krzOW2+zdHxtzTetJknZXbnsB2BEyCDSl7BS3jO9vuk=; b=0RopGHuZB6XiqdKpaPDhqpS1XDG/tKFOqXAL1TKpdWiLqnJzJd2e0WfKsVtXvFt7e1 KhRHWALL3wYq128/5vcJpvH6cG+7/Qz0I8GGdyUBxeSNq7coIL9zPJYOQXkLMqsjz1tt Yx2E9HxYmnfOinCqZR/j9C3GCLC5QZ0deRSFz8Klz6WFlkFh8m3shS1fr4LqoHcImP3x kQz6F2JCW2h9C9vevnqFID0p3hZ0Pj5KSReorjZfzzyS0NRDORYHuYs0D4yCpp1nzhyk AOngkD1oDbj72e1deJ8u3JsX3rtsRx5lvWEY22Gi4IoXGtghgLv+yO31O5S2f5u43HgH /FKw== 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=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q11-v6si12402191pgp.95.2018.06.18.12.13.43; Mon, 18 Jun 2018 12:13:57 -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=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S936142AbeFRTM6 (ORCPT + 99 others); Mon, 18 Jun 2018 15:12:58 -0400 Received: from mga07.intel.com ([134.134.136.100]:27769 "EHLO mga07.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S935860AbeFRTM5 (ORCPT ); Mon, 18 Jun 2018 15:12:57 -0400 X-Amp-Result: UNSCANNABLE X-Amp-File-Uploaded: False Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga105.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 18 Jun 2018 12:12:57 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.51,240,1526367600"; d="scan'208";a="60214678" Received: from vverma7-mobl4.lm.intel.com ([10.254.25.146]) by orsmga003.jf.intel.com with ESMTP; 18 Jun 2018 12:12:56 -0700 Date: Mon, 18 Jun 2018 13:12:56 -0600 From: Vishal Verma To: Dan Williams Cc: linux-nvdimm@lists.01.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] libnvdimm, pmem: Fix memcpy_mcsafe() return code handling in nsio_rw_bytes() Message-ID: <20180618191255.GA4226@vverma7-mobl4.lm.intel.com> References: <152934432951.24427.11070204367866836632.stgit@dwillia2-desk3.amr.corp.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <152934432951.24427.11070204367866836632.stgit@dwillia2-desk3.amr.corp.intel.com> User-Agent: Mutt/1.9.2 (2017-12-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 06/18, Dan Williams wrote: > Commit 60622d68227d "x86/asm/memcpy_mcsafe: Return bytes remaining" > converted callers of memcpy_mcsafe() to expect a positive 'bytes > remaining' value rather than a negative error code. The nsio_rw_bytes() > conversion failed to return success. The failure is benign in that > nsio_rw_bytes() will end up writing back what it just read. > > Fixes: 60622d68227d ("x86/asm/memcpy_mcsafe: Return bytes remaining") > Cc: Dan Williams > Cc: Vishal Verma > Signed-off-by: Dan Williams > --- > drivers/nvdimm/claim.c | 1 + > 1 file changed, 1 insertion(+) Ah good catch. Looks good to me. Reviewed-by: Vishal Verma > > diff --git a/drivers/nvdimm/claim.c b/drivers/nvdimm/claim.c > index 2e96b34bc936..fb667bf469c7 100644 > --- a/drivers/nvdimm/claim.c > +++ b/drivers/nvdimm/claim.c > @@ -278,6 +278,7 @@ static int nsio_rw_bytes(struct nd_namespace_common *ndns, > return -EIO; > if (memcpy_mcsafe(buf, nsio->addr + offset, size) != 0) > return -EIO; > + return 0; > } > > if (unlikely(is_bad_pmem(&nsio->bb, sector, sz_align))) { >