diff options
author | Konstantin Belousov <kib@FreeBSD.org> | 2007-01-23 10:01:19 +0000 |
---|---|---|
committer | Konstantin Belousov <kib@FreeBSD.org> | 2007-01-23 10:01:19 +0000 |
commit | 2cc7d26f7f9d897fb38b9cf621a73b89a3dd8365 (patch) | |
tree | b0e8fba9d4f75f20a608a5e6e9db64ce7633b0f4 /sys/nfsclient/nfs_vnops.c | |
parent | 1f294570c0b513e3c7f73e495d5105ede3a74dda (diff) | |
download | src-2cc7d26f7f9d897fb38b9cf621a73b89a3dd8365.tar.gz src-2cc7d26f7f9d897fb38b9cf621a73b89a3dd8365.zip |
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)
Notes
Notes:
svn path=/head/; revision=166193
Diffstat (limited to 'sys/nfsclient/nfs_vnops.c')
-rw-r--r-- | sys/nfsclient/nfs_vnops.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/sys/nfsclient/nfs_vnops.c b/sys/nfsclient/nfs_vnops.c index 4308244627d9..c53c913564db 100644 --- a/sys/nfsclient/nfs_vnops.c +++ b/sys/nfsclient/nfs_vnops.c @@ -3275,4 +3275,5 @@ struct buf_ops buf_ops_nfs = { .bop_write = nfs_bwrite, .bop_strategy = bufstrategy, .bop_sync = bufsync, + .bop_bdflush = bufbdflush, }; |