Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp905990imw; Wed, 13 Jul 2022 10:04:17 -0700 (PDT) X-Google-Smtp-Source: AGRyM1uEOyFdmuLKerYg3VrxyUUaiFOtkeEJ7sBskZ6QUB2s5psi2TV21JpyLMgucOk0f1djZbH8 X-Received: by 2002:a17:90a:474c:b0:1ec:f898:d85b with SMTP id y12-20020a17090a474c00b001ecf898d85bmr4925540pjg.11.1657731856808; Wed, 13 Jul 2022 10:04:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657731856; cv=none; d=google.com; s=arc-20160816; b=d/jEszcwGaRIP7qgASat8Rr0bSuYFn07x642LHwuUMF+z7peBPhpRCackbKF7Nsapj cIzdaanlZCeCIimKZTKVA2ppWdCPxXahoaB5SNZRWgnOomP5rxNB2pf0qNGTSxceeiZQ xt8okomUWcuE+/ejN5mAZPlg7ufI4C35FyZr9HDwHVXqg3SpGkrbYzRzwNr40vF9PPaz n7t0fOVUzoEm/V232NbxfRrVKHHrA6Czu37jpCwxW1eye4UQqKdnD27W+c9K4QyCYd95 rg3P7iEi4b75E0RfXjKGQL6MZe/eA2rUMt4XCK041xRyr6GGbgoA2U2TKoRPg9oND9pn vz+A== 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; bh=LbmuPQY5mP/niQQZAD6y/cHTHk3ho0WyMWitsZ6l2sw=; b=xryFHqe35RsmDpgMaut7tWLA8WBl8v8PrrQDJ0mDImjusIxo9xZiysnzs3w87jxz9I 8Gjrs8rBZkqat6zsZhzN8a2HkoxBBXqecFUxIdCtTSV0JaM6JteUoN831QuFTz/LDJdG PPH7N8/AwH73V1ZxPefMeb/P5Br0V9y8sv+XlWF/U1lr2ka6mvAlz/e06Ev07ppcNNZv bY4sdEwc5GV11C2/ld6BvtfAL4+RuHzOPQL+nMozhDIPmBwkUHJem68zhvzqmiulERud ZL9ePNygz+9wPtbu2z7KmbzSY68Jjc2pzjqQ++nZPymSxUaJ8taNASVQm8rIVfMaBsC1 MMXw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@paragon-software.com header.s=mail header.b="TOZYl6/T"; 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 y8-20020a62b508000000b0052ac0e55a13si14624890pfe.197.2022.07.13.10.03.47; Wed, 13 Jul 2022 10:04:16 -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="TOZYl6/T"; 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 S235824AbiGMQr1 (ORCPT + 99 others); Wed, 13 Jul 2022 12:47:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53974 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233370AbiGMQrT (ORCPT ); Wed, 13 Jul 2022 12:47:19 -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 3CDD82F66F; Wed, 13 Jul 2022 09:47:17 -0700 (PDT) Received: from dlg2.mail.paragon-software.com (vdlg-exch-02.paragon-software.com [172.30.1.105]) by relayaws-01.paragon-software.com (Postfix) with ESMTPS id BADFE1DDC; Wed, 13 Jul 2022 16:46:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paragon-software.com; s=mail; t=1657730767; bh=LbmuPQY5mP/niQQZAD6y/cHTHk3ho0WyMWitsZ6l2sw=; h=Date:Subject:From:To:CC:References:In-Reply-To; b=TOZYl6/ThTMJz7JwIkTVUWK4o+ZWAmhYP1JAJnXGdPbQ6bdibDR9SEhPofDnWqby0 TOthxDsEwqoRuyM4U3nDHec1dhBck3TrhEQNtgT2mg4dqKyZU4DESELlyXHhnYi3K2 z53sS9DZocFTYcI9bN6lTjs37QgRoQr8D75tdIHQ= 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; Wed, 13 Jul 2022 19:47:15 +0300 Message-ID: <1282d35f-ed0d-e020-a4e5-8700744e2c3b@paragon-software.com> Date: Wed, 13 Jul 2022 19:47:14 +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 5/6] fs/ntfs3: Create MFT zone only if length is large enough Content-Language: en-US From: Konstantin Komarov To: CC: , References: <2101d95b-be41-6e6d-e019-bc70f816b2e8@paragon-software.com> In-Reply-To: <2101d95b-be41-6e6d-e019-bc70f816b2e8@paragon-software.com> 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, T_SCC_BODY_TEXT_LINE 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 Also removed uninformative print Signed-off-by: Konstantin Komarov --- fs/ntfs3/fsntfs.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/fs/ntfs3/fsntfs.c b/fs/ntfs3/fsntfs.c index e6f5bf684da4..d09213ae9755 100644 --- a/fs/ntfs3/fsntfs.c +++ b/fs/ntfs3/fsntfs.c @@ -806,12 +806,6 @@ int ntfs_refresh_zone(struct ntfs_sb_info *sbi) /* Try to allocate clusters after last MFT run. */ zlen = wnd_find(wnd, sbi->zone_max, lcn_s, 0, &lcn_s); - if (!zlen) { - ntfs_notice(sbi->sb, "MftZone: unavailable"); - return 0; - } - - /* Truncate too large zone. */ wnd_zone_set(wnd, lcn_s, zlen); return 0; @@ -2473,8 +2467,9 @@ void mark_as_free_ex(struct ntfs_sb_info *sbi, CLST lcn, CLST len, bool trim) if (zlen == zone_len) { /* MFT zone already has maximum size. */ } else if (!zone_len) { - /* Create MFT zone. */ - wnd_zone_set(wnd, lcn, zlen); + /* Create MFT zone only if 'zlen' is large enough. */ + if (zlen == sbi->zone_max) + wnd_zone_set(wnd, lcn, zlen); } else { CLST zone_lcn = wnd_zone_bit(wnd); -- 2.37.0