Received: by 2002:a05:6359:6284:b0:131:369:b2a3 with SMTP id se4csp5610723rwb; Wed, 9 Aug 2023 06:51:46 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHDli6ZrRk4y6AruLzlgw+mkeiYRZWw2oGspG5gMs3S2k7VHbZmbAAKV6bEwqjUEUhd4Sp/ X-Received: by 2002:a9d:5c02:0:b0:6b9:a795:512f with SMTP id o2-20020a9d5c02000000b006b9a795512fmr2463096otk.10.1691589106046; Wed, 09 Aug 2023 06:51:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691589106; cv=none; d=google.com; s=arc-20160816; b=Zyy/A3BV/62XWP/9s0ZdsqUxj7WrXTsTTisP+0NAfpFbL1PzvZikt4qYiFCbnvMBcx kmwLmG5maEhh9aQoErK/EtSOeB6AzS+M66uXttUubzOWpMQhu9qJ0PFTus+emRjDbAZ6 NLdwxuF+0YPPLwOAd2V3tYV2C/abYzXKhYExtaDC+n7q3iRKi5/ImyvhHsuk7dUcYLIZ WTOD+6bqeOlIi9+pEl/hM0T1rIthbu+xgBl5rGI2gtqryFvwgDn7PtvebYb1t/NLx/qM gtLRnMHB4qfnKS63mjPk/SOQ2DLDAr1Z66fxWhWkOLkfA6+27vXyhqg4u1RPKn44mxdD Cwcw== 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=pUFD+zARLBoD9VgfQ9i6E9H3evhSNHaQhIu9d2QM1Sk=; fh=DECFJebu7ySFxUr6SeCvNz6N00v5PUUxaBF/OZ36Vy8=; b=M2V00XW0QfRg5gcFhEQgATRSTMb/phchKn8jo6OKdDvMbVrMQtK7QmAGuTeG86D/6r PtHLmSwk5Y8HCtloywNt2HcoPuLvcNlLQvWkzLxstROxtVM1XdeiXWyhCNE/Wu2Z9qCP mMrPFeCz5RUCjMLdXU1WxyaQEH7+sV75gvKCGxFtBJi4DW+poaBwUoYxfohqzJrJ7fop 8lcDP4Z/nynqRilaJdLNMpIQ/Ffm+/i8V+4NaC1kInvKDXNNbBThyoz+gIHWkKx1e38v Ew2zd3nmYRSR6pZ4ODCtFvDmEVEjSa4c6V0+WeIcCZFY81h2JRxXuoQfXUIXMcW976PO xbcQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@toxicpanda-com.20221208.gappssmtp.com header.s=20221208 header.b=49DGZzAi; 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 m67-20020a632646000000b00553ebb05d25si9038654pgm.80.2023.08.09.06.51.33; Wed, 09 Aug 2023 06:51:46 -0700 (PDT) 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.20221208.gappssmtp.com header.s=20221208 header.b=49DGZzAi; 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 S232817AbjHINQH (ORCPT + 99 others); Wed, 9 Aug 2023 09:16:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48388 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232813AbjHINQG (ORCPT ); Wed, 9 Aug 2023 09:16:06 -0400 Received: from mail-qv1-xf2d.google.com (mail-qv1-xf2d.google.com [IPv6:2607:f8b0:4864:20::f2d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0D8332103 for ; Wed, 9 Aug 2023 06:16:03 -0700 (PDT) Received: by mail-qv1-xf2d.google.com with SMTP id 6a1803df08f44-63cf6b21035so43107946d6.1 for ; Wed, 09 Aug 2023 06:16:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=toxicpanda-com.20221208.gappssmtp.com; s=20221208; t=1691586962; x=1692191762; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=pUFD+zARLBoD9VgfQ9i6E9H3evhSNHaQhIu9d2QM1Sk=; b=49DGZzAi0lv9R4YUMmmyRsTaKTI24MrnipFt1c85HJH1J8TAsoBZdDM9BkmJIMRaET Az6MNfDAIf4iKebPZ86C5koKjZhQIkq4wDkOy56mqH1F/ztPtJuxFFZVDKCx/2DUXTFX 5K4mQ9NnaruKl1Z5E4M0G0TGVWWclb2yrZGNBv9Tf3SqNVFYF2he1YxXXM4JaB2BT13n 2m5VN0Kb554n/8gHrivnx7P9aXKT6tsFHvTlG1p1ckJwWeLdSC1IuLV1zUqVYcOdUeSN pZjul2ODl7JoaAe+ZsQgBtX8eWJDPj5R1sijKMmbYtKy+xKFG0zOMNO8NiIHnEY+bRCu H48g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1691586962; x=1692191762; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=pUFD+zARLBoD9VgfQ9i6E9H3evhSNHaQhIu9d2QM1Sk=; b=CVmhoBE/t/ZDThdtM0jYSAZyeAlFwGE9CxYNeNaNhEfsPKSA/pymvb6qxAjCg0IlDr BVycoDjdtR+TYEmjGSX2fVRlORvlj/EGHiLC+lwg5O/SqvOA4KluEiZzBZ5dxk9IJwCC Jv6oHZwYuFYuDRjUBR+o+8FIA4CK2OSwgDG0evkR2WstezAok0Gs3bPPEjt2jKT/nf6t 7EOPQrLaE8W17S+a3EX7LZsBqBiSvEdDH4v9OgW42tCHMYNXRYd9NNZHWxjsccN3Pjbn 3+qc87LZyxNsulZAgQZpFEgctbg1OBp7oXko0HeRq3tbGuG5EXsQC9wgnUTPiI5a1Uvn F6DA== X-Gm-Message-State: AOJu0YwX+NXkn9zfpMLNo497g4dlP+v3aXmDDrYPdvzq0hVCDqe/R2Rf ulC7f/6xvhwxG/quV4OVnCuV/g== X-Received: by 2002:a05:6214:390c:b0:63c:ea63:4717 with SMTP id nh12-20020a056214390c00b0063cea634717mr2509361qvb.43.1691586962165; Wed, 09 Aug 2023 06:16:02 -0700 (PDT) Received: from localhost (cpe-76-182-20-124.nc.res.rr.com. [76.182.20.124]) by smtp.gmail.com with ESMTPSA id a2-20020a0c8bc2000000b0063d06946b2bsm4428701qvc.100.2023.08.09.06.16.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Aug 2023 06:16:01 -0700 (PDT) Date: Wed, 9 Aug 2023 09:16:00 -0400 From: Josef Bacik To: xiaoshoukui Cc: dsterba@suse.cz, clm@fb.com, dsterba@suse.com, linux-btrfs@vger.kernel.org, linux-kernel@vger.kernel.org, xiaoshoukui@ruijie.com.cn Subject: Re: [PATCH] btrfs: fix race between balance and cancel/pause Message-ID: <20230809131600.GB2515439@perftesting> References: <9cdf58c2f045863e98a52d7f9d5102ba12b87f07.1687496547.git.josef@toxicpanda.com> <20230808024748.20530-1-xiaoshoukui@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230808024748.20530-1-xiaoshoukui@gmail.com> X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_NONE 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 Mon, Aug 07, 2023 at 10:47:48PM -0400, xiaoshoukui wrote: > I think this patch does not fully fix the issue. > > This patch just fix assertion panic, but in the race situation, the ioctl pause > request still returns an incorrect value 0 to the user which mislead the user the > pause request finished successfully. In fact, the balance request has not been paused. > > Test results and analysis are as follows: > https://lore.kernel.org/linux-btrfs/20230726030617.109018-1-xiaoshoukui@gmail.com/T/#me125d17fa59e9e671149cc76d410ced747f488b1 They're just two different issues. My patch is concerned with the panic, yours is concerned with getting the correct return value out to the user. Rebase your patch ontop of Sterba's tree with my fix and send it along, getting an accurate errno out to the user is a reasonable goal. Thanks, Josef