[PATCH] fs/ntfs3: use MAX_LFS_FILESIZE for maxbytes with 64-bit clusters

Konstantin Komarov posted 1 patch 3 weeks, 1 day ago
fs/ntfs3/super.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
[PATCH] fs/ntfs3: use MAX_LFS_FILESIZE for maxbytes with 64-bit clusters
Posted by Konstantin Komarov 3 weeks, 1 day ago
When CONFIG_NTFS3_64BIT_CLUSTER is enabled and the cluster count
saturates the 64-bit VCN space, ntfs_init_from_boot() sets
sbi->maxbytes to -1, while maxbytes_sparse and s_maxbytes are both
set to MAX_LFS_FILESIZE just below.

Set maxbytes to MAX_LFS_FILESIZE so all three limits agree.

Signed-off-by: Konstantin Komarov <almaz.alexandrovich@paragon-software.com>
---
 fs/ntfs3/super.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/ntfs3/super.c b/fs/ntfs3/super.c
index f4a42a0c73a4..d3093f72ea38 100644
--- a/fs/ntfs3/super.c
+++ b/fs/ntfs3/super.c
@@ -1210,7 +1210,7 @@ static int ntfs_init_from_boot(struct super_block *sb, u32 sector_size,
 
 #ifdef CONFIG_NTFS3_64BIT_CLUSTER
 	if (clusters >= (1ull << (64 - cluster_bits)))
-		sbi->maxbytes = -1;
+		sbi->maxbytes = MAX_LFS_FILESIZE;
 	sbi->maxbytes_sparse = MAX_LFS_FILESIZE;
 	sb->s_maxbytes = MAX_LFS_FILESIZE;
 #else
-- 
2.43.0