f2fs: compress: allow write compress released file after truncate to zero
PATCH 1/1 f2fs: compress: allow write compress released file after truncate to zero
We should allow write compress released file after truncate to zero.
--- fs/f2fs/file.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
fs/f2fs/file.c +5 -1
@@ -730,9 +730,13 @@ int f2fs_truncate_blocks(struct inode *inode, u64 from, bool lock)* for compressed file, only support cluster size * aligned truncation. */ -if (f2fs_compressed_file (inode)) +if (f2fs_compressed_file (inode)) { free_from =round_up (from,F2FS_I (inode)->i_cluster_size <<PAGE_SHIFT ); +if (!free_from) +clear_inode_flag (inode,FI_COMPRESS_RELEASED ); + } +#endif err =f2fs_do_truncate_blocks (inode, free_from, lock);
Signature · 8 lines
2.29.0 _______________________________________________ Linux-f2fs-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
Jaegeuk Kim
maintainerQuoted 12 lines · Fengnan Chang
We should allow write compress released file after truncate to zero.
Signed-off-by Fengnan Chang <[email protected]>--- fs/f2fs/file.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)fs/f2fs/file.c +0
-0
fs/f2fs/file.c int f2fs_truncate_blocks(struct inode *inode, u64 from, bool lock) · line 737
Quoted 9 lines
fs/f2fs/file.c +3
-1@@ -730,9 +730,13 @@ int f2fs_truncate_blocks(struct inode *inode, u64 from, bool lock)* for compressed file, only support cluster size * aligned truncation. */ -if (f2fs_compressed_file (inode)) +if (f2fs_compressed_file (inode)) { free_from =round_up (from,F2FS_I (inode)->i_cluster_size <<PAGE_SHIFT ); +if (!free_from) +clear_inode_flag (inode,FI_COMPRESS_RELEASED );
We can do after truncating all the blocks successfully?
Quoted 7 lines
fs/f2fs/file.c +2
-0+ } +#endif err =f2fs_do_truncate_blocks (inode, free_from, lock);Signature · 1 line
2.29.0
_______________________________________________
Linux-f2fs-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
Chao Yu
maintainerQuoted 8 lines · Jaegeuk Kim
Quoted 7 lines · Fengnan Chang
We should allow write compress released file after truncate to zero.
Signed-off-by Fengnan Chang <[email protected]>--- fs/f2fs/file.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
Quoted 16 lines
Quoted 5 lines
fs/f2fs/file.c +0
-0fs/f2fs/file.c int f2fs_truncate_blocks(struct inode *inode, u64 from, bool lock) · line 737
Quoted 9 lines
fs/f2fs/file.c +3
-1@@ -730,9 +730,13 @@ int f2fs_truncate_blocks(struct inode *inode, u64 from, bool lock)* for compressed file, only support cluster size * aligned truncation. */ -if (f2fs_compressed_file (inode)) +if (f2fs_compressed_file (inode)) { free_from =round_up (from,F2FS_I (inode)->i_cluster_size <<PAGE_SHIFT ); +if (!free_from) +clear_inode_flag (inode,FI_COMPRESS_RELEASED );We can do after truncating all the blocks successfully?
Agreed, but please document this behavior as well.
Thanks,
Quoted 8 lines
Quoted 8 lines
fs/f2fs/file.c +2
-0+ } +#endif err =f2fs_do_truncate_blocks (inode, free_from, lock);Signature · 1 line
2.29.0
_______________________________________________
Linux-f2fs-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel