freebsd-nq/sys/gnu/fs/xfs/FreeBSD
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
..
support Restore changes to spinlock macros before merge. 2006-06-11 00:54:35 +00:00
xfs_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_buf.h Sync XFS for FreeBSD tree with newer changes from SGI XFS for Linux tree. 2006-06-09 06:04:06 +00:00
xfs_compat.h Sync XFS for FreeBSD tree with newer changes from SGI XFS for Linux tree. 2006-06-09 06:04:06 +00:00
xfs_config.h
xfs_cred.h
xfs_dmistubs.c Sync XFS for FreeBSD tree with newer changes from SGI XFS for Linux tree. 2006-06-09 06:04:06 +00:00
xfs_freebsd_iget.c Sync XFS for FreeBSD tree with newer changes from SGI XFS for Linux tree. 2006-06-09 06:04:06 +00:00
xfs_freebsd.h Bring back changes in version 1.3 lost in previous commit. 2006-06-09 06:40:22 +00:00
xfs_frw.c Sync XFS for FreeBSD tree with newer changes from SGI XFS for Linux tree. 2006-06-09 06:04:06 +00:00
xfs_frw.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_subr.c Cope with -Wundef. This means including xfs_macros.h early in a few more 2006-06-01 19:01:47 +00:00
xfs_fs_subr.h
xfs_globals.c Sync XFS for FreeBSD tree with newer changes from SGI XFS for Linux tree. 2006-06-09 06:04:06 +00:00
xfs_ioctl.c Sync XFS for FreeBSD tree with newer changes from SGI XFS for Linux tree. 2006-06-09 06:04:06 +00:00
xfs_iops.h Sync XFS for FreeBSD tree with newer changes from SGI XFS for Linux tree. 2006-06-09 06:04:06 +00:00
xfs_mountops.c Cylinder group bitmaps and blocks containing inode for a snapshot 2007-01-23 10:01:19 +00:00
xfs_mountops.h
xfs_node.h
xfs_stats.c
xfs_stats.h
xfs_super.c Sweep kernel replacing suser(9) calls with priv(9) calls, assigning 2006-11-06 13:42:10 +00:00
xfs_super.h Sync XFS for FreeBSD tree with newer changes from SGI XFS for Linux tree. 2006-06-09 06:04:06 +00:00
xfs_sysctl.c
xfs_sysctl.h Sync XFS for FreeBSD tree with newer changes from SGI XFS for Linux tree. 2006-06-09 06:04:06 +00:00
xfs_version.h
xfs_vfs.c Sync XFS for FreeBSD tree with newer changes from SGI XFS for Linux tree. 2006-06-09 06:04:06 +00:00
xfs_vfs.h Sync XFS for FreeBSD tree with newer changes from SGI XFS for Linux tree. 2006-06-09 06:04:06 +00:00
xfs_vnode.c Sync XFS for FreeBSD tree with newer changes from SGI XFS for Linux tree. 2006-06-09 06:04:06 +00:00
xfs_vnode.h Sync XFS for FreeBSD tree with newer changes from SGI XFS for Linux tree. 2006-06-09 06:04:06 +00:00
xfs_vnops.c Implement vnode operations for setting and removing extended attributes. 2006-06-11 03:32:50 +00:00
xfsdmapistubs.c
xfsquotasstubs.c
xfsrtstubs.c