[Bug 1249] New: use O_DIRECT open file, when read will hang.

From: Martin J. Bligh
Date: Fri Sep 19 2003 - 01:09:40 EST


http://bugme.osdl.org/show_bug.cgi?id=1249

Summary: use O_DIRECT open file, when read will hang.
Kernel Version: 2.6.0-test5-mm2
Status: NEW
Severity: normal
Owner: bugme-janitors@xxxxxxxxxxxxxx
Submitter: hugang@xxxxxxxxxxxx


Steps to reproduce:

rm -f /tmp/1.log
touch /tmp/1.log
echo << EOF > /tmp/hang.c
# include <sys/types.h>
# include <asm/fcntl.h>

main()
{
int i;
char buf[1025];

i = open("/tmp/1.log", O_RDONLY | 040000, 0);
if ( i != -1) {
read(i, buf, 1);
}
printf("'%s'", buf);
}
EOF
gcc -o /tmp/hang /tmp/hang.c
/tmp/hang


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/