From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from bombadil.infradead.org ([65.50.211.133]:47947 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751357AbdBAHmx (ORCPT ); Wed, 1 Feb 2017 02:42:53 -0500 Date: Tue, 31 Jan 2017 23:42:49 -0800 From: Christoph Hellwig Subject: Re: [dm-devel] error propagation problem on xfs over dm stripe Message-ID: <20170201074249.GA22669@infradead.org> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: linux-xfs-owner@vger.kernel.org List-ID: List-Id: xfs To: Eric Sandeen Cc: linux-xfs , dm-devel@redhat.com, Mike Snitzer On Tue, Jan 31, 2017 at 09:12:07PM -0600, Eric Sandeen wrote: > diff --git a/drivers/md/dm.c b/drivers/md/dm.c > index 3086da5..3555ba8 100644 > --- a/drivers/md/dm.c > +++ b/drivers/md/dm.c > @@ -808,7 +808,9 @@ static void dec_pending(struct dm_io *io, int error) > } else { > /* done with normal IO or empty flush */ > trace_block_bio_complete(md->queue, bio, io_error); > - bio->bi_error = io_error; > + /* don't overwrite or clear existing errors */ > + if (!bio->bi_error) > + bio->bi_error = io_error; > bio_endio(bio); > } > } > > but Mike was a little uneasy, not knowing for sure how we got here to > overwrite this bio's error (hopefully I'm representing his concerns > fairly and correctly). FYI, what we do both in the XFS buffer cache and the new direct I/O code is to use a cmpxchg(&dio->error, 0, ret); in a similar situation, which should work here, too. From mboxrd@z Thu Jan 1 00:00:00 1970 From: Christoph Hellwig Subject: Re: error propagation problem on xfs over dm stripe Date: Tue, 31 Jan 2017 23:42:49 -0800 Message-ID: <20170201074249.GA22669@infradead.org> References: Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: dm-devel-bounces@redhat.com Errors-To: dm-devel-bounces@redhat.com To: Eric Sandeen Cc: linux-xfs , dm-devel@redhat.com, Mike Snitzer List-Id: dm-devel.ids On Tue, Jan 31, 2017 at 09:12:07PM -0600, Eric Sandeen wrote: > diff --git a/drivers/md/dm.c b/drivers/md/dm.c > index 3086da5..3555ba8 100644 > --- a/drivers/md/dm.c > +++ b/drivers/md/dm.c > @@ -808,7 +808,9 @@ static void dec_pending(struct dm_io *io, int error) > } else { > /* done with normal IO or empty flush */ > trace_block_bio_complete(md->queue, bio, io_error); > - bio->bi_error = io_error; > + /* don't overwrite or clear existing errors */ > + if (!bio->bi_error) > + bio->bi_error = io_error; > bio_endio(bio); > } > } > > but Mike was a little uneasy, not knowing for sure how we got here to > overwrite this bio's error (hopefully I'm representing his concerns > fairly and correctly). FYI, what we do both in the XFS buffer cache and the new direct I/O code is to use a cmpxchg(&dio->error, 0, ret); in a similar situation, which should work here, too.