f2fs-tools/lib
Bart Van Assche 92e2e52609 Fix f2fs_report_zone()
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 <shinichiro.kawasaki@wdc.com>
Fixes: 6d7c7b785f ("libf2fs_zoned: Introduce f2fs_report_zone() helper function")
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Reviewed-by: Chao Yu <chao@kernel.org>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
2022-07-21 19:27:03 -07:00
..
libf2fs_io.c libf2fs_io: add unused mactor to avoid build failure 2022-04-22 12:42:52 -07:00
libf2fs_zoned.c Fix f2fs_report_zone() 2022-07-21 19:27:03 -07:00
libf2fs.c Check fallthrough in mount.h for Mac 2022-05-25 17:14:03 -07:00
Makefile.am f2fs-tools: Add support for Casefolding 2019-08-27 14:51:05 -07:00
nls_utf8.c Remove unnecessary config.h 2022-05-25 15:40:30 -07:00
utf8data.h f2fs-tools: Add support for Casefolding 2019-08-27 14:51:05 -07:00