From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pj2-f42.google.com (mail-pj2-f42.google.com [74.125.227.170]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B07A735E1BA for ; Thu, 1 Oct 2026 14:49:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=74.125.227.170 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1790866194; cv=none; b=bWB2wCVdQIt2zIMXh/OvriYncyvjFtjy3LrfaQm/n2H8nMXk0VXjSLGFnG1blAuRrsDsHcXvYazN4EaQTzOy52YuiIC0WtT/YnWJpnL3tHTQVoesaIBv7IUQe2l1lKQ9GAX28BBrnvSpC1th/iyYhHRMs99/sC3RnFYhnzQqqgs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1790866194; c=relaxed/simple; bh=ERxfbW3SLmn3MJiIEH2RCTtXQiqkLAFMno7w5RJW/AY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=bwWyeECjnwCxM5VnV6IJlNiQKj3kRBVPwwf4qmzEI6l7e06RRhe2L+CC35RNXVlAO+ZusuND1qoRK+LKh0gcI7ncYlSCE2W1QoFVKNaW59zdiVChnJD56keho75dpKUZD85wtyhdEJiEflWpKmV9Ajw64KnA/5SXA2X8UEU+oEI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=BIHyKK4U; arc=none smtp.client-ip=74.125.227.170 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="BIHyKK4U" Received: by mail-pj2-f42.google.com with SMTP id d9443c01a7336-2df4aa80a73so43755235ad.3 for ; Thu, 01 Oct 2026 07:49:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1790866189; x=1791470989; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=1zULKRtuPS5k7AM5/JLrNzrwWExGeWJhTe+kTdy8fnM=; b=BIHyKK4UzHJNJErFcuTYR9ymcFFepKFqUH/td31EjG3yO0qLy+pc/ePA90ISK+kzi1 vnunaR1NAGTZP42MbZgenhRjr+BMMrYvLInCZR06XYnbZUkM0FspPxGmOdgr2c05jmnm 1PjetxS4FcROxLh38ndv1FNelDfOEjQCVtVFt2FEqXGOo54rynBys1/vUL1123IBYaQs uDuiOeqzgAz+Kj8WQb7Lszvq86UPzBaipit58r9nDmGxCgfYWZKqVEWrdj3j0I56voYO WuIt6QvuLy4q3UUTirgMN57YxRxLX5EggGocV9n9+0EsxOc/15aHr6GkcYmonYrl5bXg jaqQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1790866189; x=1791470989; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=1zULKRtuPS5k7AM5/JLrNzrwWExGeWJhTe+kTdy8fnM=; b=DukarIwWtOiFnvzqxQ3v+ygA7WRsneNNaZoiZ6m8zKf9L7OajiiwMcg6vevO4tegTm I6bFJV16XvmWUHVGlHHcqDyS6rx4wiXg6l0L4JTDKhBTWuJXvTumorl6IxU7ObY5th2m gm0yrGCdJT7iEd2sIjwqmsQ36z5MLqSNmYN+88u7B6aogBx2mMI4Kk0pWUviJgQso5mU Zbf5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:c988 with SMTP id d9443c01a7336-2e2e4b48e34mr40167755ad.32.1790866189323; Thu, 01 Oct 2026 07:49:49 -0700 (PDT) Received: from spider.bream-herring.ts.net ([103.6.151.236]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2e317cd0624sm6636775ad.30.2026.10.01.07.49.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 01 Oct 2026 07:49:48 -0700 (PDT) From: Matthias Goergens To: Namjae Jeon , Hyunchul Lee Cc: Baolin Liu , liubaolin , ntfs@lists.linux.dev, linux-kernel@vger.kernel.org Subject: [PATCH v2 3/3] ntfs: do not refuse fallocate() when the MFT zone is empty Date: Thu, 1 Oct 2026 22:49:38 +0800 Message-ID: <17b1ff77bafd136d170c23f34610d06cd684c490.1790853718.git.matthias.goergens@gmail.com> X-Mailer: git-send-email 2.56.0 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit ntfs_fallocate() fails with -ENOSPC whenever the MFT zone has shrunk to nothing. The cluster allocator gives the MFT zone up when it cannot find free clusters elsewhere, and nothing restores it before the next mount, so after one such failure every fallocate() on the volume fails with ENOSPC, punching holes included, however much space is freed. The allocator failure fixed by the previous patch was enough to get there: afterwards a one-cluster fallocate() failed with ENOSPC while 123 MiB of the 128 MiB volume were free. write() and truncate() do not look at the MFT zone, and ntfs_allocate_range() already fails with -ENOSPC when too few clusters are free. Remove the check. Fixes: 9c87959601e8 ("ntfs: update file operations") Signed-off-by: Matthias Goergens Reviewed-by: Baolin Liu --- fs/ntfs/file.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/fs/ntfs/file.c b/fs/ntfs/file.c index 3ec82715a588..762045d26296 100644 --- a/fs/ntfs/file.c +++ b/fs/ntfs/file.c @@ -1163,9 +1163,6 @@ static long ntfs_fallocate(struct file *file, int mode, loff_t offset, loff_t le if (!NVolFreeClusterKnown(vol)) wait_event(vol->free_waitq, NVolFreeClusterKnown(vol)); - if ((ni->vol->mft_zone_end - ni->vol->mft_zone_start) == 0) - return -ENOSPC; - if (NInoNonResident(ni) && !NInoFullyMapped(ni)) { down_write(&ni->runlist.lock); err = ntfs_attr_map_whole_runlist(ni); -- 2.56.0