Received: by 2002:a05:6a10:9afc:0:0:0:0 with SMTP id t28csp3133345pxm; Mon, 28 Feb 2022 12:45:50 -0800 (PST) X-Google-Smtp-Source: ABdhPJyiU/KjOSsDtf3dekve+Ia185bSeErdwlmuOV1EgUTuaRI0fgujDwuxjNiQlIIIsLZy4Pcs X-Received: by 2002:a17:906:360a:b0:6b9:1f8:9cdd with SMTP id q10-20020a170906360a00b006b901f89cddmr16845144ejb.461.1646081149966; Mon, 28 Feb 2022 12:45:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646081149; cv=none; d=google.com; s=arc-20160816; b=Ot7dq6FVHd4d9GFXYpK+tNQPoag4Y9W7waVFOZsMAvmyHP2a8f1vRav79dAtWRBuMr D0vOX7vrqt6zSTg8Dk/+0E+WFvNqpR1gBmZEU8q7HwuWSL5luLrhMZUyRTvNwi6sm6D6 dJ5I8Dm+xkQJwoeB2KK/A8X2ITc3TTQjkorRr2vPumfluOEP8h8GYONUZWA5V5cqV59I u6GpCoYbwCcKdvA2t31tmiD0Y0EThAbKofF61oPCrVaebd7QnvT5QBBukR6bP+Zv+PyC 5Rp00ByI3RHhxqOj8HfjzsQEcPqwF0+pCsDkw43ahVMGhJQgYheyvihE02bYXjCvp34A fm0w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=ZHoT4YkDpxrU7Vyv15+4IoJxGiHGy+fxfQCPVHMyNlA=; b=Gke4aIySGleWNFR+D2R0Fsq42g2+8gcDknVBsKWyoI8Dpew2bf/z+mFYnLpRgwRaTU mxH2IhjfHVEIPOEZJcfEyAF1gqk9kZ1kVBErMF1Ht83+b7WdG83kE6G8QRtIAVmH9YMs 3ioVy/Q1pS84BmPImtPtccZUPfHsmgG/Cy2+u2FRpPp+N+7ZGH4PrHLSKdg3negHFWPn BfEQJUj8fotFwTFD+fXQwaMMBh06TSV9ZTsfjc191ypIh2vuRIEGsJab9qMGo0GMS1Ml igNX02W2LN5Ph4VTlIavonvO73bVMqd3xb6M4sFSa7nEbscuq4YsYFQxOS4WvMJlag2L +8AQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@toxicpanda-com.20210112.gappssmtp.com header.s=20210112 header.b=IbMt+hms; 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 lb4-20020a170907784400b006b207691446si6975605ejc.112.2022.02.28.12.45.26; Mon, 28 Feb 2022 12:45:49 -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=@toxicpanda-com.20210112.gappssmtp.com header.s=20210112 header.b=IbMt+hms; 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 S229843AbiB1Umk (ORCPT + 99 others); Mon, 28 Feb 2022 15:42:40 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36306 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229832AbiB1Umf (ORCPT ); Mon, 28 Feb 2022 15:42:35 -0500 Received: from mail-qv1-xf31.google.com (mail-qv1-xf31.google.com [IPv6:2607:f8b0:4864:20::f31]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A2194220F6 for ; Mon, 28 Feb 2022 12:41:55 -0800 (PST) Received: by mail-qv1-xf31.google.com with SMTP id h13so14576185qvk.12 for ; Mon, 28 Feb 2022 12:41:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=toxicpanda-com.20210112.gappssmtp.com; s=20210112; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=ZHoT4YkDpxrU7Vyv15+4IoJxGiHGy+fxfQCPVHMyNlA=; b=IbMt+hmssmUwWFZCBD4jXXibUd/GYg4PUPVQyPb7shcvyXk4zvqUPCNEs6i52K84Qg 51DB/ywRU7R5gkGz3pJRDfPBUZqVCWAWGn16ccopuaHNjJ4uYJoHpGNTOTI8fyXT4XLS 26DGDC5O1hSenVBvuswkw94yp2QdmzEoa9XtFqPoE6owUUUjKC1WYn47SXqB5JHD5ZyX vYSFkRxJDCu9Pwc1im4EmuS7rPP39U4ZpOg5HXLN5dB8VbEusUggrB/IZI2uMtLyrNYY dxxseV8oklAgTLfjcBlgB2t9om8zJLVqNQm893NPoX8xRdyTYVqKdMtwkGRp6P2StKLW 4F8Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=ZHoT4YkDpxrU7Vyv15+4IoJxGiHGy+fxfQCPVHMyNlA=; b=SqUHYlXtP+/KAJ5GzyXseJdwLdLWNaPfmaNq1PPdLcwMP0KNL0LY4lUoTZFDGJru1P narpxQkIQH473cBbdJbjcGnI82qqDGoJ6+655tFrSQB25RP4UTp2OxgqCfnu5Di39Bnd vjrFUGtJzKTyHY3QGzI9ATaSxvJdVe6PBU8Xm/b32+VTQmWQu48bE+iuyrwAbfGEI46+ 0c46oX7iGpiYkoW4MGmfFgdYiOLDxJwr8gesrRnaKclbOPpcb8w95e/vcnqfFzywIq+u 4iPiphVgP5Y9igcuZIGAUrmqV2SG7efSLKwDMULXfzGPAKQMInWc4nltubRIVcnIHqve GO1w== X-Gm-Message-State: AOAM530tDqBkwPm4CXncPEQ+Iqo2RWuwtZoYe13MQpgv1RdJ7DvoLzvX cIWpabR1BsW3HV2R2xmPF7ULcUTp8AZ15Fsa X-Received: by 2002:ac8:5e4a:0:b0:2de:3a8b:f775 with SMTP id i10-20020ac85e4a000000b002de3a8bf775mr17903095qtx.40.1646080914723; Mon, 28 Feb 2022 12:41:54 -0800 (PST) Received: from localhost (cpe-174-109-172-136.nc.res.rr.com. [174.109.172.136]) by smtp.gmail.com with ESMTPSA id p7-20020a05622a13c700b002de9f3894c2sm7771762qtk.50.2022.02.28.12.41.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 28 Feb 2022 12:41:54 -0800 (PST) Date: Mon, 28 Feb 2022 15:41:52 -0500 From: Josef Bacik To: Niels Dossche Cc: linux-btrfs@vger.kernel.org, linux-kernel@vger.kernel.org, clm@fb.com, dsterba@suse.com, Niels Dossche Subject: Re: [PATCH] btrfs: extend locking to all space_info members accesses Message-ID: 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> X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_NONE, 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 Reviewed-by: Josef Bacik Thanks, Josef