diff options
author | tegge <tegge@FreeBSD.org> | 2005-10-09 20:07:51 +0000 |
---|---|---|
committer | tegge <tegge@FreeBSD.org> | 2005-10-09 20:07:51 +0000 |
commit | 1448da0d3a2ecdbfd91f46cc28ce3b67d4096868 (patch) | |
tree | e8d4617a5fefb4698e70a1ba609b91f0d118d1b3 /sys/ufs/ffs | |
parent | 62d200d06fea630c4ba1af09988b2f6c025f229d (diff) | |
download | FreeBSD-src-1448da0d3a2ecdbfd91f46cc28ce3b67d4096868.zip FreeBSD-src-1448da0d3a2ecdbfd91f46cc28ce3b67d4096868.tar.gz |
Eliminate a deadlock that can occur when a dirty block belonging to a snapshot
file is flushed by a process not holding snaplk (e.g. bufdaemon). Another
process might hold snaplk and try to access the block due to ffs_copyonwrite
processing.
Diffstat (limited to 'sys/ufs/ffs')
-rw-r--r-- | sys/ufs/ffs/ffs_snapshot.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/sys/ufs/ffs/ffs_snapshot.c b/sys/ufs/ffs/ffs_snapshot.c index 92746be..0dc07e9 100644 --- a/sys/ufs/ffs/ffs_snapshot.c +++ b/sys/ufs/ffs/ffs_snapshot.c @@ -1951,6 +1951,8 @@ ffs_copyonwrite(devvp, bp) int lower, upper, mid, indiroff, error = 0; int launched_async_io, prev_norunningbuf; + if ((VTOI(bp->b_vp)->i_flags & SF_SNAPSHOT) != 0) + return (0); /* Update on a snapshot file */ if (td->td_pflags & TDP_COWINPROGRESS) panic("ffs_copyonwrite: recursive call"); /* |