kernel_optimize_test/fs/xfs
Dave Chinner d69043c42d xfs: drop buffer io reference when a bad bio is built
Error handling in xfs_buf_ioapply_map() does not handle IO reference
counts correctly. We increment the b_io_remaining count before
building the bio, but then fail to decrement it in the failure case.
This leads to the buffer never running IO completion and releasing
the reference that the IO holds, so at unmount we can leak the
buffer. This leak is captured by this assert failure during unmount:

XFS: Assertion failed: atomic_read(&pag->pag_ref) == 0, file: fs/xfs/xfs_mount.c, line: 273

This is not a new bug - the b_io_remaining accounting has had this
problem for a long, long time - it's just very hard to get a
zero length bio being built by this code...

Further, the buffer IO error can be overwritten on a multi-segment
buffer by subsequent bio completions for partial sections of the
buffer. Hence we should only set the buffer error status if the
buffer is not already carrying an error status. This ensures that a
partial IO error on a multi-segment buffer will not be lost. This
part of the problem is a regression, however.

cc: <stable@vger.kernel.org>
Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Mark Tinguely <tinguely@sgi.com>
Signed-off-by: Ben Myers <bpm@sgi.com>
2012-11-17 09:36:57 -06:00
..
Kconfig
kmem.c
kmem.h
Makefile
mrlock.h
time.h
uuid.c
uuid.h
xfs_acl.c userns: Pass a userns parameter into posix_acl_to_xattr and posix_acl_from_xattr 2012-09-18 01:01:35 -07:00
xfs_acl.h
xfs_ag.h
xfs_alloc_btree.c xfs: invalidate allocbt blocks moved to the free list 2012-11-08 11:09:44 -06:00
xfs_alloc_btree.h
xfs_alloc.c xfs: move allocation stack switch up to xfs_bmapi_allocate 2012-11-08 11:08:46 -06:00
xfs_alloc.h xfs: move allocation stack switch up to xfs_bmapi_allocate 2012-11-08 11:08:46 -06:00
xfs_aops.c xfs: fix broken error handling in xfs_vm_writepage 2012-11-17 09:35:42 -06:00
xfs_aops.h
xfs_attr_leaf.c xfs: fix attr tree double split corruption 2012-11-17 09:34:13 -06:00
xfs_attr_leaf.h
xfs_attr_sf.h
xfs_attr.c
xfs_attr.h
xfs_bit.c
xfs_bit.h
xfs_bmap_btree.c
xfs_bmap_btree.h
xfs_bmap.c xfs: move allocation stack switch up to xfs_bmapi_allocate 2012-11-08 11:08:46 -06:00
xfs_bmap.h xfs: move allocation stack switch up to xfs_bmapi_allocate 2012-11-08 11:08:46 -06:00
xfs_btree.c
xfs_btree.h
xfs_buf_item.c xfs: fix buffer shudown reference count mismatch 2012-11-08 11:10:35 -06:00
xfs_buf_item.h
xfs_buf.c xfs: drop buffer io reference when a bad bio is built 2012-11-17 09:36:57 -06:00
xfs_buf.h xfs: fix race while discarding buffers [V4] 2012-08-29 15:01:11 -05:00
xfs_da_btree.c
xfs_da_btree.h
xfs_dfrag.c switch simple cases of fget_light to fdget 2012-09-26 22:20:08 -04:00
xfs_dfrag.h
xfs_dinode.h
xfs_dir2_block.c
xfs_dir2_data.c
xfs_dir2_format.h
xfs_dir2_leaf.c
xfs_dir2_node.c
xfs_dir2_priv.h
xfs_dir2_sf.c
xfs_dir2.c
xfs_dir2.h
xfs_discard.c xfs: check for possible overflow in xfs_ioc_trim 2012-08-23 14:48:44 -05:00
xfs_discard.h
xfs_dquot_item.c
xfs_dquot_item.h
xfs_dquot.c
xfs_dquot.h
xfs_error.c
xfs_error.h
xfs_export.c tmpfs,ceph,gfs2,isofs,reiserfs,xfs: fix fh_len checking 2012-10-09 23:33:55 -04:00
xfs_export.h
xfs_extent_busy.c
xfs_extent_busy.h
xfs_extfree_item.c
xfs_extfree_item.h
xfs_file.c mm: kill vma flag VM_CAN_NONLINEAR 2012-10-09 16:22:17 +09:00
xfs_filestream.c
xfs_filestream.h
xfs_fs_subr.c
xfs_fs.h
xfs_fsops.c xfs: growfs: don't read garbage for new secondary superblocks 2012-11-08 11:08:57 -06:00
xfs_fsops.h
xfs_globals.c
xfs_ialloc_btree.c
xfs_ialloc_btree.h
xfs_ialloc.c xfs: zero allocation_args on the kernel stack 2012-11-08 11:08:10 -06:00
xfs_ialloc.h
xfs_iget.c
xfs_inode_item.c
xfs_inode_item.h
xfs_inode.c xfs: don't vmap inode cluster buffers during free 2012-11-08 11:10:18 -06:00
xfs_inode.h
xfs_inum.h
xfs_ioctl32.c
xfs_ioctl32.h
xfs_ioctl.c xfs: silence uninitialised f.file warning. 2012-11-08 11:09:17 -06:00
xfs_ioctl.h
xfs_iomap.c xfs: introduce XFS_BMAPI_STACK_SWITCH 2012-11-08 11:08:27 -06:00
xfs_iomap.h
xfs_iops.c
xfs_iops.h
xfs_itable.c
xfs_itable.h
xfs_linux.h
xfs_log_cil.c
xfs_log_priv.h
xfs_log_recover.c xfs: fix reading of wrapped log data 2012-11-08 11:10:51 -06:00
xfs_log_recover.h
xfs_log.c xfs: only update the last_sync_lsn when a transaction completes 2012-11-08 11:07:38 -06:00
xfs_log.h
xfs_message.c
xfs_message.h
xfs_mount.c xfs: reduce code duplication handling inode32/64 options 2012-09-26 15:56:33 -05:00
xfs_mount.h xfs: kill struct declarations in xfs_mount.h 2012-08-16 13:29:35 -05:00
xfs_mru_cache.c
xfs_mru_cache.h
xfs_qm_bhv.c
xfs_qm_syscalls.c
xfs_qm.c
xfs_qm.h
xfs_quota_priv.h
xfs_quota.h
xfs_quotaops.c userns: Convert qutoactl 2012-09-18 01:01:39 -07:00
xfs_rename.c
xfs_rtalloc.c xfs: fix uninitialised variable in xfs_rtbuf_get() 2012-08-23 14:48:16 -05:00
xfs_rtalloc.h
xfs_sb.h
xfs_stats.c
xfs_stats.h
xfs_super.c xfs: update for 3.7-rc1 2012-10-02 20:42:58 -07:00
xfs_super.h xfs: reduce code duplication handling inode32/64 options 2012-09-26 15:56:33 -05:00
xfs_sync.c workqueue: deprecate flush[_delayed]_work_sync() 2012-08-20 14:51:24 -07:00
xfs_sync.h
xfs_sysctl.c
xfs_sysctl.h
xfs_trace.c
xfs_trace.h xfs: kill struct declarations in xfs_mount.h 2012-08-16 13:29:35 -05:00
xfs_trans_ail.c
xfs_trans_buf.c
xfs_trans_dquot.c userns: Convert quota netlink aka quota_send_warning 2012-09-18 01:01:40 -07:00
xfs_trans_extfree.c
xfs_trans_inode.c
xfs_trans_priv.h
xfs_trans_space.h
xfs_trans.c
xfs_trans.h Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs 2012-08-01 10:26:23 -07:00
xfs_types.h
xfs_utils.c
xfs_utils.h
xfs_vnode.h
xfs_vnodeops.c
xfs_vnodeops.h
xfs_xattr.c
xfs.h