Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp4216572imm; Mon, 18 Jun 2018 11:03:07 -0700 (PDT) X-Google-Smtp-Source: ADUXVKIm8muJrTE0IKFfWTtBwY+3qxoCgZe8+soNP0os4wy7dTBhEn0UduyjOv1GQpACvKTq6zH2 X-Received: by 2002:a17:902:9a95:: with SMTP id w21-v6mr15161593plp.168.1529344987487; Mon, 18 Jun 2018 11:03:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529344987; cv=none; d=google.com; s=arc-20160816; b=uEIYDMeYwP25as1k3eegU4PKzJSyv3WlLcZUYr3TFiwImtBQJT4dtm7/XyXCDSmwK/ DstDVaKrWon0vSiqcj1IEKxNdCS+KjzyvcyE4bqVi8u2jCiyBNSDRQAOtAklL6UEPUii RbpCOGOerNSmvSTH7DbLstWY23Rqv0ViXabPKnVCjTMr7NY/3N9wPPm40Nw0/3SfEWTY NYWeoWtgLIqpwVOtbdwcc/4OZwh9kXKwTjcfnRHv4bLk2M1mKY+jZ1xgq59+lLutO2FY 6HXb2O3bhg8V8mjpwidKAocjq4FiBZDxmBuNSPoQz2gaW2ZLgX9sJvuGDhRfUai3fITX 6VBQ== 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 :user-agent:message-id:date:cc:to:from:subject :arc-authentication-results; bh=CmVFXewAbT92m+Qanb1X1dKCYmWqSa3o+2nzhSDm/l0=; b=S1FGoqOlziIXV73ahjyA+IaH5VrARRn1Y3tjv2ASiJuOuObPYo+LT8wNpgcyyNDina jD6EmIZfvHRrPyujyXnujWTHMbTaYo1skLjTmRvJcPoi67S5aIkCPtlymL2jz5kYs+go GXtCobGB7nD/jhsqP8/28muE6BYsUhDEF0CxFJmJGE48d5CYj1WUQQkRMoOFdtz9eijx fnjmAVYpLA1hxoi2po0/uNeIUr5ZoKK9d4SrCUoR44eh4G8YiA0AZo/rc/ikJaocNpvJ N9YM/YTZbhfte+PCA3UY+wVZRVE5QgqHiFf1QFf5DPAifsk/v8j+6i4vUh2U/z3k7vCY Z3bA== 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 l12-v6si12511149pgp.683.2018.06.18.11.02.53; Mon, 18 Jun 2018 11:03:07 -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 S935577AbeFRSCI (ORCPT + 99 others); Mon, 18 Jun 2018 14:02:08 -0400 Received: from mga01.intel.com ([192.55.52.88]:35567 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S935505AbeFRSCH (ORCPT ); Mon, 18 Jun 2018 14:02:07 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 18 Jun 2018 11:02:06 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.51,240,1526367600"; d="scan'208";a="67958382" Received: from dwillia2-desk3.jf.intel.com (HELO dwillia2-desk3.amr.corp.intel.com) ([10.54.39.16]) by orsmga002.jf.intel.com with ESMTP; 18 Jun 2018 11:02:06 -0700 Subject: [PATCH] libnvdimm, pmem: Fix memcpy_mcsafe() return code handling in nsio_rw_bytes() From: Dan Williams To: linux-nvdimm@lists.01.org Cc: Vishal Verma , linux-kernel@vger.kernel.org Date: Mon, 18 Jun 2018 10:52:09 -0700 Message-ID: <152934432951.24427.11070204367866836632.stgit@dwillia2-desk3.amr.corp.intel.com> User-Agent: StGit/0.18-2-gc94f MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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(+) 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))) {