vnode_pager_putpages errors and DOS? [5-STABLE, too]

Uwe Doering gemini at
Mon Nov 22 08:02:40 PST 2004

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 

Uwe Doering         |  EscapeBox - Managed On-Demand UNIX Servers
gemini at  |
-------------- next part --------------
#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 */

	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");

	for (p = buf, lim = p + len; p < lim; p += 4096)
		*p = '0';

	if (munmap(buf, len) == -1)
		err(2, "munmap() failed");


More information about the freebsd-stable mailing list