linux/fs/f2fs
Chao Yu dda9f4b9ca f2fs: fix to skip verifying block address for non-regular inode
generic/184 1s ... [failed, exit status 1]- output mismatch
    --- tests/generic/184.out	2015-01-11 16:52:27.643681072 +0800
     QA output created by 184 - silence is golden
    +rm: cannot remove '/mnt/f2fs/null': Bad address
    +mknod: '/mnt/f2fs/null': Bad address
    +chmod: cannot access '/mnt/f2fs/null': Bad address
    +./tests/generic/184: line 36: /mnt/f2fs/null: Bad address
    ...

F2FS-fs (zram0): access invalid blkaddr:259
EIP: f2fs_is_valid_blkaddr+0x14b/0x1b0 [f2fs]
 f2fs_iget+0x927/0x1010 [f2fs]
 f2fs_lookup+0x26e/0x630 [f2fs]
 __lookup_slow+0xb3/0x140
 lookup_slow+0x31/0x50
 walk_component+0x185/0x1f0
 path_lookupat+0x51/0x190
 filename_lookup+0x7f/0x140
 user_path_at_empty+0x36/0x40
 vfs_statx+0x61/0xc0
 __do_sys_stat64+0x29/0x40
 sys_stat64+0x13/0x20
 do_fast_syscall_32+0xaa/0x22c
 entry_SYSENTER_32+0x53/0x86

In f2fs_iget(), we will check inode's first block address, if it is valid,
we will set FI_FIRST_BLOCK_WRITTEN flag in inode.

But we should only do this for regular inode, otherwise, like special
inode, i_addr[0] is used for storing device info instead of block address,
it will fail checking flow obviously.

So for non-regular inode, let's skip verifying address and setting flag.

Signed-off-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
2018-08-14 10:29:11 -07:00
..
acl.c posix_acl: convert posix_acl.a_refcount from atomic_t to refcount_t 2018-01-02 19:27:28 -08:00
acl.h f2fs: remove dead code f2fs_check_acl 2016-09-14 16:52:36 -07:00
checkpoint.c f2fs: rework fault injection handling to avoid a warning 2018-08-14 09:49:15 -07:00
data.c f2fs: rework fault injection handling to avoid a warning 2018-08-14 09:49:15 -07: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: clean up symbol namespace 2018-05-31 11:31:53 -07:00
f2fs.h f2fs: rework fault injection handling to avoid a warning 2018-08-14 09:49:15 -07:00
file.c f2fs: rework fault injection handling to avoid a warning 2018-08-14 09:49:15 -07:00
gc.c f2fs: rework fault injection handling to avoid a warning 2018-08-14 09:49:15 -07:00
gc.h f2fs: introduce sbi->gc_mode to determine the policy 2018-05-31 11:31:51 -07:00
hash.c f2fs: check entire encrypted bigname when finding a dentry 2017-05-04 11:44:35 -04:00
inline.c f2fs: fix to propagate error from __get_meta_page() 2018-08-01 11:52:36 -07:00
inode.c f2fs: fix to skip verifying block address for non-regular inode 2018-08-14 10:29:11 -07:00
Kconfig fs/*/Kconfig: drop links to 404-compliant http://acl.bestbits.at 2018-01-01 12:45:37 -07:00
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 f2fs: Replace strncpy with memcpy 2018-07-28 18:26:08 -07:00
node.c f2fs: rework fault injection handling to avoid a warning 2018-08-14 09:49:15 -07:00
node.h f2fs: let checkpoint flush dnode page of regular 2018-08-01 11:52:36 -07:00
recovery.c f2fs: rework fault injection handling to avoid a warning 2018-08-14 09:49:15 -07:00
segment.c f2fs: rework fault injection handling to avoid a warning 2018-08-14 09:49:15 -07:00
segment.h f2fs: do not set free of current section 2018-08-01 11:52:36 -07:00
shrinker.c f2fs: clean up symbol namespace 2018-05-31 11:31:53 -07:00
super.c f2fs: support fault_type mount option 2018-08-13 10:48:17 -07:00
sysfs.c f2fs: wake up gc thread immediately when gc_urgent is set 2018-08-13 10:48:17 -07:00
trace.c f2fs: fix potential hangtask in f2fs_trace_pid 2018-01-02 19:27:30 -08:00
trace.h f2fs: add sbi and page pointer in f2fs_io_info 2015-05-28 15:41:32 -07:00
xattr.c f2fs: restrict setting up inode.i_advise 2018-08-01 11:52:36 -07:00
xattr.h f2fs: guard macro variables with braces 2017-04-10 19:48:10 -07:00