Date: Mon, 22 Nov 2004 17:02:00 +0100 From: Uwe Doering <gemini@geminix.org> To: Oliver Brandmueller <ob@e-Gitt.NET> Cc: stable@freebsd.org Subject: Re: vnode_pager_putpages errors and DOS? [5-STABLE, too] Message-ID: <41A20D78.3080704@geminix.org> In-Reply-To: <20041122144851.GE62928@e-Gitt.NET> References: <Pine.NEB.3.96L.1041009150440.93055O-100000@fledge.watson.org> <4168578F.7060706@geminix.org> <20041103191641.K63546@is.park.rambler.ru> <4189666A.9020500@geminix.org> <20041104124616.S92154@is.park.rambler.ru> <418BEBC2.3020304@geminix.org> <20041122144851.GE62928@e-Gitt.NET>
next in thread | previous in thread | raw e-mail | index | archive | help
This is a multi-part message in MIME format.
--------------060700070407020504090601
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
Oliver Brandmueller wrote:
> On Fri, Nov 05, 2004 at 10:08:18PM +0100, Uwe Doering wrote:
>
>>I've attached an updated version of the patch for 'vnode_pager.c'. On
>>my test system it resolved the issue. Please let us know whether it
>>works for you as well.
>
> Is there any known way to trigger the problem? I did not yet run into
> any trouble, but actually I don't want to :-)
After a brief search I found my test program again. Please find it
attached to this email. As far as I can tell it should still work.
Nothing complicated, in fact. The program just creates and mmaps a file
that is slightly larger than the available disk space, and then modifies
all pages within the mmapped area so that the syncer has to flush them
out to disk.
In case you would like to try it, please adjust FILENAME and FILELEN.
FILELEN is supposed to be slightly larger than the available disk space.
I ran my tests on a 100 MB file system mounted under '/', since that
was the smalles FS available on that computer. After 30 seconds at max
an unpatched system ought to become unresponsive due to the indefinite
loop I described earlier.
> The patch applies cleanly to 5-STABLE as of today and as far as I could
> see there were no changes to the code which obsolete this patch.
With the attached test program you'll probably find out soon whether PR
and fix apply to RELENG_5 (and possibly above) as well. Please keep us
posted.
Uwe
--
Uwe Doering | EscapeBox - Managed On-Demand UNIX Servers
gemini@geminix.org | http://www.escapebox.net
--------------060700070407020504090601
Content-Type: text/plain;
name="t.c"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
filename="t.c"
#include <stdio.h>
#include <fcntl.h>
#include <unistd.h>
#include <err.h>
#include <sys/types.h>
#include <sys/mman.h>
#define FILENAME "/mnt/test" /* where to put the test file */
#define FILELEN 110 /* test file length in MB */
main()
{
int fd;
size_t len;
char *buf, *p, *lim;
len = FILELEN * 1024 * 1024;
if ((fd = open(FILENAME, O_RDWR|O_CREAT|O_TRUNC, 0666)) == -1)
err(2, "open() failed");
if (ftruncate(fd, len) == -1)
err(2, "ftruncate() failed");
buf = mmap(NULL, len, PROT_WRITE, MAP_SHARED, fd, 0);
if (buf == MAP_FAILED)
err(2, "mmap() failed");
(void)close(fd);
for (p = buf, lim = p + len; p < lim; p += 4096)
*p = '0';
if (munmap(buf, len) == -1)
err(2, "munmap() failed");
exit(0);
}
--------------060700070407020504090601--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?41A20D78.3080704>
