[f2fs-dev] [PATCH] f2fs_io: add do_clearflags to clear nocompress/compress flag

2023-08-15 Thread Qi Han via Linux-f2fs-devel
To align f2fs_io functionality with chattr +/-c and +/-m, the do_clearflags function has been added to clear the FS_COMPR_FL and FS_NOCOMP_FL flags. Signed-off-by: Qi Han --- man/f2fs_io.8 | 4 tools/f2fs_io/f2fs_io.c | 37 + 2 files changed, 4

[f2fs-dev] [PATCH] f2fs_io: add do_clearflags to clear nocompress/compress flag

2023-08-17 Thread Qi Han via Linux-f2fs-devel
To align f2fs_io functionality with chattr +/-c and +/-m, the do_clearflags function has been added to clear the FS_COMPR_FL and FS_NOCOMP_FL flags. Signed-off-by: Qi Han --- man/f2fs_io.8 | 4 tools/f2fs_io/f2fs_io.c | 37 + 2 files changed, 4

[f2fs-dev] [PATCH] f2fs: remove unnessary comment in __may_age_extent_tree

2023-04-17 Thread Qi Han via Linux-f2fs-devel
This comment make no sense and is in the wrong place, so let's remove it. Signed-off-by: Qi Han --- fs/f2fs/extent_cache.c | 1 - 1 file changed, 1 deletion(-) diff --git a/fs/f2fs/extent_cache.c b/fs/f2fs/extent_cache.c index 28b12553f2b3..1f6d7de35794 100644 --- a/fs/f2fs/extent_cache.c +++ b

[f2fs-dev] [PATCH] f2fs: move wrong comment to right place in __may_age_extent_tree

2023-04-20 Thread Qi Han via Linux-f2fs-devel
This code is commented in the wrong place, let's move it to the right place. Signed-off-by: Qi Han --- fs/f2fs/extent_cache.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/f2fs/extent_cache.c b/fs/f2fs/extent_cache.c index 28b12553f2b3..0ad769a822ac 100644 --- a/fs/f2fs/

[f2fs-dev] [PATCH] f2fs: allows setting compress option to files which marked with FI_MMAP_FILE

2023-05-24 Thread Qi Han via Linux-f2fs-devel
Allow to compress mmap files in commit e3c548323d32 ("f2fs: let's allow compression for mmap files"). However, we cannot set the compress option to the mmap file. To keep the same concept in both compress_modes, f2fs_ioc_set_compress_option should also allow it. Let's remove checking mmap files in

[f2fs-dev] [PATCH] f2fs: modify f2fs_is_checkpoint_ready logic to allow more data to be written with the CP disable

2024-10-09 Thread Qi Han via Linux-f2fs-devel
When the free segment is used up during CP disable, many write or ioctl operations will get ENOSPC error codes, even if there are still many blocks available. We can reproduce it in the following steps: dd if=/dev/zero of=f2fs.img bs=1M count=55 mkfs.f2fs -f f2fs.img mount f2fs.img f2fs_dir -o che

[f2fs-dev] [PATCH v3] f2fs: modify f2fs_is_checkpoint_ready logic to allow more data to be written with the CP disable

2024-10-22 Thread Qi Han via Linux-f2fs-devel
When the free segment is used up during CP disable, many write or ioctl operations will get ENOSPC error codes, even if there are still many blocks available. We can reproduce it in the following steps: dd if=/dev/zero of=f2fs.img bs=1M count=65 mkfs.f2fs -f f2fs.img mount f2fs.img f2fs_dir -o che

[f2fs-dev] [PATCH v2] f2fs: modify f2fs_is_checkpoint_ready logic to allow more data to be written with the CP disable

2024-10-22 Thread Qi Han via Linux-f2fs-devel
When the free segment is used up during CP disable, many write or ioctl operations will get ENOSPC error codes, even if there are still many blocks available. We can reproduce it in the following steps: dd if=/dev/zero of=f2fs.img bs=1M count=65 mkfs.f2fs -f f2fs.img mount f2fs.img f2fs_dir -o che

