From owner-cvs-all Tue Jan 22 3: 9:25 2002 Delivered-To: cvs-all@freebsd.org Received: from mail.jeamland.net (rafe.jeamland.net [203.18.243.114]) by hub.freebsd.org (Postfix) with ESMTP id AF8A037B419; Tue, 22 Jan 2002 03:09:01 -0800 (PST) Received: from ratchet.int.jeamland.net (ratchet.jeamland.net [210.15.217.227]) by mail.jeamland.net (Postfix) with ESMTP id 7D23A70617; Tue, 22 Jan 2002 22:08:53 +1100 (EST) Subject: Re: cvs commit: src/sys/ufs/ffs ffs_alloc.c ffs_extern.h ffs_softdep.c From: Benno Rice To: Kirk McKusick Cc: cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org In-Reply-To: <200201220617.g0M6HOx41725@freefall.freebsd.org> References: <200201220617.g0M6HOx41725@freefall.freebsd.org> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="=-Jn9y77HfreTvOq10WMOy" X-Mailer: Evolution/1.0.1 Date: 22 Jan 2002 23:08:52 +1200 Message-Id: <1011697733.442.0.camel@ratchet.jeamland.net> Mime-Version: 1.0 Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG --=-Jn9y77HfreTvOq10WMOy Content-Type: multipart/mixed; boundary="=-PVAXLP6DbXelPrJrIoCL" --=-PVAXLP6DbXelPrJrIoCL Content-Type: text/plain Content-Transfer-Encoding: quoted-printable On Tue, 2002-01-22 at 18:17, Kirk McKusick wrote: > mckusick 2002/01/21 22:17:24 PST >=20 > Modified files: > sys/ufs/ffs ffs_alloc.c ffs_extern.h ffs_softdep.c=20 > Log: > This patch fixes a long standing complaint with soft updates in > which small and/or nearly full filesystems would fail with `file > system full' messages when trying to replace a number of existing > files (for example during a system installation). When the allocation > routines are about to fail with a file system full condition, they > make a call to softdep_request_cleanup() which attempts to accelerate > the flushing of pending deletion requests in an effort to free up > space. In the face of filesystem I/O requests that exceed the > available disk transfer capacity, the cleanup request could take > an unbounded amount of time. Thus, the softdep_request_cleanup() > routine will only try for tickdelay seconds (default 2 seconds) > before giving up and returning a filesystem full error. Under typical > conditions, the softdep_request_cleanup() routine is able to free > up space in under fifty milliseconds. This change breaks kernels without softupdates. The attached patch fixes the problem. --=20 Benno Rice benno@jeamland.net --=-PVAXLP6DbXelPrJrIoCL Content-Disposition: attachment; filename=softdep.diff Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Index: ffs_alloc.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /home/ncvs/src/sys/ufs/ffs/ffs_alloc.c,v retrieving revision 1.85 diff -u -r1.85 ffs_alloc.c --- ffs_alloc.c 22 Jan 2002 06:17:22 -0000 1.85 +++ ffs_alloc.c 22 Jan 2002 11:07:35 -0000 @@ -125,7 +125,9 @@ panic("ffs_alloc: missing credential"); #endif /* DIAGNOSTIC */ reclaimed =3D 0; +#ifdef SOFTUPDATES retry: +#endif if (size =3D=3D fs->fs_bsize && fs->fs_cstotal.cs_nbfree =3D=3D 0) goto nospace; if (suser_xxx(cred, NULL, PRISON_ROOT) && @@ -157,11 +159,13 @@ (void) chkdq(ip, (long)-btodb(size), cred, FORCE); #endif nospace: +#ifdef SOFTUPDATES if (fs->fs_pendingblocks > 0 && reclaimed =3D=3D 0) { reclaimed =3D 1; softdep_request_cleanup(fs, ITOV(ip)); goto retry; } +#endif ffs_fserr(fs, cred->cr_uid, "file system full"); uprintf("\n%s: write failed, file system is full\n", fs->fs_fsmnt); return (ENOSPC); @@ -208,7 +212,9 @@ panic("ffs_realloccg: missing credential"); #endif /* DIAGNOSTIC */ reclaimed =3D 0; +#ifdef SOFTUPDATES retry: +#endif if (suser_xxx(cred, NULL, PRISON_ROOT) && freespace(fs, fs->fs_minfree) - numfrags(fs, nsize - osize) < 0) goto nospace; @@ -332,11 +338,13 @@ /* * no space available */ +#ifdef SOFTUPDATES if (fs->fs_pendingblocks > 0 && reclaimed =3D=3D 0) { reclaimed =3D 1; softdep_request_cleanup(fs, vp); goto retry; } +#endif ffs_fserr(fs, cred->cr_uid, "file system full"); uprintf("\n%s: write failed, file system is full\n", fs->fs_fsmnt); return (ENOSPC); --=-PVAXLP6DbXelPrJrIoCL-- --=-Jn9y77HfreTvOq10WMOy Content-Type: application/pgp-signature; name=signature.asc Content-Description: This is a digitally signed message part -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.6 (FreeBSD) Comment: For info see http://www.gnupg.org iEYEABECAAYFAjxNSEQACgkQXjRwWofFmQk5tQCfQjYYCG1wIdEUL4Piw7mYdT2s xv8AnRoWstACJSs5MZeXaXIdpkpP+WpD =bjS4 -----END PGP SIGNATURE----- --=-Jn9y77HfreTvOq10WMOy-- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message