From patchwork Wed Sep 27 23:14:36 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Boris Burkov X-Patchwork-Id: 13401808 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 81297E80ABC for ; Wed, 27 Sep 2023 23:13:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230041AbjI0XNt (ORCPT ); Wed, 27 Sep 2023 19:13:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38004 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230030AbjI0XNs (ORCPT ); Wed, 27 Sep 2023 19:13:48 -0400 Received: from out2-smtp.messagingengine.com (out2-smtp.messagingengine.com [66.111.4.26]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7597CF5; Wed, 27 Sep 2023 16:13:46 -0700 (PDT) Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id E10695C2806; Wed, 27 Sep 2023 19:13:45 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute5.internal (MEProxy); Wed, 27 Sep 2023 19:13:45 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bur.io; h=cc :content-transfer-encoding:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to; s=fm3; t=1695856425; x= 1695942825; bh=nKPcB7v/h+P6IKZebcF+3glNhmXxwFRSsv67QuHq9ik=; b=x X2V2fqQCJjyOywobUs9uCvhmKWMhDNgYNMftuGNcOsjDxBBHWd50U9ULdY15C1EJ UQQzVp9S4t994ncGTEqQK8gGjOB+d6J/W72L7KxwvCfBDRkMu/pQsYMMlSbCMGfc wrm5WIaQKP6aFPMPKtLzgniBWX7p+m7exVilEmFBA1fI10TGMX5z6ht5CZeDoPkv FQlfyGguMBnb3yVfyW1n7YiVC94mBXpnxesKtcmRdwzEFekyHLjjDd19L/5BFDKg c77KZZtQyvq9VHxulFagpAPTuMSHTys5dBi0MfKLuKamC8ht8oHZe/9ZNKDeQXXS ABNy91JKr/iVIDuB0ZUVg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:date:feedback-id:feedback-id:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:sender :subject:subject:to:to:x-me-proxy:x-me-proxy:x-me-sender :x-me-sender:x-sasl-enc; s=fm2; t=1695856425; x=1695942825; bh=n KPcB7v/h+P6IKZebcF+3glNhmXxwFRSsv67QuHq9ik=; b=bONNCpe4xjOcY/2ZM ycAJ/JS2u5MBiOQ1UUG6M/mRXC+tIp9HXXWZtdLG1ZTS4Maf1rvlpKIkyvVPfTBb iNgKF3EjK2ut+073em/TRkVpGrMmEHieB5jOgv9tKlrBcQKa/MhzzLGTYv9AhydL SRjkQDt0pX4ulmdIe8xMQxk3aEnv83L9NYGUJ1qs88Qvt1y19DO4cPv5BKxrQySg u7hcn1PdpwA98HpY5xOQ1aTmqwjhTYL/h/6A5keCc82n+/NRJZHu4WUa/3y0dh8+ u2uLIqQkLiQJlAM4OP8N1cnp7FGRrquFTqEgwZtkb30eta/DmzZsEwygzMqsCa3z LZTvQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvjedrtdehgddulecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecunecujfgurhephffvufffkffojghfggfgsedtkeertd ertddtnecuhfhrohhmpeeuohhrihhsuceuuhhrkhhovhcuoegsohhrihhssegsuhhrrdhi oheqnecuggftrfgrthhtvghrnhepieeuffeuvdeiueejhfehiefgkeevudejjeejffevvd ehtddufeeihfekgeeuheelnecuvehluhhsthgvrhfuihiivgepudenucfrrghrrghmpehm rghilhhfrhhomhepsghorhhishessghurhdrihho X-ME-Proxy: Feedback-ID: i083147f8:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 27 Sep 2023 19:13:45 -0400 (EDT) From: Boris Burkov To: linux-btrfs@vger.kernel.org, kernel-team@fb.com, fstests@vger.kernel.org Subject: [PATCH v3 4/6] btrfs: quota rescan helpers Date: Wed, 27 Sep 2023 16:14:36 -0700 Message-ID: <1111e2f58d73dfe7571598cdd044211e15076a1b.1695856385.git.boris@bur.io> X-Mailer: git-send-email 2.42.0 In-Reply-To: References: MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: fstests@vger.kernel.org Many btrfs tests explicitly trigger quota rescan. This is not a meaningful operation for simple quotas, so we wrap it in a helper that doesn't blow up quite so badly and lets us run those tests where the rescan is a qgroup detail. Signed-off-by: Boris Burkov --- common/btrfs | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/common/btrfs b/common/btrfs index 37796cc6e..0053fec48 100644 --- a/common/btrfs +++ b/common/btrfs @@ -710,6 +710,24 @@ _check_regular_qgroup() _qgroup_mode "$@" | grep -q 'qgroup' } +_qgroup_rescan() +{ + local mnt=$1 + + _check_regular_qgroup $dev || return 1 + _run_btrfs_util_prog quota rescan -w $mnt +} + +_require_qgroup_rescan() +{ + _scratch_mkfs >>$seqres.full 2>&1 + _scratch_mount + _run_btrfs_util_prog quota enable $SCRATCH_MNT + $BTRFS_UTIL_PROG quota rescan -w $SCRATCH_MNT || \ + _notrun "not able to run quota rescan" + _scratch_unmount +} + _require_scratch_qgroup() { _scratch_mkfs >>$seqres.full 2>&1