Date: 22 Jan 2002 23:08:52 +1200 From: Benno Rice <benno@jeamland.net> To: Kirk McKusick <mckusick@FreeBSD.org> Cc: cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org Subject: Re: cvs commit: src/sys/ufs/ffs ffs_alloc.c ffs_extern.h ffs_softdep.c Message-ID: <1011697733.442.0.camel@ratchet.jeamland.net> In-Reply-To: <200201220617.g0M6HOx41725@freefall.freebsd.org> References: <200201220617.g0M6HOx41725@freefall.freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
--=-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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?1011697733.442.0.camel>