kern/141177: fsync() on FIFO causes panic() on zfs
Dominik Ernst
dernst at gmx.de
Fri Dec 4 22:40:03 UTC 2009
>Number: 141177
>Category: kern
>Synopsis: fsync() on FIFO causes panic() on zfs
>Confidential: no
>Severity: serious
>Priority: low
>Responsible: freebsd-bugs
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: sw-bug
>Submitter-Id: current-users
>Arrival-Date: Fri Dec 04 22:40:02 UTC 2009
>Closed-Date:
>Last-Modified:
>Originator: Dominik Ernst
>Release: 8.0-RELEASE
>Organization:
>Environment:
FreeBSD traal 8.0-RELEASE FreeBSD 8.0-RELEASE #0: Sun Nov 29 01:42:39 UTC 2009 root@:/usr/obj/usr/src/sys/GENERIC amd64
>Description:
Having created a FIFO on a zfs filesystem with someone reading on it, causes a panic() if you write() and fsync() on it. Seems zfs related since I could not reproduce it with a FIFO on a UFS filesystem.
Reproduced it so far on two different machines running 8.0/amd64 and once in VirtualBox using stock kernel and base system for 8.0/i386.
>How-To-Repeat:
mkfifo /mnt/zfs/testpipe
tail -f /mnt/zfs/testpipe &
cc test.c -o test
./test
with ./test.c being something like this:
#include <sys/types.h>
#include <unistd.h>
#include <fcntl.h>
int main(void) {
char fifo[] = "/mnt/zfs/testpipe";
int fd;
fd = open(fifo, O_WRONLY);
if(fd < 0) {
perror("open");
return 1;
}
write(fd, "asdf\n", sizeof(char)*5);
fsync(fd);
close(fd);
return 0;
}
alternatively vim from ports can be used too, typing something like this on an opened file:
:w >> /mnt/zfs/testpipe
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted:
More information about the freebsd-bugs
mailing list