Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp7189606rwb; Tue, 15 Nov 2022 08:46:20 -0800 (PST) X-Google-Smtp-Source: AA0mqf4m7NQ/KnSgToOc394v3mBYVJ9x48OReCiVHZ2W5Jo2DCGHvoEHxJ81oYz+I6suPoghJyvF X-Received: by 2002:a17:906:c185:b0:7ad:84d1:5b56 with SMTP id g5-20020a170906c18500b007ad84d15b56mr15373963ejz.205.1668530780478; Tue, 15 Nov 2022 08:46:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668530780; cv=none; d=google.com; s=arc-20160816; b=rkgeMXd7azMcRf0akzLjCFEW2yx2L3svbBGW3poUeiYE7X77DgbZ6Fomy6r/bFV++/ tCShv5UWKqFaoFIKeIBiL5QBjIj5+dwImW7IxznOg7cMXmyw0+Eq2DDzylmkstTAvC5P lGb6Agtp3/WtBCHaOCHdLma3Jhqt1Hm1PLn97Hp8mH8klSJs5scd51unTZ63Nx1SnEE7 nhf3TwqAFJOPGhvXn0+nta5VAQ7ZGbAYe/J7nQHVVqthL/8nL9MJ/rL1GeiWyvqQhzub JlK3AiWe4gpnO14/7AxXT4JfSAvrS9M3xL8LRVRQ8eU7/KkR3yUnf0iW94Ryj6l4O9+t +dcQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:subject:user-agent:mime-version:date:message-id; bh=wOiMbqVYCasGaeEZsE7udnpuUQH6b8X1v0XJ/k1/Nik=; b=pJF3ch+UcKVEIHQRyfsiyaxaqpSnSJ3mvY3+Vc4/7OD22QARIdY43lBLC7mZZvuhwu qXVSdB0Li3isu65uqzJj7qR/ltzO81m/arzjRB/Gm7IJokp/sMD6wyZnqopwx7BlxAWQ 77n8yZ512EPTLEnUXEXdvXtu2S1qo7Tvl80phgzG4onQ7SsyMQMobmBo+7BE+8xR2yW3 yoXszvEAQQOT4eUsMI4bmwBo3Lru9Y9fkL/cUFJN07JfqLuClu+/dLClzuC7gbhugli2 BhN0bhEGo6xi1KYIxJuksOBHCmV5VNSrwaBrZfx+kKJoVyRkMxQog1qxqeqZ6i+woHS+ MPQw== ARC-Authentication-Results: i=1; mx.google.com; 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; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id la26-20020a170907781a00b007ae814af66bsi8974039ejc.389.2022.11.15.08.45.54; Tue, 15 Nov 2022 08:46:20 -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; 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; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238283AbiKOQWb (ORCPT + 90 others); Tue, 15 Nov 2022 11:22:31 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42662 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238526AbiKOQW0 (ORCPT ); Tue, 15 Nov 2022 11:22:26 -0500 Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 69C831F9DE; Tue, 15 Nov 2022 08:22:25 -0800 (PST) Received: from dggemv703-chm.china.huawei.com (unknown [172.30.72.54]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4NBWfK2HTYzmVtB; Wed, 16 Nov 2022 00:22:01 +0800 (CST) Received: from kwepemm600015.china.huawei.com (7.193.23.52) by dggemv703-chm.china.huawei.com (10.3.19.46) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Wed, 16 Nov 2022 00:22:22 +0800 Received: from [10.174.176.52] (10.174.176.52) by kwepemm600015.china.huawei.com (7.193.23.52) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Wed, 16 Nov 2022 00:22:21 +0800 Message-ID: Date: Wed, 16 Nov 2022 00:22:20 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.2.1 Subject: Re: [PATCH v4 3/3] btrfs: qgroup: fix sleep from invalid context bug in update_qgroup_limit_item() To: , , CC: , , , , , References: <20221115171709.3774614-1-chenxiaosong2@huawei.com> <20221115171709.3774614-4-chenxiaosong2@huawei.com> From: ChenXiaoSong In-Reply-To: <20221115171709.3774614-4-chenxiaosong2@huawei.com> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 8bit X-Originating-IP: [10.174.176.52] X-ClientProxiedBy: dggems704-chm.china.huawei.com (10.3.19.181) To kwepemm600015.china.huawei.com (7.193.23.52) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,NICE_REPLY_A, RCVD_IN_DNSWL_MED,SPF_HELO_NONE,SPF_PASS 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 在 2022/11/16 1:17, ChenXiaoSong 写道: > @@ -2987,6 +2986,7 @@ int btrfs_qgroup_inherit(struct btrfs_trans_handle *trans, u64 srcid, > dstgroup->max_excl = srcgroup->max_excl; > dstgroup->rsv_rfer = srcgroup->rsv_rfer; > dstgroup->rsv_excl = srcgroup->rsv_excl; > + update_limit = false; > > qgroup_dirty(fs_info, dstgroup); > qgroup_dirty(fs_info, srcgroup); No need to call update_qgroup_limit_item() when condition "if (srcid)" is true according to Qu Wenruo's suggestions, btrfs_run_qgroups() will update the quota tree to reflect the result after calling qgroup_dirty().