Date: Sat, 8 Feb 2003 15:53:58 +0100 From: Mark Santcroos <marks@ripe.net> To: Ian Dowse <iedowse@maths.tcd.ie> Cc: freebsd-current@FreeBSD.ORG Subject: Re: backgroud fsck is still locking up system (fwd) Message-ID: <20030208145358.GA7480@laptop.6bone.nl> In-Reply-To: <200212071426.aa60667@salmon.maths.tcd.ie> References: <200212070152.gB71qc59094441@beastie.mckusick.com> <200212071426.aa60667@salmon.maths.tcd.ie>
index | next in thread | previous in thread | raw e-mail
On Sat, Dec 07, 2002 at 02:26:39PM +0000, Ian Dowse wrote:
> BTW, I've been using a fsck_ffs modificaton for a while now that
> does something like the disabled kernel I/O slowdown, but from
> userland.
How about the following change (patch included) to make the slowdown optional?
On my laptop I prefer to do the fsck sometimes as fast as possible.
This could be easily made into a rc.conf variable.
Please let me know if you would be interested in that and I will come up
with a patch.
Mark
Index: fsck.h
===================================================================
RCS file: /usr/cvs/src/sbin/fsck_ffs/fsck.h,v
retrieving revision 1.28
diff -u -r1.28 fsck.h
--- fsck.h 16 Sep 2002 11:27:47 -0000 1.28
+++ fsck.h 8 Feb 2003 13:42:18 -0000
@@ -234,6 +234,7 @@
char nflag; /* assume a no response */
char yflag; /* assume a yes response */
int bkgrdflag; /* use a snapshot to run on an active system */
+int noslowdown; /* don't slow down a background fsck */
int bflag; /* location of alternate super block */
int debug; /* output debugging info */
int cvtlevel; /* convert to newer file system format */
Index: fsutil.c
===================================================================
RCS file: /usr/cvs/src/sbin/fsck_ffs/fsutil.c,v
retrieving revision 1.20
diff -u -r1.20 fsutil.c
--- fsutil.c 7 Dec 2002 21:40:31 -0000 1.20
+++ fsutil.c 8 Feb 2003 13:33:54 -0000
@@ -357,12 +357,12 @@
offset = blk;
offset *= dev_bsize;
- if (bkgrdflag)
+ if (bkgrdflag && !noslowdown)
slowio_start();
if (lseek(fd, offset, 0) < 0)
rwerror("SEEK BLK", blk);
else if (read(fd, buf, (int)size) == size) {
- if (bkgrdflag)
+ if (bkgrdflag && !noslowdown)
slowio_end();
return (0);
}
Index: main.c
===================================================================
RCS file: /usr/cvs/src/sbin/fsck_ffs/main.c,v
retrieving revision 1.36
diff -u -r1.36 main.c
--- main.c 21 Aug 2002 18:10:28 -0000 1.36
+++ main.c 8 Feb 2003 13:41:28 -0000
@@ -82,7 +82,7 @@
sync();
skipclean = 1;
- while ((ch = getopt(argc, argv, "b:Bc:dfFm:npy")) != -1) {
+ while ((ch = getopt(argc, argv, "b:Bc:dfFm:npyz")) != -1) {
switch (ch) {
case 'b':
skipclean = 0;
@@ -133,6 +133,10 @@
case 'y':
yflag++;
nflag = 0;
+ break;
+
+ case 'z':
+ noslowdown = 1;
break;
default:
--
Mark Santcroos RIPE Network Coordination Centre
http://www.ripe.net/home/mark/ New Projects Group/TTM
To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-current" in the body of the message
help
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20030208145358.GA7480>
