[f2fs-dev] [PATCH v5 7/8] fsck: Check write pointer consistency of open zones

2019-10-17 Thread Shin'ichiro Kawasaki
On sudden f2fs shutdown, write pointers of zoned block devices can go further but f2fs meta data keeps current segments at positions before the write operations. After remounting the f2fs, this inconsistency causes write operations not at write pointers and "Unaligned write command" error is report

[f2fs-dev] [PATCH v5 2/8] libf2fs_zoned: Introduce f2fs_report_zone() helper function

2019-10-17 Thread Shin'ichiro Kawasaki
To prepare for write pointer consistency check by fsck, add f2fs_report_zone() helper function which calls REPORT ZONE command to get write pointer status of a single zone. The function is added to lib/libf2fs_zoned which gathers zoned block device related functions. Signed-off-by: Shin'ichiro Kaw

[PATCH v2] f2fs: fix to avoid memory leakage in f2fs_listxattr

2019-10-17 Thread Randall Huang
In f2fs_listxattr, there is no boundary check before memcpy e_name to buffer. If the e_name_len is corrupted, unexpected memory contents may be returned to the buffer. Signed-off-by: Randall Huang --- v2: relocate sanity check --- fs/f2fs/xattr.c | 14 +- 1 file changed, 13 insertion

Re: [f2fs-dev] [PATCH v4 2/2] fsck.f2fs: Check write pointer consistency with current segments

2019-10-17 Thread Shinichiro Kawasaki
On Oct 02, 2019 / 14:30, Shin'ichiro Kawasaki wrote: > Now I'm preparing patches for fsck as well as kernel based on the valuable > and detailed e-mail discussion between you and me. Here I summarize my I have posted the two patch series to add write pointer consistency check, based on the discuss

[f2fs-dev] [PATCH 0/2] f2fs: Check write pointers of zoned block devices

2019-10-17 Thread Shin'ichiro Kawasaki
On sudden f2fs shutdown, zoned block device status and f2fs meta data can be inconsistent. When f2fs shutdown happens during write operations, write pointers on the device go forward but the f2fs meta data does not reflect the write pointer progress. This inconsistency will eventually cause "Unalig

[f2fs-dev] [PATCH 2/2] f2fs: Check write pointer consistency of non-open zones

2019-10-17 Thread Shin'ichiro Kawasaki
To catch f2fs bugs in write pointer handling code for zoned block devices, check write pointers of non-open zones that current segments do not point to. Do this check at mount time, after the fsync data recovery and current segments' write pointer consistency fix. Check two items comparing write po

[f2fs-dev] [PATCH 1/2] f2fs: Check write pointer consistency of open zones

2019-10-17 Thread Shin'ichiro Kawasaki
On sudden f2fs shutdown, write pointers of zoned block devices can go further but f2fs meta data keeps current segments at positions before the write operations. After remounting the f2fs, this inconsistency causes write operations not at write pointers and "Unaligned write command" error is report