linux-stable/fs/f2fs
Chao Yu 82e93a8359 f2fs: fix to check extent cache in f2fs_drop_extent_tree
[ Upstream commit bf617f7a92 ]

If noextent_cache mount option is on, we will never initialize extent tree
in inode, but still we're going to access it in f2fs_drop_extent_tree,
result in kernel panic as below:

 BUG: unable to handle kernel NULL pointer dereference at 0000000000000038
 IP: _raw_write_lock+0xc/0x30
 Call Trace:
  ? f2fs_drop_extent_tree+0x41/0x70 [f2fs]
  f2fs_fallocate+0x5a0/0xdd0 [f2fs]
  ? common_file_perm+0x47/0xc0
  ? apparmor_file_permission+0x1a/0x20
  vfs_fallocate+0x15b/0x290
  SyS_fallocate+0x44/0x70
  do_syscall_64+0x6e/0x160
  entry_SYSCALL64_slow_path+0x25/0x25

This patch fixes to check extent cache status before using in
f2fs_drop_extent_tree.

Signed-off-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-05-30 07:52:33 +02:00
..
acl.c f2fs: preserve i_mode if __f2fs_set_acl() fails 2017-07-28 17:48:54 -07:00
acl.h f2fs: remove dead code f2fs_check_acl 2016-09-14 16:52:36 -07:00
checkpoint.c f2fs: fix to clear CP_TRIMMED_FLAG 2018-05-30 07:52:33 +02:00
data.c for-f2fs-4.14 2017-09-12 20:05:58 -07:00
debug.c f2fs: show available_nids in f2fs/status 2017-05-03 10:04:57 -07:00
dir.c f2fs: clear radix tree dirty tag of pages whose dirty flag is cleared 2017-09-11 21:32:38 -07:00
extent_cache.c f2fs: fix to check extent cache in f2fs_drop_extent_tree 2018-05-30 07:52:33 +02:00
f2fs.h f2fs: fix potential panic during fstrim 2017-10-03 08:06:05 -07:00
file.c f2fs: fix to set KEEP_SIZE bit in f2fs_zero_range 2018-05-30 07:52:33 +02:00
gc.c f2fs: avoid hungtask when GC encrypted block if io_bits is set 2018-04-26 11:02:09 +02:00
gc.h f2fs: fix potential overflow when adjusting GC cycle 2017-08-15 10:40:14 -07:00
hash.c f2fs: check entire encrypted bigname when finding a dentry 2017-05-04 11:44:35 -04:00
inline.c f2fs: clear radix tree dirty tag of pages whose dirty flag is cleared 2017-09-11 21:32:38 -07:00
inode.c f2fs: detect dirty inode in evict_inode 2017-09-12 10:02:39 -07:00
Kconfig
Makefile License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
namei.c do d_instantiate/unlock_new_inode combinations safely 2018-05-30 07:51:47 +02:00
node.c f2fs: don't check inode's checksum if it was dirtied or writebacked 2017-09-05 10:50:11 -07:00
node.h f2fs: simplify the way of calulating next nat address 2017-07-04 02:11:34 -07:00
recovery.c f2fs: check hot_data for roll-forward recovery 2017-08-21 15:55:06 -07:00
segment.c f2fs: fix heap mode to reset it back 2018-04-19 08:56:20 +02:00
segment.h f2fs: speed up gc_urgent mode with SSR 2017-09-11 17:22:18 -07:00
shrinker.c f2fs: avoid casted negative value as shrink count 2016-11-23 12:11:03 -08:00
super.c f2fs: fix potential panic during fstrim 2017-10-03 08:06:05 -07:00
sysfs.c f2fs: fix to show correct discard_granularity in sysfs 2017-09-12 10:02:47 -07:00
trace.c f2fs: use set_page_private marcro in f2fs_trace_pid 2017-03-24 15:10:49 -04:00
trace.h
xattr.c f2fs: avoid race in between read xattr & write xattr 2017-09-07 20:57:20 -07:00
xattr.h f2fs: guard macro variables with braces 2017-04-10 19:48:10 -07:00