Received: by 2002:a05:7412:3784:b0:e2:908c:2ebd with SMTP id jk4csp1932770rdb; Tue, 3 Oct 2023 05:48:47 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFXAPmd4MQTALvtZ5p2MTMTcE6xI7wI/zKZ5L+1nvm8Yj3R1KciPr393q/DPT+9psO8PJfJ X-Received: by 2002:a05:6358:885:b0:142:f1d5:ef89 with SMTP id m5-20020a056358088500b00142f1d5ef89mr15541266rwj.5.1696337327004; Tue, 03 Oct 2023 05:48:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696337326; cv=none; d=google.com; s=arc-20160816; b=lXl9+Z5giZO+5va5Hify142VP6Ii2D/mbIriHVVqHhm7/a2qiFotH2m6U0LSQZNNBx GvkCyYA4qkUVTzuNb1f68h7U3YvybcrjtFCIbSOQ9MsZnykmZwz/fuxK/arWEOF/hg0E 1ca10W1iwbcvF7t+Z++AuV8vkc4BZomWMgO1Nbw+Lcw7tcYGb5jBxhoLeH9z6iLeIpkc nph1Umc2VtIbjdwnnaHuj2mz4V7HR8osMaK6hJ7UySExHCqJRroY/IrmaVvcNvjb4VD0 2U9kuh0d8f7RyLSctV+9Kc6qPFo/MtqBTktCoi3zEdU8SBloirKovi9OxRcyCX338XTx lpvg== 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:references :cc:to:from:content-language:subject:user-agent:mime-version:date :message-id; bh=FMwQlpv66wsUh/TyqeJ+EWRAlA/ef5xhfhaYyowhv/k=; fh=xVu1oA16JFyr5Tne/7AOgFvH9s4s8dmH22R+zespyDw=; b=H3G6U9RN3kU2L9X7BpBgyT5t4379rXmdgibHX/OXnI8YjQp7r5iNyyspIacVcaBWpb 1xmTTatqFSHzlCb3lyEMW8egqWVZUWrh82BbiULM5Q0b2Upa8sx8mTa7G02lMAvKrKfe SQSvWkq3LYC/a4BfxY/SrS6VyEAAKJFjhnQeanqQAUjC2sKNiQCfGCd4X2bVph34jhYV J8IiMAZS9p4z6a64BnfU64HA0XazxutuIOMO2M1MKqToCUMANDLsKqu2UDtApVfZMV+W 6iaKhq3krYKDZkAS59kLoCMvQV+UtgfwTcRcrNMqrZMpICkrBPnlSf+ZGaYOSRgeVxsE b21g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id w190-20020a6382c7000000b00577f7b6e7b4si1344852pgd.624.2023.10.03.05.48.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 03 Oct 2023 05:48:46 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id E3B458131A89; Tue, 3 Oct 2023 05:48:45 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230283AbjJCMsk convert rfc822-to-8bit (ORCPT + 99 others); Tue, 3 Oct 2023 08:48:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49398 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229689AbjJCMsj (ORCPT ); Tue, 3 Oct 2023 08:48:39 -0400 Received: from mail.astralinux.ru (mail.astralinux.ru [217.74.38.119]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8BD2BB3; Tue, 3 Oct 2023 05:48:36 -0700 (PDT) Received: from localhost (localhost.localdomain [127.0.0.1]) by mail.astralinux.ru (Postfix) with ESMTP id CBD1F186375F; Tue, 3 Oct 2023 15:48:34 +0300 (MSK) Received: from mail.astralinux.ru ([127.0.0.1]) by localhost (rbta-msk-vsrv-mail01.astralinux.ru [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id ocIQr9C3wiQj; Tue, 3 Oct 2023 15:48:34 +0300 (MSK) Received: from localhost (localhost.localdomain [127.0.0.1]) by mail.astralinux.ru (Postfix) with ESMTP id 7D3471867983; Tue, 3 Oct 2023 15:48:34 +0300 (MSK) X-Virus-Scanned: amavisd-new at astralinux.ru Received: from mail.astralinux.ru ([127.0.0.1]) by localhost (rbta-msk-vsrv-mail01.astralinux.ru [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id 4m9gmqCtRmgR; Tue, 3 Oct 2023 15:48:34 +0300 (MSK) Received: from new-mail.astralinux.ru (unknown [10.177.185.103]) by mail.astralinux.ru (Postfix) with ESMTPS id 1D9B518669E3; Tue, 3 Oct 2023 15:48:33 +0300 (MSK) Received: from [10.177.20.58] (unknown [10.177.20.58]) by new-mail.astralinux.ru (Postfix) with ESMTPA id 4S0HgP3HqqzhXXG; Tue, 3 Oct 2023 15:48:33 +0300 (MSK) Message-ID: <422765f7-20a8-4fc0-8768-59c806332275@astralinux.ru> Date: Tue, 3 Oct 2023 15:48:11 +0300 MIME-Version: 1.0 User-Agent: RuPost Desktop Subject: Re: [PATCH 5.10] btrfs: fix region size in count_bitmap_extents Content-Language: ru From: =?UTF-8?B?0JDQvdCw0YHRgtCw0YHQuNGPINCb0Y7QsdC40LzQvtCy0LA=?= To: Chris Mason Cc: Josef Bacik , David Sterba , Dennis Zhou , linux-btrfs@vger.kernel.org, linux-kernel@vger.kernel.org, lvc-project@linuxtesting.org, Greg Kroah-Hartman , stable@vger.kernel.org References: <20230914094555.25657-1-abelova@astralinux.ru> <798207fe-35ea-46b4-9e52-73efcbb061de@astralinux.ru> In-Reply-To: <798207fe-35ea-46b4-9e52-73efcbb061de@astralinux.ru> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8BIT X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_BLOCKED,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 X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Tue, 03 Oct 2023 05:48:46 -0700 (PDT) 03/10/23 15:39, Anastasia Belova пишет: > > 14/09/23 12:45, Anastasia Belova пишет: >> count_bitmap_extents was deleted in version 5.11, but >> there is possible mistake in versions 5.6-5.10. >> >> Region size should be calculated by subtracting >> the end from the beginning. > Do I understand correctly that bytes should decrease and > (rs - re) is always negative and should be replaced by (re - rs)? >> Found by Linux Verification Center (linuxtesting.org) with SVACE. >> >> Fixes: dfb79ddb130e ("btrfs: track discardable extents for async discard") >> Signed-off-by: Anastasia Belova >> --- >> fs/btrfs/free-space-cache.c | 2 +- >> 1 file changed, 1 insertion(+), 1 deletion(-) >> >> diff --git a/fs/btrfs/free-space-cache.c b/fs/btrfs/free-space-cache.c >> index 4989c60b1df9..a34e266a0969 100644 >> --- a/fs/btrfs/free-space-cache.c >> +++ b/fs/btrfs/free-space-cache.c >> @@ -1930,7 +1930,7 @@ static int count_bitmap_extents(struct btrfs_free_space_ctl *ctl, >> >> bitmap_for_each_set_region(bitmap_info->bitmap, rs, re, 0, >> BITS_PER_BITMAP) { >> - bytes -= (rs - re) * ctl->unit; >> + bytes -= (re - rs) * ctl->unit; >> count++; >> >> if (!bytes) > Anastasia Sorry for sending html accidentally