summaryrefslogtreecommitdiffstats
path: root/fs/ntfs3/inode.c
diff options
context:
space:
mode:
authorKonstantin Komarov <almaz.alexandrovich@paragon-software.com>2022-10-07 13:02:36 +0200
committerKonstantin Komarov <almaz.alexandrovich@paragon-software.com>2022-11-14 17:50:44 +0100
commitc380b52f6c5702cc4bdda5e6d456d6c19a201a0b (patch)
tree848954c6bdf31ae31a7fb675c9309909fa5a7f73 /fs/ntfs3/inode.c
parentfs/ntfs3: Fixing work with sparse clusters (diff)
downloadlinux-c380b52f6c5702cc4bdda5e6d456d6c19a201a0b.tar.xz
linux-c380b52f6c5702cc4bdda5e6d456d6c19a201a0b.zip
fs/ntfs3: Change new sparse cluster processing
Remove ntfs_sparse_cluster. Zero clusters in attr_allocate_clusters. Fixes xfstest generic/263 Signed-off-by: Konstantin Komarov <almaz.alexandrovich@paragon-software.com>
Diffstat (limited to 'fs/ntfs3/inode.c')
-rw-r--r--fs/ntfs3/inode.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/fs/ntfs3/inode.c b/fs/ntfs3/inode.c
index d8d00ffe7a1f..bf56e78de653 100644
--- a/fs/ntfs3/inode.c
+++ b/fs/ntfs3/inode.c
@@ -577,7 +577,8 @@ static noinline int ntfs_get_block_vbo(struct inode *inode, u64 vbo,
off = vbo & sbi->cluster_mask;
new = false;
- err = attr_data_get_block(ni, vcn, 1, &lcn, &len, create ? &new : NULL);
+ err = attr_data_get_block(ni, vcn, 1, &lcn, &len, create ? &new : NULL,
+ create && sbi->cluster_size > PAGE_SIZE);
if (err)
goto out;
@@ -595,11 +596,8 @@ static noinline int ntfs_get_block_vbo(struct inode *inode, u64 vbo,
WARN_ON(1);
}
- if (new) {
+ if (new)
set_buffer_new(bh);
- if ((len << cluster_bits) > block_size)
- ntfs_sparse_cluster(inode, page, vcn, len);
- }
lbo = ((u64)lcn << cluster_bits) + off;
@@ -1537,8 +1535,8 @@ struct inode *ntfs_create_inode(struct user_namespace *mnt_userns,
cpu_to_le64(ntfs_up_cluster(sbi, nsize));
err = attr_allocate_clusters(sbi, &ni->file.run, 0, 0,
- clst, NULL, 0, &alen, 0,
- NULL);
+ clst, NULL, ALLOCATE_DEF,
+ &alen, 0, NULL, NULL);
if (err)
goto out5;