linux-stable/fs/f2fs
Sheng Yong dbeca41557 f2fs: UBSAN: set boolean value iostat_enable correctly
[ Upstream commit ac92985864 ]

When setting /sys/fs/f2fs/<DEV>/iostat_enable with non-bool value, UBSAN
reports the following warning.

[ 7562.295484] ================================================================================
[ 7562.296531] UBSAN: Undefined behaviour in fs/f2fs/f2fs.h:2776:10
[ 7562.297651] load of value 64 is not a valid value for type '_Bool'
[ 7562.298642] CPU: 1 PID: 7487 Comm: dd Not tainted 4.20.0-rc4+ #79
[ 7562.298653] Hardware name: innotek GmbH VirtualBox/VirtualBox, BIOS VirtualBox 12/01/2006
[ 7562.298662] Call Trace:
[ 7562.298760]  dump_stack+0x46/0x5b
[ 7562.298811]  ubsan_epilogue+0x9/0x40
[ 7562.298830]  __ubsan_handle_load_invalid_value+0x72/0x90
[ 7562.298863]  f2fs_file_write_iter+0x29f/0x3f0
[ 7562.298905]  __vfs_write+0x115/0x160
[ 7562.298922]  vfs_write+0xa7/0x190
[ 7562.298934]  ksys_write+0x50/0xc0
[ 7562.298973]  do_syscall_64+0x4a/0xe0
[ 7562.298992]  entry_SYSCALL_64_after_hwframe+0x44/0xa9
[ 7562.299001] RIP: 0033:0x7fa45ec19c00
[ 7562.299004] Code: 73 01 c3 48 8b 0d 88 92 2c 00 f7 d8 64 89 01 48 83 c8 ff c3 66 0f 1f 44 00 00 83 3d dd eb 2c 00 00 75 10 b8 01 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 31 c3 48 83 ec 08 e8 ce 8f 01 00 48 89 04 24
[ 7562.299044] RSP: 002b:00007ffca52b49e8 EFLAGS: 00000246 ORIG_RAX: 0000000000000001
[ 7562.299052] RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007fa45ec19c00
[ 7562.299059] RDX: 0000000000000400 RSI: 000000000093f000 RDI: 0000000000000001
[ 7562.299065] RBP: 000000000093f000 R08: 0000000000000004 R09: 0000000000000000
[ 7562.299071] R10: 00007ffca52b47b0 R11: 0000000000000246 R12: 0000000000000400
[ 7562.299077] R13: 000000000093f000 R14: 000000000093f400 R15: 0000000000000000
[ 7562.299091] ================================================================================

So, if iostat_enable is enabled, set its value as true.

Signed-off-by: Sheng Yong <shengyong1@huawei.com>
Reviewed-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2019-04-05 22:33:14 +02:00
..
acl.c f2fs: fix wrong return value of f2fs_acl_create 2019-02-12 19:47:02 +01:00
acl.h
checkpoint.c f2fs: fix to flush all dirty inodes recovered in readonly fs 2018-11-13 11:08:38 -08:00
data.c f2fs: fix race between write_checkpoint and write_begin 2019-02-12 19:47:02 +01:00
debug.c f2fs: Allocate and stat mem used by free nid bitmap more accurately 2018-07-28 18:23:26 -07:00
dir.c f2fs: rework fault injection handling to avoid a warning 2018-08-14 09:49:15 -07:00
extent_cache.c f2fs: avoid sleeping under spin_lock 2018-11-13 11:08:37 -08:00
f2fs.h f2fs: fix to check inline_xattr_size boundary correctly 2019-04-05 22:32:59 +02:00
file.c f2fs: wait on atomic writes to count F2FS_CP_WB_DATA 2019-03-19 13:12:41 +01:00
gc.c f2fs: readahead encrypted block during GC 2018-08-20 23:13:42 -07:00
gc.h f2fs: introduce sbi->gc_mode to determine the policy 2018-05-31 11:31:51 -07:00
hash.c
inline.c f2fs: fix to avoid deadlock in f2fs_read_inline_dir() 2019-04-05 22:32:56 +02:00
inode.c f2fs: fix to recover cold bit of inode block during POR 2018-11-13 11:08:39 -08:00
Kconfig fs/*/Kconfig: drop links to 404-compliant http://acl.bestbits.at 2018-01-01 12:45:37 -07:00
Makefile
namei.c f2fs: Replace strncpy with memcpy 2018-07-28 18:26:08 -07:00
node.c f2fs: read page index before freeing 2019-01-09 17:38:46 +01:00
node.h f2fs: let checkpoint flush dnode page of regular 2018-08-01 11:52:36 -07:00
recovery.c f2fs: fix to flush all dirty inodes recovered in readonly fs 2018-11-13 11:08:38 -08:00
segment.c f2fs: fix to avoid deadlock of atomic file operations 2019-03-27 14:14:42 +09:00
segment.h f2fs: avoid fi->i_gc_rwsem[WRITE] lock in f2fs_gc 2018-08-20 23:13:42 -07:00
shrinker.c f2fs: fix sbi->extent_list corruption issue 2019-02-12 19:47:17 +01:00
super.c f2fs: fix to check inline_xattr_size boundary correctly 2019-04-05 22:32:59 +02:00
sysfs.c f2fs: UBSAN: set boolean value iostat_enable correctly 2019-04-05 22:33:14 +02:00
trace.c f2fs: do not use mutex lock in atomic context 2019-04-05 22:32:59 +02:00
trace.h
xattr.c f2fs: fix to adapt small inline xattr space in __find_inline_xattr() 2019-04-05 22:32:55 +02:00
xattr.h