Received: by 2002:a17:90a:88:0:0:0:0 with SMTP id a8csp69367pja; Fri, 22 Nov 2019 03:35:06 -0800 (PST) X-Google-Smtp-Source: APXvYqz7ETKdTsP5yvNyGcW3xZCeJRehdyRn39Ztw1gTLYOj/9koSetJwSRdSWAP55yjprL12XMC X-Received: by 2002:a17:906:600b:: with SMTP id o11mr21168901ejj.175.1574422505880; Fri, 22 Nov 2019 03:35:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574422505; cv=none; d=google.com; s=arc-20160816; b=gRmgNkhQWvbJ/ZP6klDUX71vdwk+dp8sBOEAloP98q0SNOs+IxvGgzeL+LCA16GRK6 ZVjQ6d8ye1ahbaIez5HMrTwaKCca7wbPcsBAaABQdTNXiLhujH5XNxSAgE541nglYo+y U+Sl/ibypboRwewMk4TLIInmr6x07WTVHWjGq8WECHgC2qerqkyz59Pn2oqT0KtHmMtU B3fpKPdUHhnLUQZusEpFV0odFbID8X0s9E6r7XdX8IB7prl4eQB3J5pvLMrMSrQcWrqf gWl1FIkADkVAIkL3+pYNF05rAyn/fX35bK7eIGcFEQeJbvXJpVfnxUboz4qNBlLAbN2b So6Q== 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:mail-followup-to :reply-to:message-id:subject:cc:to:from:date; bh=yUwmwrSCJYlBzQGxxdi9mYjSbfJfvkvJAwYHzBDS0o0=; b=RDJlLRiPR7AfmGHDJ+e9ku0lLHuFGR6p4LCz+ZlS7F2ipSbAcx/iPj6R0IY7p59ktt G4Uk++i69d/jkSLtXCTypzCdCCo1epGsmQdX3aAbci4dwRFmEtpfW3eAEYzulHZgKUQN sxx5gWaO2mOqWHdOq/ve7xZ5zgK/gU5PD8rMbdvY8X8unoeu6EVPfJsC7KkNIDdLP3jU mtYcktlv94DsU/YNQuZ3u4ptQRTL+OsWvI/VRs0kCQVIURByxTok/eU00VliEhn9zLsc tO2yug5pEqC7t3vYELUwqajGjF1g42y7GSO89J8e4pxuaVvbJUcvlk6SuUtjNNZ1n9P8 HlWw== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p11si428965ejz.98.2019.11.22.03.34.41; Fri, 22 Nov 2019 03:35:05 -0800 (PST) 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727437AbfKVLdj (ORCPT + 99 others); Fri, 22 Nov 2019 06:33:39 -0500 Received: from mx2.suse.de ([195.135.220.15]:46284 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726563AbfKVLdj (ORCPT ); Fri, 22 Nov 2019 06:33:39 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 36C23AF19; Fri, 22 Nov 2019 11:33:37 +0000 (UTC) Received: by ds.suse.cz (Postfix, from userid 10065) id 38C16DA898; Fri, 22 Nov 2019 12:33:37 +0100 (CET) Date: Fri, 22 Nov 2019 12:33:37 +0100 From: David Sterba To: Sasha Levin Cc: linux-kernel@vger.kernel.org, stable@vger.kernel.org, Nikolay Borisov , Josef Bacik , Anand Jain , David Sterba , linux-btrfs@vger.kernel.org Subject: Re: [PATCH AUTOSEL 4.19 071/219] btrfs: Check for missing device before bio submission in btrfs_map_bio Message-ID: <20191122113337.GB3001@suse.cz> Reply-To: dsterba@suse.cz Mail-Followup-To: dsterba@suse.cz, Sasha Levin , linux-kernel@vger.kernel.org, stable@vger.kernel.org, Nikolay Borisov , Josef Bacik , Anand Jain , David Sterba , linux-btrfs@vger.kernel.org References: <20191122054911.1750-1-sashal@kernel.org> <20191122054911.1750-64-sashal@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20191122054911.1750-64-sashal@kernel.org> User-Agent: Mutt/1.5.23.1-rc1 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Nov 22, 2019 at 12:46:43AM -0500, Sasha Levin wrote: > From: Nikolay Borisov > > [ Upstream commit fc8a168aa9ab1680c2bd52bf9db7c994e0f2524f ] > > Before btrfs_map_bio submits all stripe bios it does a number of checks > to ensure the device for every stripe is present. However, it doesn't do > a DEV_STATE_MISSING check, instead this is relegated to the lower level > btrfs_schedule_bio (in the async submission case, sync submission > doesn't check DEV_STATE_MISSING at all). Additionally > btrfs_schedule_bios does the duplicate device->bdev check which has > already been performed in btrfs_map_bio. > > This patch moves the DEV_STATE_MISSING check in btrfs_map_bio and > removes the duplicate device->bdev check. Doing so ensures that no bio > cloning/submission happens for both async/sync requests in the face of > missing device. This makes the async io submission path slightly shorter > in terms of instruction count. No functional changes. ^^^^^^^^^^^^^^^^^^^^^ This should be a strong indication that the patch is not suitable for autosel/stable, please remove it. Thanks.