On 2022/6/15 7:17, Bart Van Assche wrote:
The definition of struct blk_zone_report is as follows:struct blk_zone_report { __u64 sector; __u32 nr_zones; __u32 flags; struct blk_zone zones[0]; }; Since f2fs_report_zone() allocates the above data structure with malloc() and since f2fs_report_zone() only initializes the sector and nr_zones members, the flags member is not initialized. Modify f2fs_report_zone() such that 0 is passed as flags to the BLKREPORTZONE ioctl instead of a random value. This has been discovered by reading the source code. Cc: Shin'ichiro Kawasaki <[email protected]> Fixes: 6d7c7b785feb ("libf2fs_zoned: Introduce f2fs_report_zone() helper function") Signed-off-by: Bart Van Assche <[email protected]>
Reviewed-by: Chao Yu <[email protected]> Thanks, _______________________________________________ Linux-f2fs-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
