linux/fs/ocfs2
Changwei Ge 9e98578775 ocfs2: don't use iocb when EIOCBQUEUED returns
When -EIOCBQUEUED returns, it means that aio_complete() will be called
from dio_complete(), which is an asynchronous progress against
write_iter.  Generally, IO is a very slow progress than executing
instruction, but we still can't take the risk to access a freed iocb.

And we do face a BUG crash issue.  Using the crash tool, iocb is
obviously freed already.

  crash> struct -x kiocb ffff881a350f5900
  struct kiocb {
    ki_filp = 0xffff881a350f5a80,
    ki_pos = 0x0,
    ki_complete = 0x0,
    private = 0x0,
    ki_flags = 0x0
  }

And the backtrace shows:
  ocfs2_file_write_iter+0xcaa/0xd00 [ocfs2]
  aio_run_iocb+0x229/0x2f0
  do_io_submit+0x291/0x540
  SyS_io_submit+0x10/0x20
  system_call_fastpath+0x16/0x75

Link: http://lkml.kernel.org/r/1523361653-14439-1-git-send-email-ge.changwei@h3c.com
Signed-off-by: Changwei Ge <ge.changwei@h3c.com>
Reviewed-by: Andrew Morton <akpm@linux-foundation.org>
Cc: Mark Fasheh <mark@fasheh.com>
Cc: Joel Becker <jlbec@evilplan.org>
Cc: Junxiao Bi <junxiao.bi@oracle.com>
Cc: Joseph Qi <jiangqi903@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2018-11-03 10:09:37 -07:00
..
cluster iov_iter: Separate type from direction and use accessor functions 2018-10-24 00:41:07 +01:00
dlm fs/ocfs2/dlm/dlmdebug.c: fix a sleep-in-atomic-context bug in dlm_print_one_mle() 2018-10-26 16:25:18 -07:00
dlmfs vfs: do bulk POLL* -> EPOLL* replacement 2018-02-11 14:34:03 -08:00
acl.c ocfs2/acl: use 'ip_xattr_sem' to protect getting extended attribute 2018-01-31 17:18:35 -08:00
acl.h ocfs2: make ocfs2_set_acl() static 2017-09-06 17:27:24 -07:00
alloc.c ocfs2: remove unused pointer 'eb' 2018-10-26 16:25:18 -07:00
alloc.h ocfs2: try to reuse extent block in dealloc without meta_alloc 2018-01-31 17:18:35 -08:00
aops.c ocfs2: remove unneeded null check 2018-10-26 16:25:18 -07:00
aops.h ocfs2: keep the trace point consistent with the function name 2018-04-05 21:36:21 -07:00
blockcheck.c
blockcheck.h
buffer_head_io.c ocfs2: fix ocfs2 read block panic 2018-09-20 22:01:12 +02:00
buffer_head_io.h ocfs2: clean up some unused function declarations 2017-11-15 18:21:01 -08:00
dcache.c VFS: normal filesystems (and lustre): d_inode() annotations 2015-04-15 15:06:57 -04:00
dcache.h
dir.c ocfs2: use 'osb' instead of 'OCFS2_SB()' 2018-04-05 21:36:21 -07:00
dir.h VFS: normal filesystems (and lustre): d_inode() annotations 2015-04-15 15:06:57 -04:00
dlmglue.c ocfs2: remove ocfs2_is_o2cb_active() 2018-11-03 10:09:37 -07:00
dlmglue.h ocfs2: ocfs2_inode_lock_tracker does not distinguish lock level 2018-06-07 17:34:33 -07:00
export.c ocfs2: Use ERR_CAST() to avoid cross-structure cast 2017-05-28 10:11:49 -07:00
export.h
extent_map.c ocfs2: add ocfs2_overwrite_io() 2018-01-31 17:18:35 -08:00
extent_map.h ocfs2: add ocfs2_overwrite_io() 2018-01-31 17:18:35 -08:00
file.c ocfs2: don't use iocb when EIOCBQUEUED returns 2018-11-03 10:09:37 -07:00
file.h ocfs2: clean up redundant function declarations 2018-06-07 17:34:33 -07:00
filecheck.c ocfs2: add duplicated ino number check 2018-04-05 21:36:22 -07:00
filecheck.h ocfs2: add kobject for online file check 2018-04-05 21:36:22 -07:00
heartbeat.c
heartbeat.h
inode.c ocfs2: clean up some unnecessary code 2018-08-17 16:20:27 -07:00
inode.h ocfs2: convert inode refcount test to a helper 2016-12-10 12:39:45 -08:00
ioctl.c ocfs2: eliminate a misreported warning 2018-06-07 17:34:33 -07:00
ioctl.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
journal.c ocfs2: without quota support, avoid calling quota recovery 2018-11-03 10:09:37 -07:00
journal.h jbd2: add support for avoiding data writes during transaction commits 2016-04-24 00:56:07 -04:00
Kconfig
localalloc.c ocfs2: return -EROFS when filesystem becomes read-only 2018-08-17 16:20:27 -07:00
localalloc.h
locks.c ocfs2: fix flock panic issue 2015-12-29 17:45:49 -08:00
locks.h
Makefile License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
mmap.c fs: ocfs2: use new return type vm_fault_t 2018-06-07 17:34:34 -07:00
mmap.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
move_extents.c ocfs2: clean up some dead code 2017-09-06 17:27:24 -07:00
move_extents.h
namei.c ocfs2: drop a VLA in ocfs2_orphan_del() 2018-06-07 17:34:34 -07:00
namei.h ocfs2: do not include dio entry in case of orphan scan 2015-11-05 19:34:48 -08:00
ocfs1_fs_compat.h
ocfs2_fs.h ocfs2: correct the comments position of struct ocfs2_dir_block_trailer 2018-06-07 17:34:34 -07:00
ocfs2_ioctl.h
ocfs2_lockid.h ocfs2: add trimfs dlm lock resource 2018-01-31 17:18:35 -08:00
ocfs2_lockingver.h
ocfs2_trace.h ocfs2: keep the trace point consistent with the function name 2018-04-05 21:36:21 -07:00
ocfs2.h ocfs2: add kobject for online file check 2018-04-05 21:36:22 -07:00
quota_global.c ocfs2: convert to new i_version API 2018-01-29 06:42:21 -05:00
quota_local.c ocfs2: return -EROFS when filesystem becomes read-only 2018-08-17 16:20:27 -07:00
quota.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
refcounttree.c vfs: rework data cloning infrastructure 2018-11-02 09:33:08 -07:00
refcounttree.h ocfs2: remove ocfs2_reflink_remap_range 2018-10-30 10:45:48 +11:00
reservations.c ocfs2: make resv_lock spinlock static 2015-02-10 14:30:29 -08:00
reservations.h
resize.c ocfs2: solve a problem of crossing the boundary in updating backups 2016-03-25 16:37:42 -07:00
resize.h
slot_map.c ocfs2: clean up an unneeded goto in ocfs2_put_slot() 2016-05-19 19:12:14 -07:00
slot_map.h
stack_o2cb.c ocfs2: avoid a pointless delay in o2cb_cluster_check() 2015-04-14 16:48:57 -07:00
stack_user.c treewide: Align function definition open/close braces 2018-03-26 11:13:09 +02:00
stackglue.c ocfs2: remove ocfs2_is_o2cb_active() 2018-11-03 10:09:37 -07:00
stackglue.h ocfs2: remove ocfs2_is_o2cb_active() 2018-11-03 10:09:37 -07:00
suballoc.c ocfs2: remove two unused functions from suballoc.c 2018-04-05 21:36:22 -07:00
suballoc.h
super.c ocfs2: add kobject for online file check 2018-04-05 21:36:22 -07:00
super.h ocfs2: remove unused declaration ocfs2_publish_get_mount_state() 2017-11-15 18:21:01 -08:00
symlink.c vfs: remove ".readlink = generic_readlink" assignments 2016-12-09 16:45:04 +01:00
symlink.h
sysfile.c treewide: kzalloc() -> kcalloc() 2018-06-12 16:19:22 -07:00
sysfile.h
uptodate.c ocfs2: remove unnecessary null pointer check before kmem_cache_destroy() 2018-04-05 21:36:22 -07:00
uptodate.h
xattr.c ocfs2: use 'osb' instead of 'OCFS2_SB()' 2018-04-05 21:36:21 -07:00
xattr.h ocfs2: fix posix_acl_create deadlock 2016-05-12 15:52:50 -07:00