Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp2731602rwi; Fri, 28 Oct 2022 10:29:40 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5eUcwzQzS7fkqQW157OiqQF2rUKwypdY1LXANxbGTlIdXvkGQr0ppjTD3bexiPTJ9mnwgs X-Received: by 2002:a05:6402:27d2:b0:462:8e41:569c with SMTP id c18-20020a05640227d200b004628e41569cmr495550ede.191.1666978180326; Fri, 28 Oct 2022 10:29:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666978180; cv=none; d=google.com; s=arc-20160816; b=kOLM8VOV8h3wF1SBc4/aKl9vgnWqiYHoVzff9UCksYDIx/yd15BZp7JbiZm8iVXjt+ 3mMJgL2X319cC4STb2iJZJjIA9nLTsPiiH15u/sAekxMAkPt8Oa8mPype4KvpIB6HiN7 9yib+BpsVyhmJMhfNOcPtjQglgSvSQRGAwo9bJyvYrDy7oEeDAxLFKjHoKZmx+10T3vg WmcfO4rDfaqkM8hE3xqZ6MAbZJRlkFuiZCFkbt0dhW409VCDcMXoSo8+0Ov908vfvBwM x29/m40DWAM32+vfPfHJAbmhE00IQjZ3XNgHIquFwI00vEIeQ7klpHUuKHXuWLsU7iAp 98Uw== 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:dkim-signature:dkim-signature; bh=Z1wJrT5mwfguS7h+6tsChzRtdrFWjJ5h0upJpKVRuVk=; b=jMHBTj22mNKQrzulN4Tv4RvFZPv5aF3e+EWlcwC52zx72SlyWPmsXt/kjGEChilUOS oviZGwLFljnvTNuTJXtlHhYAiGThWrSbuH8JobkXQtnDI9fUda6qFBi177bjJ2CZ+Ihe VmuMw5AdVbpLYcx2EH9rdPAK9OnWxmX+m7EspayG6Kto5NMvzPnRV/FYDrh/xbjyL/ra tjc7+RVjCtOi0ZhIM5iWcvlA775iszHaY6RbycU3wMkgjGYFxYrRT7ZEq52ubjA/fOZV apqqgfGtVCu067NWY/pY/2L9xH0LdB/6DdRGpSJ8qbmksBJBz4TGisA1ibRv5Obskno+ NnaQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@paragon-software.com header.s=mail header.b=ap6Jd6Il; dkim=pass header.i=@paragon-software.com header.s=mail header.b="Od8/scn9"; 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=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=paragon-software.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id l19-20020a170906a41300b0078277d265bcsi3945040ejz.204.2022.10.28.10.29.14; Fri, 28 Oct 2022 10:29:40 -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=@paragon-software.com header.s=mail header.b=ap6Jd6Il; dkim=pass header.i=@paragon-software.com header.s=mail header.b="Od8/scn9"; 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=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=paragon-software.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230486AbiJ1RHz (ORCPT + 99 others); Fri, 28 Oct 2022 13:07:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60298 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231320AbiJ1RHf (ORCPT ); Fri, 28 Oct 2022 13:07:35 -0400 Received: from relayaws-01.paragon-software.com (relayaws-01.paragon-software.com [35.157.23.187]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 57C6089916; Fri, 28 Oct 2022 10:05:23 -0700 (PDT) Received: from relayfre-01.paragon-software.com (unknown [172.30.72.12]) by relayaws-01.paragon-software.com (Postfix) with ESMTPS id 9F7C5218D; Fri, 28 Oct 2022 17:02:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paragon-software.com; s=mail; t=1666976561; bh=Z1wJrT5mwfguS7h+6tsChzRtdrFWjJ5h0upJpKVRuVk=; h=Date:Subject:From:To:CC:References:In-Reply-To; b=ap6Jd6Il508YZcM9lbiU4LL2kgEi4UhNsNWfCnwz82iAyHSOTNCS15nO6A1HsqqAh T3UKIuf6LKcjsfIE0WH7E/wixWbAPAbeuKLxMXFtdYEqwfG93+cA/R4a11d4NWKeeX edS2NmHWt3Xugulc3YadJcy5AWyWed3mdVCIp+3A= Received: from dlg2.mail.paragon-software.com (vdlg-exch-02.paragon-software.com [172.30.1.105]) by relayfre-01.paragon-software.com (Postfix) with ESMTPS id 9D6C0DD; Fri, 28 Oct 2022 17:05:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paragon-software.com; s=mail; t=1666976720; bh=Z1wJrT5mwfguS7h+6tsChzRtdrFWjJ5h0upJpKVRuVk=; h=Date:Subject:From:To:CC:References:In-Reply-To; b=Od8/scn9IvuypjfeFrrovmpLjKo9xf74MXtp5mvONypWGUSwprXwoK1UXw3c3YuCk tNECaWd3SGEm8ey2KObVffO0Hctm1mtjqsdBqa6eM0dETSKqGRVN4qratXSr1csDmZ pBIOvXCGCvm2j/GxjuAdWFrVr447zC7AsIjICX5o= Received: from [172.30.8.65] (172.30.8.65) by vdlg-exch-02.paragon-software.com (172.30.1.105) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.7; Fri, 28 Oct 2022 20:05:20 +0300 Message-ID: Date: Fri, 28 Oct 2022 20:05:20 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.11.0 Subject: [PATCH 08/14] fs/ntfs3: Correct ntfs_check_for_free_space Content-Language: en-US From: Konstantin Komarov To: CC: , References: In-Reply-To: Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [172.30.8.65] X-ClientProxiedBy: vdlg-exch-02.paragon-software.com (172.30.1.105) To vdlg-exch-02.paragon-software.com (172.30.1.105) X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,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 zlen in some cases was bigger than correct value. Signed-off-by: Konstantin Komarov --- fs/ntfs3/fsntfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/ntfs3/fsntfs.c b/fs/ntfs3/fsntfs.c index b56ffb4951cc..e5a1f4df0397 100644 --- a/fs/ntfs3/fsntfs.c +++ b/fs/ntfs3/fsntfs.c @@ -432,7 +432,7 @@ bool ntfs_check_for_free_space(struct ntfs_sb_info *sbi, CLST clen, CLST mlen) wnd = &sbi->used.bitmap; down_read_nested(&wnd->rw_lock, BITMAP_MUTEX_CLUSTERS); free = wnd_zeroes(wnd); - zlen = wnd_zone_len(wnd); + zlen = min_t(size_t, NTFS_MIN_MFT_ZONE, wnd_zone_len(wnd)); up_read(&wnd->rw_lock); if (free < zlen + clen) -- 2.37.0