Received: by 2002:a05:6a10:9afc:0:0:0:0 with SMTP id t28csp3142850pxm; Mon, 28 Feb 2022 12:59:44 -0800 (PST) X-Google-Smtp-Source: ABdhPJyyAIJgfQlOYwj6iMVAuPGlZ9eGQGoA520bMB/r++V0qvzULvWWThHbmvhiLiNltKn72xkv X-Received: by 2002:a17:90a:17e6:b0:1be:d65e:82b4 with SMTP id q93-20020a17090a17e600b001bed65e82b4mr794374pja.166.1646081983815; Mon, 28 Feb 2022 12:59:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646081983; cv=none; d=google.com; s=arc-20160816; b=hESE3iiwlP+OXNhvN1k9xzdfeRrRTSnNfkzUcu1Pe2j0V1sTyr3ZkLSfdKYoO/gKg+ C8Ug0JJrZ3JIsSHixV82B69pgIO/K8J7hP28SK3MJMF1SFc9Tb+3N1ciiTP7E3rAaPo5 L/RkmNxJrFkHRfA0bLIWKJednheTAvsSwYPw+Afe4mGhErbJpvZ+j/i3YmQ0cFYvtKgA bMtyPu3st42XLqzGKHzh9VS6mWQ10uEOqsPAWOq+Juk3hNkk01wzg2n06utfH8nogSUF Kx+urf1u894tZrXQ15Eep+SbhQxd+J6ZWFXfER+GUO/Ks6uvQ/hXnoDPZnf0QKZldpMx iRSg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:mail-followup-to:reply-to:message-id :subject:cc:to:from:date:dkim-signature:dkim-signature; bh=FteZVt9c1MVKPFOCakOdo0gY5PZ/CDEv9TeOnEDnzOQ=; b=nUfG4jjoOvtl6JIHDBg1WV5S5k8EXK5HgQnAb5yx3BYgrOP8XBAh0NGjbVshiTkdsd 04L+shkVw0qJbkx2Zj4Ref8TjE9VDx/Ol0HMPm3r61kX/3lpY7cgvn+zQ+ZlYvnb3iRp PM79yHifcqIag40ekB9FRWrzQ6pJcs3RRPcJlrW4QmrlhqE7kCVFUvU5TFWP81kHN0Cq fMp2zrpzOTl0mmzDgYy5hoPvyqCcD78SFxup3t6KeeIfAfyvjX2ETPhizD2mFigpDj9p QPN6K9usW9BxRy7bhUCirde6ZYp1ySMoQkxIB7VTw2ngSOX3b8GTwyHk+tg4QzR4KFgS K6vQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=0BqAyGXL; dkim=neutral (no key) header.i=@suse.cz header.b=3PIPU2vj; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id bc23-20020a656d97000000b003737c6010f5si10745051pgb.388.2022.02.28.12.59.27; Mon, 28 Feb 2022 12:59:43 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=0BqAyGXL; dkim=neutral (no key) header.i=@suse.cz header.b=3PIPU2vj; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229545AbiB1U7D (ORCPT + 99 others); Mon, 28 Feb 2022 15:59:03 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37312 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229531AbiB1U7B (ORCPT ); Mon, 28 Feb 2022 15:59:01 -0500 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 44CBE24F22; Mon, 28 Feb 2022 12:58:22 -0800 (PST) Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out1.suse.de (Postfix) with ESMTP id EFAA0210FA; Mon, 28 Feb 2022 20:58:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1646081900; h=from:from:reply-to:reply-to:date:date:message-id:message-id:to:to: cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=FteZVt9c1MVKPFOCakOdo0gY5PZ/CDEv9TeOnEDnzOQ=; b=0BqAyGXLksG7ZI4n7LCThq80eQYwPHuiKuf2eNujA9MT4hKQEc2ClhvKbeK3xznWMQ3LeU YYsmOWUHWR+dD7izAeLHqe9F5eOwIb8CvvAGJsrneYclPV2sJcfgDSmqKlIVEr7c9iODLW VmzvC1wohnHxF2TRGETCuShJ/UYxSLk= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1646081900; h=from:from:reply-to:reply-to:date:date:message-id:message-id:to:to: cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=FteZVt9c1MVKPFOCakOdo0gY5PZ/CDEv9TeOnEDnzOQ=; b=3PIPU2vjGWQiJMKrLRdGGaNPg3DvWGNCDbE44h8dAAJpRVg5dtVQD12lOUOeY/5I0GqslI xRZH6czIHsz+ITDA== Received: from ds.suse.cz (ds.suse.cz [10.100.12.205]) by relay2.suse.de (Postfix) with ESMTP id D9CACA3B81; Mon, 28 Feb 2022 20:58:20 +0000 (UTC) Received: by ds.suse.cz (Postfix, from userid 10065) id C1FE8DA823; Mon, 28 Feb 2022 21:54:29 +0100 (CET) Date: Mon, 28 Feb 2022 21:54:29 +0100 From: David Sterba To: Niels Dossche Cc: linux-btrfs@vger.kernel.org, linux-kernel@vger.kernel.org, clm@fb.com, josef@toxicpanda.com, dsterba@suse.com, Niels Dossche Subject: Re: [PATCH] btrfs: extend locking to all space_info members accesses Message-ID: <20220228205429.GL12643@twin.jikos.cz> Reply-To: dsterba@suse.cz Mail-Followup-To: dsterba@suse.cz, Niels Dossche , linux-btrfs@vger.kernel.org, linux-kernel@vger.kernel.org, clm@fb.com, josef@toxicpanda.com, dsterba@suse.com, Niels Dossche References: <20220225212028.75021-1-niels.dossche@ugent.be> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220225212028.75021-1-niels.dossche@ugent.be> User-Agent: Mutt/1.5.23.1-rc1 (2014-03-12) X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Feb 25, 2022 at 10:20:28PM +0100, Niels Dossche wrote: > bytes_pinned is always accessed under space_info->lock, except in > btrfs_preempt_reclaim_metadata_space, however the other members are > accessed under that lock. The reserved member of the rsv's are also > partially accessed under a lock and partially not. Move all these > accesses into the same lock to ensure consistency. > > Signed-off-by: Niels Dossche > Signed-off-by: Niels Dossche Added to misc-next, thanks.