From owner-freebsd-current Sat Feb 8 6:54: 3 2003 Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 5373137B401 for ; Sat, 8 Feb 2003 06:54:01 -0800 (PST) Received: from birch.ripe.net (birch.ripe.net [193.0.1.96]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4539843F75 for ; Sat, 8 Feb 2003 06:54:00 -0800 (PST) (envelope-from marks@ripe.net) Received: from laptop.6bone.nl (cow.ripe.net [193.0.1.239]) by birch.ripe.net (8.12.5/8.11.6) with SMTP id h18ErwAq020217; Sat, 8 Feb 2003 15:53:58 +0100 Received: (nullmailer pid 7597 invoked by uid 1000); Sat, 08 Feb 2003 14:53:58 -0000 Date: Sat, 8 Feb 2003 15:53:58 +0100 From: Mark Santcroos To: Ian Dowse Cc: freebsd-current@FreeBSD.ORG Subject: Re: backgroud fsck is still locking up system (fwd) Message-ID: <20030208145358.GA7480@laptop.6bone.nl> References: <200212070152.gB71qc59094441@beastie.mckusick.com> <200212071426.aa60667@salmon.maths.tcd.ie> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200212071426.aa60667@salmon.maths.tcd.ie> User-Agent: Mutt/1.4i X-Handles: MS6-6BONE, MS18417-RIPE Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG 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