summaryrefslogtreecommitdiff
path: root/usr/src/uts/common/fs/vfs.c
diff options
context:
space:
mode:
authorJerry Jelinek <jerry.jelinek@joyent.com>2016-12-07 12:47:12 +0000
committerJerry Jelinek <jerry.jelinek@joyent.com>2016-12-07 12:47:12 +0000
commita1b5b02d283a933de7f074a68398486a187f7e67 (patch)
treee2b2b71ff380bf5663f7063501c0a991617e6d2a /usr/src/uts/common/fs/vfs.c
parent7662705473b5736c9bcb3d7ace7cd1ae5c2f784d (diff)
parentfdff6cea3adcb1f377a673bc22c427ce25917f05 (diff)
downloadillumos-joyent-release-20161208.tar.gz
[illumos-gate merge]release-20161208
commit fdff6cea3adcb1f377a673bc22c427ce25917f05 7652 libficl build should depend on libuuid commit 3f11de9ddb9e8b567df284c7f495ac53076611c4 7605 we should not attempt to write to ZFS while panicing
Diffstat (limited to 'usr/src/uts/common/fs/vfs.c')
-rw-r--r--usr/src/uts/common/fs/vfs.c45
1 files changed, 6 insertions, 39 deletions
diff --git a/usr/src/uts/common/fs/vfs.c b/usr/src/uts/common/fs/vfs.c
index fe99756e79..7ec4e6d90c 100644
--- a/usr/src/uts/common/fs/vfs.c
+++ b/usr/src/uts/common/fs/vfs.c
@@ -23,6 +23,7 @@
* Copyright 2016 Joyent, Inc.
* Copyright 2015 Nexenta Systems, Inc. All rights reserved.
* Copyright 2016 Toomas Soome <tsoome@me.com>
+ * Copyright (c) 2016 by Delphix. All rights reserved.
*/
/* Copyright (c) 1983, 1984, 1985, 1986, 1987, 1988, 1989 AT&T */
@@ -4045,9 +4046,6 @@ vfs_unrefvfssw(struct vfssw *vswp)
mutex_exit(&vswp->vsw_lock);
}
-int sync_timeout = 30; /* timeout for syncing a page during panic */
-int sync_timeleft; /* portion of sync_timeout remaining */
-
static int sync_retries = 20; /* number of retries when not making progress */
static int sync_triesleft; /* portion of sync_retries remaining */
@@ -4058,23 +4056,13 @@ static int new_bufcnt, old_bufcnt;
* Sync all of the mounted filesystems, and then wait for the actual i/o to
* complete. We wait by counting the number of dirty pages and buffers,
* pushing them out using bio_busy() and page_busy(), and then counting again.
- * This routine is used during both the uadmin A_SHUTDOWN code as well as
- * the SYNC phase of the panic code (see comments in panic.c). It should only
+ * This routine is used during the uadmin A_SHUTDOWN code. It should only
* be used after some higher-level mechanism has quiesced the system so that
* new writes are not being initiated while we are waiting for completion.
*
- * To ensure finite running time, our algorithm uses two timeout mechanisms:
- * sync_timeleft (a timer implemented by the omnipresent deadman() cyclic), and
- * sync_triesleft (a progress counter used by the vfs_syncall() loop below).
- * Together these ensure that syncing completes if our i/o paths are stuck.
- * The counters are declared above so they can be found easily in the debugger.
- *
- * The sync_timeleft counter is reset by bio_busy() and page_busy() using the
- * vfs_syncprogress() subroutine whenever we make progress through the lists of
- * pages and buffers. It is decremented and expired by the deadman() cyclic.
- * When vfs_syncall() decides it is done, we disable the deadman() counter by
- * setting sync_timeleft to zero. This timer guards against vfs_syncall()
- * deadlocking or hanging inside of a broken filesystem or driver routine.
+ * To ensure finite running time, our algorithm uses sync_triesleft (a progress
+ * counter used by the vfs_syncall() loop below). It is declared above so
+ * it can be found easily in the debugger.
*
* The sync_triesleft counter is updated by vfs_syncall() itself. If we make
* sync_retries consecutive calls to bio_busy() and page_busy() without
@@ -4088,13 +4076,11 @@ void
vfs_syncall(void)
{
if (rootdir == NULL && !modrootloaded)
- return; /* panic during boot - no filesystems yet */
+ return; /* no filesystems have been loaded yet */
printf("syncing file systems...");
- vfs_syncprogress();
sync();
- vfs_syncprogress();
sync_triesleft = sync_retries;
old_bufcnt = new_bufcnt = INT_MAX;
@@ -4106,7 +4092,6 @@ vfs_syncall(void)
new_bufcnt = bio_busy(B_TRUE);
new_pgcnt = page_busy(B_TRUE);
- vfs_syncprogress();
if (new_bufcnt == 0 && new_pgcnt == 0)
break;
@@ -4129,28 +4114,10 @@ vfs_syncall(void)
else
printf(" done\n");
- sync_timeleft = 0;
delay(hz);
}
/*
- * If we are in the middle of the sync phase of panic, reset sync_timeleft to
- * sync_timeout to indicate that we are making progress and the deadman()
- * omnipresent cyclic should not yet time us out. Note that it is safe to
- * store to sync_timeleft here since the deadman() is firing at high-level
- * on top of us. If we are racing with the deadman(), either the deadman()
- * will decrement the old value and then we will reset it, or we will
- * reset it and then the deadman() will immediately decrement it. In either
- * case, correct behavior results.
- */
-void
-vfs_syncprogress(void)
-{
- if (panicstr)
- sync_timeleft = sync_timeout;
-}
-
-/*
* Map VFS flags to statvfs flags. These shouldn't really be separate
* flags at all.
*/