Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp5389528ybi; Wed, 12 Jun 2019 01:32:13 -0700 (PDT) X-Google-Smtp-Source: APXvYqx3jUfPoPRowrujfyB/1V3ovRSlBlghrGd6/6m0ENV4mZZx1bKNsGWMW4D/kbH04UWpweQO X-Received: by 2002:a17:902:e490:: with SMTP id cj16mr79127696plb.136.1560328333316; Wed, 12 Jun 2019 01:32:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560328333; cv=none; d=google.com; s=arc-20160816; b=EaIKAEIc2alZaj3AM/xwu+RqmSuQ+pRB+bSyMuSpDxSIuY9cQdD2Dfmy22XUkR1gHP 8+/NJ1m3IZgAqH/2dNfzJTifAaUabqKQVE6OOGJCp8g4OD66Vj43rasizTdRndErpkcx xR9GO1J5TcNlJYt4Ost25GV+ohOYz927lHY2NcXTdZjwYuXi7h5fkBt6c6ZHornTZsbj kvnBRd11EtBzofDZCRPg+LGF5fRNiYd+L++JEMvRSojNemCviuTSvnTvgPWR6ONtOrxN z+L15amrycL7l7Z7hIBnvVGPjqcu31sNxK/GHaOyLwVhs0cf9DrNW/uLvExbDIexisol qd3Q== 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:dkim-signature; bh=U7CBgI/BlOH8mCpak6QJYkxnxyBdoEy/BPSE3vs157A=; b=d2jXKryIzhXfVayKjRlC1FreNt5Vb3FhgcaDa6+ik2eYp86E5SZttCcfjO/Ov09npC 18ieT/H6dL3VPPAK9KCvbHCa6Z2GL7VdtqFUg3UbeH64IVeTlPp/YCNFYDZQmrXx4T0L GJZYH3kCbRcNlS6oNfOtcm3CHKblUAagxdb0wSN8Cha2mQVdxnopM0H0D2nznzgaMKRK NY0/2h1/2ln//2onxEOKTMESmCi/FALHSWc3yrN9F8jj+6YB9miT4I5HRKMvXx9y2sXZ GvhjncYIt7ce0Zm99wYrWdcn9QsdxuJDKKAnN1y6K/ffm792KJNXNaQEvLS7wJjraVtP y7IA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=Bzb3btvI; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q7si14552850pgp.245.2019.06.12.01.31.56; Wed, 12 Jun 2019 01:32:13 -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; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=Bzb3btvI; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2407787AbfFLHBq (ORCPT + 99 others); Wed, 12 Jun 2019 03:01:46 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:50494 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2404851AbfFLHBq (ORCPT ); Wed, 12 Jun 2019 03:01:46 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=U7CBgI/BlOH8mCpak6QJYkxnxyBdoEy/BPSE3vs157A=; b=Bzb3btvII+xO775JFm+/k4qqn eHS/t3brEGYdMoJtVpIGT5EN2xaM3k7I71ALJsbbc+0vNmy8E6uGvgXyQb2ZqWuEQyPxy2lL/TD3s uMzXPuNdC+uyOv3QLqxtZjr8Jjdtu3o3eUUIx3Odo483jPATMKUouu0blV4M0xTAkF80OunW1Z7jF LBBOFvv+p2bswnZmudxhQwgVJUYeAJZYogoM/0PEtY6Al28wR3Z4Vx7kZQiirCPrJws0g+8seZO/f e7jBGxpuGd5dCTGNxlOOHGOrTTq6GAsoeq9Y0FUPBC8IR1BqktaTs9S5schf5x3nbgz3iU4CAiqDE YCgQ3nYWA==; Received: from hch by bombadil.infradead.org with local (Exim 4.92 #3 (Red Hat Linux)) id 1haxFu-0005GR-Tc; Wed, 12 Jun 2019 07:01:10 +0000 Date: Wed, 12 Jun 2019 00:01:10 -0700 From: Christoph Hellwig To: John Dorminy Cc: Mike Snitzer , Jens Axboe , NeilBrown , linux-block@vger.kernel.org, device-mapper development , Milan Broz , Linux Kernel Mailing List Subject: Re: block: be more careful about status in __bio_chain_endio Message-ID: <20190612070110.GA11707@infradead.org> References: <70cda2a3-f246-d45b-f600-1f9d15ba22ff@gmail.com> <87eflmpqkb.fsf@notabene.neil.brown.name> <20190222211006.GA10987@redhat.com> <7f0aeb7b-fdaa-0625-f785-05c342047550@kernel.dk> <20190222235459.GA11726@redhat.com> <20190223024402.GA12407@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.11.4 (2019-03-13) X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jun 11, 2019 at 10:56:42PM -0400, John Dorminy wrote: > I believe the second of these might, but is not guaranteed to, > preserve the first error observed in a child; I believe if you want to > definitely save the first error you need an atomic. Is there any reason not to simply use a cmpxchg? Yes, it is a relatively expensive operation, but once we are chaining bios we are out of the super hot path anyway. We do something similar in xfs and iomap already.