xfs: fix dquot shaker deadlock
Dave Chinner authored
commit 0fbca4d1 upstream.

Commit 368e1361

 ("xfs: remove duplicate code from dquot reclaim") fails
to unlock the dquot freelist when the number of loop restarts is
exceeded in xfs_qm_dqreclaim_one(). This causes hangs in memory
reclaim.

Rework the loop control logic into an unwind stack that all the
different cases jump into. This means there is only one set of code
that processes the loop exit criteria, and simplifies the unlocking
of all the items from different points in the loop. It also fixes a
double increment of the restart counter from the qi_dqlist_lock
case.
Reported-by: default avatarMalcolm Scott <lkml@malc.org.uk>
Signed-off-by: default avatarDave Chinner <dchinner@redhat.com>
Reviewed-by: default avatarAlex Elder <aelder@sgi.com>
Cc: Arkadiusz Miskiewicz <a.miskiewicz@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
4b4c0044
Name Last commit Last update
..
linux-2.6 xfs: push stale, pinned buffers on trylock failures
quota xfs: fix dquot shaker deadlock
support xfs: drop dmapi hooks
Kconfig quota: Make QUOTACTL config be selected by its users
Makefile xfs: simplify log item descriptor tracking
xfs.h xfs: event tracing support
xfs_acl.h xfs: constify xattr_handler
xfs_ag.h xfs: convert buffer cache hash to rbtree
xfs_alloc.c xfs: eliminate some newly-reported gcc warnings
xfs_alloc.h xfs: do not use emums for flags used in tracing
xfs_alloc_btree.c xfs: remove the ->kill_root btree operation
xfs_alloc_btree.h [XFS] Always use struct xfs_btree_block instead of short / longform
xfs_arch.h xfs: use generic Posix ACL code
xfs_attr.c xfs: remove xfs_buf wrappers
xfs_attr.h xfs: convert attr to use unsigned names
xfs_attr_leaf.c xfs: remove unused delta tracking code in xfs_bmapi
xfs_attr_leaf.h [XFS] Remove macro-to-function indirections in attr code
xfs_attr_sf.h xfs: convert attr to use unsigned names
xfs_bit.c [XFS] Use the generic bitops rather than implementing them ourselves.
xfs_bit.h [XFS] Remove macro-to-function indirections in the mask code
xfs_bmap.c xfs: delayed alloc blocks beyond EOF are valid after writeback
xfs_bmap.h xfs: fix failed write truncation handling.
xfs_bmap_btree.c xfs: remove unneeded #include statements
xfs_bmap_btree.h xfs: make several more functions static
xfs_btree.c xfs: remove xfs_buf wrappers
xfs_btree.h
xfs_btree_trace.c
xfs_btree_trace.h
xfs_buf_item.c
xfs_buf_item.h
xfs_da_btree.c
xfs_da_btree.h
xfs_dfrag.c
xfs_dfrag.h
xfs_dinode.h
xfs_dir2.c
xfs_dir2.h
xfs_dir2_block.c
xfs_dir2_block.h
xfs_dir2_data.c
xfs_dir2_data.h
xfs_dir2_leaf.c
xfs_dir2_leaf.h
xfs_dir2_node.c
xfs_dir2_node.h
xfs_dir2_sf.c
xfs_dir2_sf.h
xfs_error.c
xfs_error.h
xfs_extfree_item.c
xfs_extfree_item.h
xfs_filestream.c
xfs_filestream.h
xfs_fs.h
xfs_fsops.c
xfs_fsops.h
xfs_ialloc.c
xfs_ialloc.h
xfs_ialloc_btree.c
xfs_ialloc_btree.h
xfs_iget.c
xfs_inode.c
xfs_inode.h
xfs_inode_item.c
xfs_inode_item.h
xfs_inum.h
xfs_iomap.c
xfs_iomap.h
xfs_itable.c
xfs_itable.h
xfs_log.c
xfs_log.h
xfs_log_cil.c
xfs_log_priv.h
xfs_log_recover.c
xfs_log_recover.h
xfs_mount.c
xfs_mount.h
xfs_mru_cache.c
xfs_mru_cache.h
xfs_quota.h
xfs_rename.c
xfs_rtalloc.c
xfs_rtalloc.h
xfs_rw.c
xfs_rw.h
xfs_sb.h
xfs_trans.c
xfs_trans.h
xfs_trans_ail.c
xfs_trans_buf.c
xfs_trans_extfree.c
xfs_trans_inode.c
xfs_trans_priv.h
xfs_trans_space.h
xfs_types.h
xfs_utils.c
xfs_utils.h
xfs_vnodeops.c
xfs_vnodeops.h