Subject: kern/36429: EIO with puffs/dtfs
To: None <kern-bug-people@netbsd.org, gnats-admin@netbsd.org,>
From: None <yamt@mwd.biglobe.ne.jp>
List: netbsd-bugs
Date: 06/02/2007 19:30:00
>Number: 36429
>Category: kern
>Synopsis: EIO with puffs/dtfs
>Confidential: no
>Severity: serious
>Priority: low
>Responsible: kern-bug-people
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Sat Jun 02 19:30:00 +0000 2007
>Originator: YAMAMOTO Takashi <yamt@mwd.biglobe.ne.jp>
>Release: NetBSD 4.99.20
>Organization:
>Environment:
Architecture: i386
Machine: i386
>Description:
a strange EIO with the following code.
% sudo ./obj/dtfs /mnt
% mount
<snip>
puffs:dt on /mnt type puffs
<snip>
% cc a.c
% ./a.out /mnt/b
a.out: pwrite2: Input/output error
-------------------------------------------------- a.c
#include <err.h>
#include <fcntl.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
int
main(int argc, char *argv[])
{
const char *filename;
int fd;
ssize_t ssz;
char buf[1024*1024];
filename = argv[1];
fd = open(filename, O_RDWR|O_CREAT|O_TRUNC, 0666);
if (fd < 0)
err(1, "open");
memset(buf, 'A', sizeof(buf));
ssz = pwrite(fd, buf, 1, 0x1000);
if (ssz == -1) {
warn("pwrite1");
}
memset(buf, 'B', sizeof(buf));
ssz = pwrite(fd, buf, 2, 0xfff);
if (ssz == -1) {
warn("pwrite2");
}
exit(0);
}
--------------------------------------------------
>How-To-Repeat:
see above.
>Fix:
>Unformatted: