Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751936AbdF3Bcv (ORCPT ); Thu, 29 Jun 2017 21:32:51 -0400 Received: from mail-yb0-f181.google.com ([209.85.213.181]:34740 "EHLO mail-yb0-f181.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751333AbdF3Bct (ORCPT ); Thu, 29 Jun 2017 21:32:49 -0400 MIME-Version: 1.0 In-Reply-To: <20170629225911.7896-1-vishal.l.verma@intel.com> References: <20170629225911.7896-1-vishal.l.verma@intel.com> From: Dan Williams Date: Thu, 29 Jun 2017 18:32:48 -0700 Message-ID: Subject: Re: [PATCH] libnvdimm, btt: fix btt_rw_page not returning errors To: Vishal Verma Cc: "linux-nvdimm@lists.01.org" , "linux-kernel@vger.kernel.org" , "stable@vger.kernel.org" , Toshi Kani , Jeff Moyer Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1417 Lines: 37 On Thu, Jun 29, 2017 at 3:59 PM, Vishal Verma wrote: > btt_rw_page was not propagating errors frm btt_do_bvec, resulting in any > IO errors via the rw_page path going unnoticed. the pmem driver recently > fixed this in e10624f pmem: fail io-requests to known bad blocks > but same problem in BTT went neglected. > > Fixes: 5212e11 nd_btt: atomic sector updates > Cc: > Cc: Toshi Kani > Cc: Dan Williams > Cc: Jeff Moyer > Signed-off-by: Vishal Verma > --- > drivers/nvdimm/btt.c | 9 ++++++--- > 1 file changed, 6 insertions(+), 3 deletions(-) > > diff --git a/drivers/nvdimm/btt.c b/drivers/nvdimm/btt.c > index 7ca11df..4e56e72 100644 > --- a/drivers/nvdimm/btt.c > +++ b/drivers/nvdimm/btt.c > @@ -1248,10 +1248,13 @@ static int btt_rw_page(struct block_device *bdev, sector_t sector, > struct page *page, bool is_write) > { > struct btt *btt = bdev->bd_disk->private_data; > + int rc; > > - btt_do_bvec(btt, NULL, page, PAGE_SIZE, 0, is_write, sector); > - page_endio(page, is_write, 0); > - return 0; > + rc = btt_do_bvec(btt, NULL, page, PAGE_SIZE, 0, is_write, sector); > + if (rc == 0) > + page_endio(page, is_write, 0); > + > + return rc; > } Looks obviously correct, applied.