freebsd-dev/sys/nfs4client
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
..
nfs4_dev.c Add better sanity checking to the logic that handles ioctl processing 2006-05-13 00:16:35 +00:00
nfs4_dev.h /* -> /*- for license, minor formatting changes 2005-01-07 01:45:51 +00:00
nfs4_idmap.c /* -> /*- for license, minor formatting changes 2005-01-07 01:45:51 +00:00
nfs4_idmap.h /* -> /*- for license, minor formatting changes 2005-01-07 01:45:51 +00:00
nfs4_socket.c /* -> /*- for license, minor formatting changes 2005-01-07 01:45:51 +00:00
nfs4_subs.c NFSv4 client: 2006-11-28 19:33:28 +00:00
nfs4_vfs_subs.c /* -> /*- for license, minor formatting changes 2005-01-07 01:45:51 +00:00
nfs4_vfs.h /* -> /*- for license, minor formatting changes 2005-01-07 01:45:51 +00:00
nfs4_vfsops.c Fixes up the handling of shared vnode lock lookups in the NFS client, 2006-09-13 18:39:09 +00:00
nfs4_vn_subs.c NFSv4 client: 2006-11-28 19:33:28 +00:00
nfs4_vn.h /* -> /*- for license, minor formatting changes 2005-01-07 01:45:51 +00:00
nfs4_vnops.c Cylinder group bitmaps and blocks containing inode for a snapshot 2007-01-23 10:01:19 +00:00
nfs4.h /* -> /*- for license, minor formatting changes 2005-01-07 01:45:51 +00:00
nfs4m_subs.h /* -> /*- for license, minor formatting changes 2005-01-07 01:45:51 +00:00