freebsd-dev/sys/gnu/fs/xfs
Konstantin Belousov 2cc7d26f7f Cylinder group bitmaps and blocks containing inode for a snapshot
file are after snaplock, while other ffs device buffers are before
snaplock in global lock order. By itself, this could cause deadlock
when bdwrite() tries to flush dirty buffers on snapshotted ffs. If,
during the flush, COW activity for snapshot needs to allocate block
and ffs_alloccg() selects the cylinder group that is being written
by bdwrite(), then kernel would panic due to recursive buffer lock
acquision.

Avoid dealing with buffers in bdwrite() that are from other side of
snaplock divisor in the lock order then the buffer being written. Add
new BOP, bop_bdwrite(), to do dirty buffer flushing for same vnode in
the bdwrite(). Default implementation, bufbdflush(), refactors the code
from bdwrite(). For ffs device buffers, specialized implementation is
used.

Reviewed by:	tegge, jeff, Russell Cattelan (cattelan xfs org, xfs changes)
Tested by:	Peter Holm
X-MFC after:	3 weeks (if ever: it changes ABI)
2007-01-23 10:01:19 +00:00
..
FreeBSD Cylinder group bitmaps and blocks containing inode for a snapshot 2007-01-23 10:01:19 +00:00
xfs_acl.c Sync XFS for FreeBSD tree with newer changes from SGI XFS for Linux tree. 2006-06-09 06:04:06 +00:00
xfs_acl.h Sync XFS for FreeBSD tree with newer changes from SGI XFS for Linux tree. 2006-06-09 06:04:06 +00:00
xfs_ag.h Sync XFS for FreeBSD tree with newer changes from SGI XFS for Linux tree. 2006-06-09 06:04:06 +00:00
xfs_alloc_btree.c Sync XFS for FreeBSD tree with newer changes from SGI XFS for Linux tree. 2006-06-09 06:04:06 +00:00
xfs_alloc_btree.h Sync XFS for FreeBSD tree with newer changes from SGI XFS for Linux tree. 2006-06-09 06:04:06 +00:00
xfs_alloc.c Sync XFS for FreeBSD tree with newer changes from SGI XFS for Linux tree. 2006-06-09 06:04:06 +00:00
xfs_alloc.h Sync XFS for FreeBSD tree with newer changes from SGI XFS for Linux tree. 2006-06-09 06:04:06 +00:00
xfs_arch.h Sync XFS for FreeBSD tree with newer changes from SGI XFS for Linux tree. 2006-06-09 06:04:06 +00:00
xfs_attr_leaf.c Sync XFS for FreeBSD tree with newer changes from SGI XFS for Linux tree. 2006-06-09 06:04:06 +00:00
xfs_attr_leaf.h Sync XFS for FreeBSD tree with newer changes from SGI XFS for Linux tree. 2006-06-09 06:04:06 +00:00
xfs_attr_sf.h Sync XFS for FreeBSD tree with newer changes from SGI XFS for Linux tree. 2006-06-09 06:04:06 +00:00
xfs_attr.c Sync XFS for FreeBSD tree with newer changes from SGI XFS for Linux tree. 2006-06-09 06:04:06 +00:00
xfs_attr.h Sync XFS for FreeBSD tree with newer changes from SGI XFS for Linux tree. 2006-06-09 06:04:06 +00:00
xfs_behavior.c Sync XFS for FreeBSD tree with newer changes from SGI XFS for Linux tree. 2006-06-09 06:04:06 +00:00
xfs_behavior.h Sync XFS for FreeBSD tree with newer changes from SGI XFS for Linux tree. 2006-06-09 06:04:06 +00:00
xfs_bit.c Sync XFS for FreeBSD tree with newer changes from SGI XFS for Linux tree. 2006-06-09 06:04:06 +00:00
xfs_bit.h Sync XFS for FreeBSD tree with newer changes from SGI XFS for Linux tree. 2006-06-09 06:04:06 +00:00
xfs_bmap_btree.c Sync XFS for FreeBSD tree with newer changes from SGI XFS for Linux tree. 2006-06-09 06:04:06 +00:00
xfs_bmap_btree.h Sync XFS for FreeBSD tree with newer changes from SGI XFS for Linux tree. 2006-06-09 06:04:06 +00:00
xfs_bmap.c Sync XFS for FreeBSD tree with newer changes from SGI XFS for Linux tree. 2006-06-09 06:04:06 +00:00
xfs_bmap.h Sync XFS for FreeBSD tree with newer changes from SGI XFS for Linux tree. 2006-06-09 06:04:06 +00:00
xfs_btree.c Sync XFS for FreeBSD tree with newer changes from SGI XFS for Linux tree. 2006-06-09 06:04:06 +00:00
xfs_btree.h Sync XFS for FreeBSD tree with newer changes from SGI XFS for Linux tree. 2006-06-09 06:04:06 +00:00
xfs_buf_item.c Sync XFS for FreeBSD tree with newer changes from SGI XFS for Linux tree. 2006-06-09 06:04:06 +00:00
xfs_buf_item.h Sync XFS for FreeBSD tree with newer changes from SGI XFS for Linux tree. 2006-06-09 06:04:06 +00:00
xfs_cap.c
xfs_cap.h Sync XFS for FreeBSD tree with newer changes from SGI XFS for Linux tree. 2006-06-09 06:04:06 +00:00
xfs_clnt.h Sync XFS for FreeBSD tree with newer changes from SGI XFS for Linux tree. 2006-06-09 06:04:06 +00:00
xfs_da_btree.c Sync XFS for FreeBSD tree with newer changes from SGI XFS for Linux tree. 2006-06-09 06:04:06 +00:00
xfs_da_btree.h Sync XFS for FreeBSD tree with newer changes from SGI XFS for Linux tree. 2006-06-09 06:04:06 +00:00
xfs_dfrag.c Sync XFS for FreeBSD tree with newer changes from SGI XFS for Linux tree. 2006-06-09 06:04:06 +00:00
xfs_dfrag.h Sync XFS for FreeBSD tree with newer changes from SGI XFS for Linux tree. 2006-06-09 06:04:06 +00:00
xfs_dinode.h Sync XFS for FreeBSD tree with newer changes from SGI XFS for Linux tree. 2006-06-09 06:04:06 +00:00
xfs_dir2_block.c Sync XFS for FreeBSD tree with newer changes from SGI XFS for Linux tree. 2006-06-09 06:04:06 +00:00
xfs_dir2_block.h Sync XFS for FreeBSD tree with newer changes from SGI XFS for Linux tree. 2006-06-09 06:04:06 +00:00
xfs_dir2_data.c Sync XFS for FreeBSD tree with newer changes from SGI XFS for Linux tree. 2006-06-09 06:04:06 +00:00
xfs_dir2_data.h Sync XFS for FreeBSD tree with newer changes from SGI XFS for Linux tree. 2006-06-09 06:04:06 +00:00
xfs_dir2_leaf.c Sync XFS for FreeBSD tree with newer changes from SGI XFS for Linux tree. 2006-06-09 06:04:06 +00:00
xfs_dir2_leaf.h Sync XFS for FreeBSD tree with newer changes from SGI XFS for Linux tree. 2006-06-09 06:04:06 +00:00
xfs_dir2_node.c Sync XFS for FreeBSD tree with newer changes from SGI XFS for Linux tree. 2006-06-09 06:04:06 +00:00
xfs_dir2_node.h Sync XFS for FreeBSD tree with newer changes from SGI XFS for Linux tree. 2006-06-09 06:04:06 +00:00
xfs_dir2_sf.c Sync XFS for FreeBSD tree with newer changes from SGI XFS for Linux tree. 2006-06-09 06:04:06 +00:00
xfs_dir2_sf.h Sync XFS for FreeBSD tree with newer changes from SGI XFS for Linux tree. 2006-06-09 06:04:06 +00:00
xfs_dir2_trace.c Sync XFS for FreeBSD tree with newer changes from SGI XFS for Linux tree. 2006-06-09 06:04:06 +00:00
xfs_dir2_trace.h Sync XFS for FreeBSD tree with newer changes from SGI XFS for Linux tree. 2006-06-09 06:04:06 +00:00
xfs_dir2.c Sync XFS for FreeBSD tree with newer changes from SGI XFS for Linux tree. 2006-06-09 06:04:06 +00:00
xfs_dir2.h Sync XFS for FreeBSD tree with newer changes from SGI XFS for Linux tree. 2006-06-09 06:04:06 +00:00
xfs_dir_leaf.c Sync XFS for FreeBSD tree with newer changes from SGI XFS for Linux tree. 2006-06-09 06:04:06 +00:00
xfs_dir_leaf.h Sync XFS for FreeBSD tree with newer changes from SGI XFS for Linux tree. 2006-06-09 06:04:06 +00:00
xfs_dir_sf.h Sync XFS for FreeBSD tree with newer changes from SGI XFS for Linux tree. 2006-06-09 06:04:06 +00:00
xfs_dir.c Sync XFS for FreeBSD tree with newer changes from SGI XFS for Linux tree. 2006-06-09 06:04:06 +00:00
xfs_dir.h Sync XFS for FreeBSD tree with newer changes from SGI XFS for Linux tree. 2006-06-09 06:04:06 +00:00
xfs_dmapi.h Sync XFS for FreeBSD tree with newer changes from SGI XFS for Linux tree. 2006-06-09 06:04:06 +00:00
xfs_dmops.c Sync XFS for FreeBSD tree with newer changes from SGI XFS for Linux tree. 2006-06-09 06:04:06 +00:00
xfs_error.c Sync XFS for FreeBSD tree with newer changes from SGI XFS for Linux tree. 2006-06-09 06:04:06 +00:00
xfs_error.h Sync XFS for FreeBSD tree with newer changes from SGI XFS for Linux tree. 2006-06-09 06:04:06 +00:00
xfs_extfree_item.c Sync XFS for FreeBSD tree with newer changes from SGI XFS for Linux tree. 2006-06-09 06:04:06 +00:00
xfs_extfree_item.h Sync XFS for FreeBSD tree with newer changes from SGI XFS for Linux tree. 2006-06-09 06:04:06 +00:00
xfs_fs.h Change %llx to %jx in printf() to eliminate warnings on 64-bit platforms. 2006-06-09 06:57:00 +00:00
xfs_fsops.c Sync XFS for FreeBSD tree with newer changes from SGI XFS for Linux tree. 2006-06-09 06:04:06 +00:00
xfs_fsops.h Sync XFS for FreeBSD tree with newer changes from SGI XFS for Linux tree. 2006-06-09 06:04:06 +00:00
xfs_ialloc_btree.c Sync XFS for FreeBSD tree with newer changes from SGI XFS for Linux tree. 2006-06-09 06:04:06 +00:00
xfs_ialloc_btree.h Sync XFS for FreeBSD tree with newer changes from SGI XFS for Linux tree. 2006-06-09 06:04:06 +00:00
xfs_ialloc.c Sync XFS for FreeBSD tree with newer changes from SGI XFS for Linux tree. 2006-06-09 06:04:06 +00:00
xfs_ialloc.h Sync XFS for FreeBSD tree with newer changes from SGI XFS for Linux tree. 2006-06-09 06:04:06 +00:00
xfs_iget.c More changes due to latest XFS import. 2006-06-09 06:07:42 +00:00
xfs_imap.h Sync XFS for FreeBSD tree with newer changes from SGI XFS for Linux tree. 2006-06-09 06:04:06 +00:00
xfs_inode_item.c Sync XFS for FreeBSD tree with newer changes from SGI XFS for Linux tree. 2006-06-09 06:04:06 +00:00
xfs_inode_item.h Sync XFS for FreeBSD tree with newer changes from SGI XFS for Linux tree. 2006-06-09 06:04:06 +00:00
xfs_inode.c Sync XFS for FreeBSD tree with newer changes from SGI XFS for Linux tree. 2006-06-09 06:04:06 +00:00
xfs_inode.h Sync XFS for FreeBSD tree with newer changes from SGI XFS for Linux tree. 2006-06-09 06:04:06 +00:00
xfs_inum.h Sync XFS for FreeBSD tree with newer changes from SGI XFS for Linux tree. 2006-06-09 06:04:06 +00:00
xfs_iocore.c Sync XFS for FreeBSD tree with newer changes from SGI XFS for Linux tree. 2006-06-09 06:04:06 +00:00
xfs_iomap.c Sync XFS for FreeBSD tree with newer changes from SGI XFS for Linux tree. 2006-06-09 06:04:06 +00:00
xfs_iomap.h Sync XFS for FreeBSD tree with newer changes from SGI XFS for Linux tree. 2006-06-09 06:04:06 +00:00
xfs_itable.c Sync XFS for FreeBSD tree with newer changes from SGI XFS for Linux tree. 2006-06-09 06:04:06 +00:00
xfs_itable.h Sync XFS for FreeBSD tree with newer changes from SGI XFS for Linux tree. 2006-06-09 06:04:06 +00:00
xfs_log_priv.h Sync XFS for FreeBSD tree with newer changes from SGI XFS for Linux tree. 2006-06-09 06:04:06 +00:00
xfs_log_recover.c Temporarily disable log recovery until we fix panics. 2006-06-10 23:40:58 +00:00
xfs_log_recover.h Sync XFS for FreeBSD tree with newer changes from SGI XFS for Linux tree. 2006-06-09 06:04:06 +00:00
xfs_log.c Sync XFS for FreeBSD tree with newer changes from SGI XFS for Linux tree. 2006-06-09 06:04:06 +00:00
xfs_log.h Sync XFS for FreeBSD tree with newer changes from SGI XFS for Linux tree. 2006-06-09 06:04:06 +00:00
xfs_mac.c
xfs_mac.h Sync XFS for FreeBSD tree with newer changes from SGI XFS for Linux tree. 2006-06-09 06:04:06 +00:00
xfs_mount.c Sync XFS for FreeBSD tree with newer changes from SGI XFS for Linux tree. 2006-06-09 06:04:06 +00:00
xfs_mount.h Sync XFS for FreeBSD tree with newer changes from SGI XFS for Linux tree. 2006-06-09 06:04:06 +00:00
xfs_qmops.c Sync XFS for FreeBSD tree with newer changes from SGI XFS for Linux tree. 2006-06-09 06:04:06 +00:00
xfs_quota.h Sync XFS for FreeBSD tree with newer changes from SGI XFS for Linux tree. 2006-06-09 06:04:06 +00:00
xfs_refcache.c Sync XFS for FreeBSD tree with newer changes from SGI XFS for Linux tree. 2006-06-09 06:04:06 +00:00
xfs_refcache.h Sync XFS for FreeBSD tree with newer changes from SGI XFS for Linux tree. 2006-06-09 06:04:06 +00:00
xfs_rename.c Sync XFS for FreeBSD tree with newer changes from SGI XFS for Linux tree. 2006-06-09 06:04:06 +00:00
xfs_rtalloc.c Sync XFS for FreeBSD tree with newer changes from SGI XFS for Linux tree. 2006-06-09 06:04:06 +00:00
xfs_rtalloc.h Sync XFS for FreeBSD tree with newer changes from SGI XFS for Linux tree. 2006-06-09 06:04:06 +00:00
xfs_rw.c Sync XFS for FreeBSD tree with newer changes from SGI XFS for Linux tree. 2006-06-09 06:04:06 +00:00
xfs_rw.h Sync XFS for FreeBSD tree with newer changes from SGI XFS for Linux tree. 2006-06-09 06:04:06 +00:00
xfs_sb.h Sync XFS for FreeBSD tree with newer changes from SGI XFS for Linux tree. 2006-06-09 06:04:06 +00:00
xfs_trans_ail.c Sync XFS for FreeBSD tree with newer changes from SGI XFS for Linux tree. 2006-06-09 06:04:06 +00:00
xfs_trans_buf.c Sync XFS for FreeBSD tree with newer changes from SGI XFS for Linux tree. 2006-06-09 06:04:06 +00:00
xfs_trans_extfree.c Sync XFS for FreeBSD tree with newer changes from SGI XFS for Linux tree. 2006-06-09 06:04:06 +00:00
xfs_trans_inode.c Sync XFS for FreeBSD tree with newer changes from SGI XFS for Linux tree. 2006-06-09 06:04:06 +00:00
xfs_trans_item.c Sync XFS for FreeBSD tree with newer changes from SGI XFS for Linux tree. 2006-06-09 06:04:06 +00:00
xfs_trans_priv.h Sync XFS for FreeBSD tree with newer changes from SGI XFS for Linux tree. 2006-06-09 06:04:06 +00:00
xfs_trans_space.h Sync XFS for FreeBSD tree with newer changes from SGI XFS for Linux tree. 2006-06-09 06:04:06 +00:00
xfs_trans.c Remove debugging printf 2006-06-11 00:19:00 +00:00
xfs_trans.h Sync XFS for FreeBSD tree with newer changes from SGI XFS for Linux tree. 2006-06-09 06:04:06 +00:00
xfs_types.h Sync XFS for FreeBSD tree with newer changes from SGI XFS for Linux tree. 2006-06-09 06:04:06 +00:00
xfs_utils.c Sync XFS for FreeBSD tree with newer changes from SGI XFS for Linux tree. 2006-06-09 06:04:06 +00:00
xfs_utils.h Sync XFS for FreeBSD tree with newer changes from SGI XFS for Linux tree. 2006-06-09 06:04:06 +00:00
xfs_vfsops.c Sync XFS for FreeBSD tree with newer changes from SGI XFS for Linux tree. 2006-06-09 06:04:06 +00:00
xfs_vnodeops.c Sync XFS for FreeBSD tree with newer changes from SGI XFS for Linux tree. 2006-06-09 06:04:06 +00:00
xfs.h Sync XFS for FreeBSD tree with newer changes from SGI XFS for Linux tree. 2006-06-09 06:04:06 +00:00
xfsidbg.c Sync XFS for FreeBSD tree with newer changes from SGI XFS for Linux tree. 2006-06-09 06:04:06 +00:00