remarkable-linux/fs/xfs
David Chinner 4c60658e0f [XFS] Prevent a deadlock when xfslogd unpins inodes.
The previous fixes for the use after free in xfs_iunpin left a nasty log
deadlock when xfslogd unpinned the inode and dropped the last reference to
the inode. the ->clear_inode() method can issue transactions, and if the
log was full, the transaction could push on the log and get stuck trying
to push the inode it was currently unpinning.

To fix this, we provide xfs_iunpin a guarantee that it will always have a
valid xfs_inode <-> linux inode link or a particular flag will be set on
the inode. We then use log forces during lookup to ensure transactions are
completed before we recycle the inode. This ensures that xfs_iunpin will
never use the linux inode after it is being freed, and any lookup on an
inode on the reclaim list will wait until it is safe to attach a new linux
inode to the xfs inode.

SGI-PV: 956832
SGI-Modid: xfs-linux-melb:xfs-kern:27359a

Signed-off-by: David Chinner <dgc@sgi.com>
Signed-off-by: Shailendra Tripathi <stripathi@agami.com>
Signed-off-by: Takenori Nagano <t-nagano@ah.jp.nec.com>
Signed-off-by: Tim Shimmin <tes@sgi.com>
2006-11-11 18:05:00 +11:00
..
linux-2.6 [XFS] Clean up i_flags and i_flags_lock handling. 2006-11-11 18:04:54 +11:00
quota [XFS] Fix kmem_zalloc_greedy warnings on 64 bit platforms. 2006-09-28 11:04:43 +10:00
support [XFS] rename uio_read() to xfs_uio_read() 2006-11-11 18:04:41 +11:00
Kbuild
Kconfig [PATCH] BLOCK: Make it possible to disable the block layer [try #6] 2006-09-30 20:52:31 +02:00
Makefile
Makefile-linux-2.6 [XFS] 956618: Linux crashes on boot with XFS-DMAPI filesystem when 2006-11-11 18:03:49 +11:00
xfs.h [XFS] 956618: Linux crashes on boot with XFS-DMAPI filesystem when 2006-11-11 18:03:49 +11:00
xfs_acl.c [XFS] Remove version 1 directory code. Never functioned on Linux, just 2006-06-20 13:04:51 +10:00
xfs_acl.h [XFS] Resolve a namespace collision on remaining vtypes for FreeBSD 2006-06-09 17:07:12 +10:00
xfs_ag.h [XFS] endianess annotation for xfs_agfl_t. Trivial, xfs_agfl_t is always 2006-09-28 10:56:51 +10:00
xfs_alloc.c [XFS] Minor code rearranging and cleanup to prevent some coverity false 2006-09-28 11:03:44 +10:00
xfs_alloc.h [XFS] Prevent free space oversubscription and xfssyncd looping. 2006-09-07 14:26:50 +10:00
xfs_alloc_btree.c [XFS] Reduce endian flipping in alloc_btree, same as was done for 2006-09-28 11:05:40 +10:00
xfs_alloc_btree.h
xfs_arch.h
xfs_attr.c [XFS] Add EA list callbacks for xfs kernel use. Cleanup some namespace 2006-09-28 11:01:37 +10:00
xfs_attr.h [XFS] Add EA list callbacks for xfs kernel use. Cleanup some namespace 2006-09-28 11:01:37 +10:00
xfs_attr_leaf.c [XFS] Add EA list callbacks for xfs kernel use. Cleanup some namespace 2006-09-28 11:01:37 +10:00
xfs_attr_leaf.h [XFS] Add EA list callbacks for xfs kernel use. Cleanup some namespace 2006-09-28 11:01:37 +10:00
xfs_attr_sf.h
xfs_behavior.c [XFS] remove bhv_lookup, _range version works aswell and has more useful 2006-09-28 10:58:52 +10:00
xfs_behavior.h [XFS] remove bhv_lookup, _range version works aswell and has more useful 2006-09-28 10:58:52 +10:00
xfs_bit.c
xfs_bit.h
xfs_bmap.c [XFS] Improve error handling for the zero-fsblock extent detection code. 2006-09-28 11:03:20 +10:00
xfs_bmap.h [XFS] Add parameters to xfs_bmapi() and xfs_bunmapi() to have them report 2006-06-09 14:48:12 +10:00
xfs_bmap_btree.c [XFS] use NULL for pointer initialisation instead of zero-cast-to-ptr 2006-09-28 10:58:40 +10:00
xfs_bmap_btree.h [XFS] endianess annotations for xfs_bmbt_key Trivial as there are no 2006-09-28 10:58:17 +10:00
xfs_btree.c [XFS] endianess annotations for xfs_bmbt_key Trivial as there are no 2006-09-28 10:58:17 +10:00
xfs_btree.h [XFS] endianess annotate XFS_BMAP_BROOT_PTR_ADDR Make sure it returns a 2006-09-28 10:58:06 +10:00
xfs_buf_item.c [XFS] Remove unused iop_abort log item operation 2006-09-28 11:02:44 +10:00
xfs_buf_item.h
xfs_cap.h [XFS] Resolve a namespace collision on vnode/vnodeops for FreeBSD porters. 2006-06-09 17:00:52 +10:00
xfs_clnt.h [XFS] Implement the silent parameter to fill_super, previously ignored. 2006-03-31 13:04:17 +10:00
xfs_da_btree.c [XFS] Minor code rearranging and cleanup to prevent some coverity false 2006-09-28 11:03:44 +10:00
xfs_da_btree.h [XFS] Remove version 1 directory code. Never functioned on Linux, just 2006-06-20 13:04:51 +10:00
xfs_dfrag.c [XFS] Remove version 1 directory code. Never functioned on Linux, just 2006-06-20 13:04:51 +10:00
xfs_dfrag.h [XFS] Add parameters to xfs_bmapi() and xfs_bunmapi() to have them report 2006-06-09 14:48:12 +10:00
xfs_dinode.h [XFS] Remove version 1 directory code. Never functioned on Linux, just 2006-06-20 13:04:51 +10:00
xfs_dir2.c [XFS] rename uio_read() to xfs_uio_read() 2006-11-11 18:04:41 +11:00
xfs_dir2.h [XFS] Remove version 1 directory code. Never functioned on Linux, just 2006-06-20 13:04:51 +10:00
xfs_dir2_block.c [XFS] Remove version 1 directory code. Never functioned on Linux, just 2006-06-20 13:04:51 +10:00
xfs_dir2_block.h
xfs_dir2_data.c [XFS] Remove version 1 directory code. Never functioned on Linux, just 2006-06-20 13:04:51 +10:00
xfs_dir2_data.h [XFS] endianess annotations for xfs_dir2_data_entry_t 2006-06-09 14:48:37 +10:00
xfs_dir2_leaf.c [XFS] Remove version 1 directory code. Never functioned on Linux, just 2006-06-20 13:04:51 +10:00
xfs_dir2_leaf.h
xfs_dir2_node.c [XFS] Remove version 1 directory code. Never functioned on Linux, just 2006-06-20 13:04:51 +10:00
xfs_dir2_node.h
xfs_dir2_sf.c [XFS] Remove version 1 directory code. Never functioned on Linux, just 2006-06-20 13:04:51 +10:00
xfs_dir2_sf.h
xfs_dir2_trace.c [XFS] Remove version 1 directory code. Never functioned on Linux, just 2006-06-20 13:04:51 +10:00
xfs_dir2_trace.h
xfs_dmapi.h [XFS] Resolve a namespace collision on vfs/vfsops for FreeBSD porters. 2006-06-09 16:48:30 +10:00
xfs_dmops.c [XFS] Remove version 1 directory code. Never functioned on Linux, just 2006-06-20 13:04:51 +10:00
xfs_error.c [XFS] Remove version 1 directory code. Never functioned on Linux, just 2006-06-20 13:04:51 +10:00
xfs_error.h [XFS] Improve error handling for the zero-fsblock extent detection code. 2006-09-28 11:03:20 +10:00
xfs_extfree_item.c [XFS] Remove unused iop_abort log item operation 2006-09-28 11:02:44 +10:00
xfs_extfree_item.h [XFS] cleanup the field types of some item format structures 2006-09-28 10:55:43 +10:00
xfs_fs.h [XFS] Remove several macros that are no longer used anywhere 2006-09-28 11:02:57 +10:00
xfs_fsops.c [XFS] Prevent free space oversubscription and xfssyncd looping. 2006-09-07 14:26:50 +10:00
xfs_fsops.h
xfs_ialloc.c [XFS] Remove last bulkstat false-positives with debug kernels. 2006-09-28 11:02:23 +10:00
xfs_ialloc.h
xfs_ialloc_btree.c [XFS] use NULL for pointer initialisation instead of zero-cast-to-ptr 2006-09-28 10:58:40 +10:00
xfs_ialloc_btree.h [XFS] endianess annotations for xfs_inobt_rec_t / xfs_inobt_key_t 2006-09-28 10:57:04 +10:00
xfs_iget.c [XFS] Prevent a deadlock when xfslogd unpins inodes. 2006-11-11 18:05:00 +11:00
xfs_imap.h
xfs_inode.c [XFS] Prevent a deadlock when xfslogd unpins inodes. 2006-11-11 18:05:00 +11:00
xfs_inode.h [XFS] Clean up i_flags and i_flags_lock handling. 2006-11-11 18:04:54 +11:00
xfs_inode_item.c [XFS] Remove unused iop_abort log item operation 2006-09-28 11:02:44 +10:00
xfs_inode_item.h [XFS] cleanup the field types of some item format structures 2006-09-28 10:55:43 +10:00
xfs_inum.h
xfs_iocore.c [XFS] Remove version 1 directory code. Never functioned on Linux, just 2006-06-20 13:04:51 +10:00
xfs_iomap.c [XFS] Improve error handling for the zero-fsblock extent detection code. 2006-09-28 11:03:20 +10:00
xfs_iomap.h
xfs_itable.c [XFS] 955947: Infinite loop in xfs_bulkstat() on formatter() error 2006-09-28 11:06:21 +10:00
xfs_itable.h [XFS] pv 956241, author: nathans, rv: vapo - make ino validation checks 2006-09-28 11:06:15 +10:00
xfs_log.c [XFS] Fixes the leak in reservation space because we weren't ungranting 2006-09-28 11:04:16 +10:00
xfs_log.h [XFS] Remove several macros that are no longer used anywhere 2006-09-28 11:02:57 +10:00
xfs_log_priv.h [XFS] Fixes the leak in reservation space because we weren't ungranting 2006-09-28 11:04:16 +10:00
xfs_log_recover.c [XFS] Rework code snippets slightly to remove remaining recent-gcc 2006-06-28 10:13:52 +10:00
xfs_log_recover.h
xfs_mac.h
xfs_mount.c [XFS] Prevent free space oversubscription and xfssyncd looping. 2006-09-07 14:26:50 +10:00
xfs_mount.h [XFS] Fix kmem_zalloc_greedy warnings on 64 bit platforms. 2006-09-28 11:04:43 +10:00
xfs_qmops.c [XFS] Remove version 1 directory code. Never functioned on Linux, just 2006-06-20 13:04:51 +10:00
xfs_quota.h [XFS] Remove several macros that are no longer used anywhere 2006-09-28 11:02:57 +10:00
xfs_refcache.h
xfs_rename.c [XFS] Remove version 1 directory code. Never functioned on Linux, just 2006-06-20 13:04:51 +10:00
xfs_rtalloc.c [XFS] Fix a porting botch on the realtime subvol growfs code path. 2006-09-28 11:03:53 +10:00
xfs_rtalloc.h
xfs_rw.c [XFS] Remove version 1 directory code. Never functioned on Linux, just 2006-06-20 13:04:51 +10:00
xfs_rw.h [XFS] Push some common code out of write path into core XFS code for 2006-06-19 08:39:53 +10:00
xfs_sb.h [XFS] Remove several macros that are no longer used anywhere 2006-09-28 11:02:57 +10:00
xfs_trans.c [XFS] Remove version 1 directory code. Never functioned on Linux, just 2006-06-20 13:04:51 +10:00
xfs_trans.h [XFS] Remove unused iop_abort log item operation 2006-09-28 11:02:44 +10:00
xfs_trans_ail.c [XFS] Add lock annotations to xfs_trans_update_ail and 2006-09-28 11:04:07 +10:00
xfs_trans_buf.c [XFS] Remove version 1 directory code. Never functioned on Linux, just 2006-06-20 13:04:51 +10:00
xfs_trans_extfree.c [XFS] Remove version 1 directory code. Never functioned on Linux, just 2006-06-20 13:04:51 +10:00
xfs_trans_inode.c [XFS] Remove version 1 directory code. Never functioned on Linux, just 2006-06-20 13:04:51 +10:00
xfs_trans_item.c [XFS] Portability changes: remove prdev, stick to one diagnostic 2006-06-09 15:29:40 +10:00
xfs_trans_priv.h [XFS] Add lock annotations to xfs_trans_update_ail and 2006-09-28 11:04:07 +10:00
xfs_trans_space.h [XFS] Remove version 1 directory code. Never functioned on Linux, just 2006-06-20 13:04:51 +10:00
xfs_types.h
xfs_utils.c [XFS] Remove version 1 directory code. Never functioned on Linux, just 2006-06-20 13:04:51 +10:00
xfs_utils.h [XFS] Resolve a namespace collision on remaining vtypes for FreeBSD 2006-06-09 17:07:12 +10:00
xfs_vfsops.c [XFS] Fix kmem_zalloc_greedy warnings on 64 bit platforms. 2006-09-28 11:04:43 +10:00
xfs_vnodeops.c [XFS] Prevent a deadlock when xfslogd unpins inodes. 2006-11-11 18:05:00 +11:00