Skip to contentSkip to conversation

fs/ntfs3: Keep prealloc for all types of files

PATCH Superseded Konstantin Komarov 2 participants 2 messages Oct 1, 2021 – Oct 3, 2021

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Konstantin Komarov

author maintainer
#0 lore raw

PATCH 1/1 fs/ntfs3: Keep prealloc for all types of files

Fixes xfstest generic/274
---
 fs/ntfs3/attrib.c | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)
fs/ntfs3/attrib.c +1 -7
index 8a00fa978f5f..e8c00dda42ad 100644
@@ -447,11 +447,8 @@ int attr_set_size(struct ntfs_inode *ni, enum ATTR_TYPE type,
 again_1:
 	align = sbi->cluster_size;
 
-	if (is_ext) {
+	if (is_ext)
 		align <<= attr_b->nres.c_unit;
-		if (is_attr_sparsed(attr_b))
-			keep_prealloc = false;
-	}
 
 	old_valid = le64_to_cpu(attr_b->nres.valid_size);
 	old_size = le64_to_cpu(attr_b->nres.data_size);
@@ -461,9 +458,6 @@ int attr_set_size(struct ntfs_inode *ni, enum ATTR_TYPE type,
 	new_alloc = (new_size + align - 1) & ~(u64)(align - 1);
 	new_alen = new_alloc >> cluster_bits;
 
-	if (keep_prealloc && is_ext)
-		keep_prealloc = false;
-
 	if (keep_prealloc && new_size < old_size) {
 		attr_b->nres.data_size = cpu_to_le64(new_size);
 		mi_b->dirty = true;
Signature · 1 line
2.33.0
#1 lore raw
Quoted 1 line · Konstantin Komarov
Fixes xfstest generic/274

I would always hope at least couple sentence to commit message. It would be easier if you do this in first place and I do not need to ask it everytime. Again I'm straight away thinking why this was done this way in a first place. There has to be reason. Was that reason totally wrong in a first place? Does this patch has some drawbacks? Quick look it looks it might have, but please write about it so reviewer job is little easier and we get more meaningfull history.

This also again needs fixes tag with prober commit id as this seems like a bug if this fix xfstests case.

Quoted 35 lines
---
 fs/ntfs3/attrib.c | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)
fs/ntfs3/attrib.c +1 -7
index 8a00fa978f5f..e8c00dda42ad 100644
@@ -447,11 +447,8 @@ int attr_set_size(struct ntfs_inode *ni, enum ATTR_TYPE type,
 again_1:
 	align = sbi->cluster_size;
 
-	if (is_ext) {
+	if (is_ext)
 		align <<= attr_b->nres.c_unit;
-		if (is_attr_sparsed(attr_b))
-			keep_prealloc = false;
-	}
 
 	old_valid = le64_to_cpu(attr_b->nres.valid_size);
 	old_size = le64_to_cpu(attr_b->nres.data_size);
@@ -461,9 +458,6 @@ int attr_set_size(struct ntfs_inode *ni, enum ATTR_TYPE type,
 	new_alloc = (new_size + align - 1) & ~(u64)(align - 1);
 	new_alen = new_alloc >> cluster_bits;
 
-	if (keep_prealloc && is_ext)
-		keep_prealloc = false;
-
 	if (keep_prealloc && new_size < old_size) {
 		attr_b->nres.data_size = cpu_to_le64(new_size);
 		mi_b->dirty = true;
Signature · 1 line
2.33.0