From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pz2-f36.google.com (mail-pz2-f36.google.com [74.125.228.36]) (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 6FCB53F1045 for ; Sun, 4 Oct 2026 09:56:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=74.125.228.36 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1791107783; cv=none; b=TYAQrfx4mW+DDet6it6kvq5th457nJxRxcjW5zAL1iOMcDe2wOzqy//FgxbHymXPQix52nzm3OJkoc2mnO96UHqvIruQJo4W1/PJusTONrbm39Q+IDOmCqLfY49zIMMA6eC3gzm/VyWl2Dw5E3mfWDVdsCgcypWcDiy7dgSuzfk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1791107783; c=relaxed/simple; bh=Xkp8Ip3A8seD3miBA/ZSjvmtqN7r7RiaLWsa9arQrP4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=fgzj2unSHU4a4LkEN+0DNpA89Z5BRTS1F6zqdvM6yQvigB1EN3jV4dEnmZnq24A/q76b5tA1kAyrzN76JWmOQk8QX5q8o0ax/WizGSlYkNP5QkR31cIzgruUfx7YqXeuxQJtQZk3uBiC4VZl7SdpQD/waB2XL8dENnJUNlrL3h0= 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=R0DfNlQS; arc=none smtp.client-ip=74.125.228.36 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="R0DfNlQS" Received: by mail-pz2-f36.google.com with SMTP id d2e1a72fcca58-88a0f29ce98so292588b3a.3 for ; Sun, 04 Oct 2026 02:56:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1791107782; x=1791712582; 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=Sv3Xutg7k+QurrnMBqbS8TX2eZEovTI1Y5eV74+MZfw=; b=R0DfNlQSzkwjJg4UjxwRVcHfQ7CvsmiOa1uRIksI8ToPNMaph/EiM7trbAyii0Cryz SNy/OCbk4e9T7GmJWGqNjHjZgBb4Hg8kcAcprSkHFG8ePkD/xz2oY+KO7aH367Lq+i34 HEQ8DmM5fnPYmdpPTRgdNcu/pPTXY/vyeMv/jK8/azoEs4Jo6KWODFTVpsG0QABuRLoS NAzUHqmXIEkcn9ha5bgGKZ2sNCYeCRUhGboU+taj5sE2Hbd6HyZp0B9ZspAf6uhVQ2Nq LvdcVECq9tW7LUtjSUE8tn7WadkJYqlY+0IGh1waS9DOXc+y6KnZuQTDCIeorRGAz3e0 Zouw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1791107782; x=1791712582; 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=Sv3Xutg7k+QurrnMBqbS8TX2eZEovTI1Y5eV74+MZfw=; b=S3y0yYjmeU3YadlI3e0vq/X+cPKf5mSqI2MbCHAdt7Ory3+4ArX5HRbeLis6k5LGHO 4UrPVip0fzdgk7uf+qCFuuidU//s3dW0NyZXlF2IaxfUupxgW2WLCsmpGMptUCKpVZvy OLBLV6m5SuQ530dK+zraXtzh0cp9wVqJAaGqPFmL+xK0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aHi16cfUYPsk= X-Received: by 2002:a05:6a21:e10a:b0:3d3:adbf:7781 with SMTP id adf61e73a8af0-3e0bd17ecf2mr7842316637.22.1791107781655; Sun, 04 Oct 2026 02:56:21 -0700 (PDT) Received: from spider.bream-herring.ts.net ([103.6.151.236]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-88b0c3a39f6sm2418175b3a.28.2026.10.04.02.56.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 04 Oct 2026 02:56:19 -0700 (PDT) From: Matthias Goergens To: Namjae Jeon , Hyunchul Lee Cc: Baolin Liu , ntfs@lists.linux.dev, linux-kernel@vger.kernel.org Subject: [PATCH v3 3/4] ntfs: do not refuse fallocate() when the MFT zone is empty Date: Sun, 4 Oct 2026 17:56:07 +0800 Message-ID: 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 Reviewed-by: Hyunchul Lee --- 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