[f2fs-dev] [PATCH] f2fs: compress: fix inconsistent update of i_blocks in release_compress_blocks and reserve_compress_blocks

2024-09-28 Thread Qi Han via Linux-f2fs-devel
After release a file and subsequently reserve it, the FSCK flag is set when the file is deleted, as shown in the following backtrace: F2FS-fs (dm-48): Inconsistent i_blocks, ino:401231, iblocks:1448, sectors:1472 fs_rec_info_write_type+0x58/0x274 f2fs_rec_info_write+0x1c/0x2c set_sbi_flag+0x74/0x9

[f2fs-dev] [PATCH v2] f2fs: compress: fix inconsistent update of i_blocks in release_compress_blocks and reserve_compress_blocks

2024-09-29 Thread Qi Han via Linux-f2fs-devel
After release a file and subsequently reserve it, the FSCK flag is set when the file is deleted, as shown in the following backtrace: F2FS-fs (dm-48): Inconsistent i_blocks, ino:401231, iblocks:1448, sectors:1472 fs_rec_info_write_type+0x58/0x274 f2fs_rec_info_write+0x1c/0x2c set_sbi_flag+0x74/0x9

[f2fs-dev] [PATCH] f2fs: fix f2fs_bug_on when uninstalling filesystem call f2fs_evict_inode.

2024-09-18 Thread Qi Han via Linux-f2fs-devel
creating a large files during checkpoint disable until it runs out of space and then delete it, then remount to enable checkpoint again, and then unmount the filesystem triggers the f2fs_bug_on as below: [ cut here ] kernel BUG at fs/f2fs/inode.c:896! CPU: 2 UID: 0 PID: 128

[f2fs-dev] [PATCH v4] f2fs: modify f2fs_is_checkpoint_ready logic to allow more data to be written with the CP disable

2024-10-25 Thread Qi Han via Linux-f2fs-devel
When the free segment is used up during CP disable, many write or ioctl operations will get ENOSPC error codes, even if there are still many blocks available. We can reproduce it in the following steps: dd if=/dev/zero of=f2fs.img bs=1M count=65 mkfs.f2fs -f f2fs.img mount f2fs.img f2fs_dir -o che

[f2fs-dev] [PATCH] f2fs: f2fs supports uncached buffered I/O

2025-07-15 Thread Qi Han via Linux-f2fs-devel
Jens has already completed the development of uncached buffered I/O in git [1], and in f2fs, the feature can be enabled simply by setting the FOP_DONTCACHE flag in f2fs_file_operations. [1] https://lore.kernel.org/all/20241220154831.1086649-10-ax...@kernel.dk/T/#m58520a94b46f543d82db3711453dfc7bb5

[f2fs-dev] [PATCH] f2fs: f2fs supports uncached buffered I/O read

2025-07-25 Thread Qi Han via Linux-f2fs-devel
Jens has already completed the development of uncached buffered I/O in git [1], and in f2fs, uncached buffered I/O read can be enabled simply by setting the FOP_DONTCACHE flag in f2fs_file_operations. I have been testing a use case locally, which aligns with Jens' test case [2]. In the read scenar

[f2fs-dev] [PATCH] f2fs: remove unnecessary error checks

2025-08-01 Thread Qi Han via Linux-f2fs-devel
Commit 5cdf5b03 ("f2fs: remove unnecessary null checking") removed the null pointer check for bio in f2fs_grab_read_bio(), meaning f2fs_grab_read_bio() will not return any errors. Therefore, let's remove the remaining error handling code. Fixes: 5cdf5b03 ("f2fs: remove unnecessary null che

[f2fs-dev] [RFC PATCH] f2fs: f2fs support uncached buffer I/O read and write

2025-08-28 Thread Qi Han via Linux-f2fs-devel
In the link [1], we adapted uncached buffer I/O read support in f2fs. Now, let's move forward to enabling uncached buffer I/O write support in f2fs. In f2fs_write_end_io, a separate asynchronous workqueue is created to perform the page drop operation for bios that contain pages of type FGP_DONTCAC