f2fs: allow compression of files without blocks
PATCH v2 1/1 f2fs: allow compression of files without blocks
From: Chao Liu <[email protected]>
Files created by truncate(1) have a size but no blocks, so they can be allowed to enable compression.
---
v2:
- update commit message: truncate -> truncate(1)
fs/f2fs/file.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
fs/f2fs/file.c +1 -1
@@ -1879,7 +1879,7 @@ static int f2fs_setflags_common(struct inode *inode, u32 iflags, u32 mask)if (iflags &F2FS_COMPR_FL ) {if (!f2fs_may_compress (inode))return -EINVAL ; -if (S_ISREG (inode->i_mode) && inode->i_size) +if (S_ISREG (inode->i_mode) &&F2FS_HAS_BLOCKS (inode))return -EINVAL ;set_compress_context (inode);
--
2.36.1
Quoted 6 lines · Chao Liu
From: Chao Liu <[email protected]>
Files created by truncate(1) have a size but no blocks, so they can be allowed to enable compression.
Signed-off-by Chao Liu <[email protected]>
Thanks,
Jaegeuk Kim
maintainerQuoted 18 lines · Chao Liu
From: Chao Liu <[email protected]>
Files created by truncate(1) have a size but no blocks, so they can be allowed to enable compression.
Signed-off-by Chao Liu <[email protected]>---
v2:
- update commit message: truncate -> truncate(1)fs/f2fs/file.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)fs/f2fs/file.c +0
-0
fs/f2fs/file.c static int f2fs_setflags_common(struct inode *inode, u32 iflags, u32 mask) · line 1882
Quoted 5 lines
fs/f2fs/file.c +1
-1@@ -1879,7 +1879,7 @@ static int f2fs_setflags_common(struct inode *inode, u32 iflags, u32 mask)if (iflags &F2FS_COMPR_FL ) {if (!f2fs_may_compress (inode))return -EINVAL ; -if (S_ISREG (inode->i_mode) && inode->i_size) +if (S_ISREG (inode->i_mode) &&F2FS_HAS_BLOCKS (inode))
What about inline_data case?
Quoted 5 lines
fs/f2fs/file.c +0
-1return -EINVAL ;set_compress_context (inode); --2.36.1
Chao Yu
maintainerQuoted 14 lines · Jaegeuk Kim
Quoted 13 lines · Chao Liu
From: Chao Liu <[email protected]>
Files created by truncate(1) have a size but no blocks, so they can be allowed to enable compression.
Signed-off-by Chao Liu <[email protected]>---
v2:
- update commit message: truncate -> truncate(1)fs/f2fs/file.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Quoted 12 lines
fs/f2fs/file.c static int f2fs_setflags_common(struct inode *inode, u32 iflags, u32 mask) · line 1882
Quoted 10 lines
fs/f2fs/file.c +1
-1@@ -1879,7 +1879,7 @@ static int f2fs_setflags_common(struct inode *inode, u32 iflags, u32 mask)if (iflags &F2FS_COMPR_FL ) {if (!f2fs_may_compress (inode))return -EINVAL ; -if (S_ISREG (inode->i_mode) && inode->i_size) +if (S_ISREG (inode->i_mode) &&F2FS_HAS_BLOCKS (inode))What about
inline_datacase?
How about fixing this w/ a separated patch?
f2fs: fix to check inline_data during compressed inode conversion
Thanks,
Quoted 6 lines
Quoted 6 lines
fs/f2fs/file.c +0
-1return -EINVAL ;set_compress_context (inode); --2.36.1