summaryrefslogtreecommitdiffstats
path: root/sys/geom
diff options
context:
space:
mode:
authorkib <kib@FreeBSD.org>2007-01-23 10:01:19 +0000
committerkib <kib@FreeBSD.org>2007-01-23 10:01:19 +0000
commitfdd50404d125cf6f60a72b7d3483c1d35a62b6b0 (patch)
treeb0e8fba9d4f75f20a608a5e6e9db64ce7633b0f4 /sys/geom
parent7ebb7b7367c8ec8782e3fd7dfa2fdcf410af02e4 (diff)
downloadFreeBSD-src-fdd50404d125cf6f60a72b7d3483c1d35a62b6b0.zip
FreeBSD-src-fdd50404d125cf6f60a72b7d3483c1d35a62b6b0.tar.gz
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)
Diffstat (limited to 'sys/geom')
-rw-r--r--sys/geom/geom_vfs.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/sys/geom/geom_vfs.c b/sys/geom/geom_vfs.c
index bff516b..4a33d22 100644
--- a/sys/geom/geom_vfs.c
+++ b/sys/geom/geom_vfs.c
@@ -50,6 +50,7 @@ static struct buf_ops __g_vfs_bufops = {
.bop_write = bufwrite,
.bop_strategy = g_vfs_strategy,
.bop_sync = bufsync,
+ .bop_bdflush = bufbdflush
};
struct buf_ops *g_vfs_bufops = &__g_vfs_bufops;
OpenPOWER on IntegriCloud