freebsd-nq/sys/fs
David Xu 12a480fa41 When a thread is blocked in direct write state, it only sets PIPE_DIRECTW
flag but not PIPE_WANTW, but FIFO pipe code does not understand this internal
state, when a FIFO peer reader closes the pipe, it wants to notify the writer,
it checks PIPE_WANTW, if not set, it skips calling wakeup(), so blocked writer
never noticed the case, but in general, the writer should return from the
syscall with EPIPE error code and may get SIGPIPE signal. Setting the
PIPE_WANTW fixed problem, or you can turn off direct write, it should fix the
problem too. This bug is found by PR/170203.

Another bug in FIFO pipe code is when peer closes the pipe, another end which
is being blocked in select() or poll() is not notified, it missed to call
pipeselwakeup().

Third problem is found in poll regression test, the existing code can not
pass 6b,6c,6d tests, but FreeBSD-4 works. This commit does not fix the
problem, I still need to study more to find the cause.

PR: 170203
Tested by: Garrett Copper < yanegomi at gmail dot com >
2012-07-31 02:00:37 +00:00
..
cd9660 Use NULL instead of 0 for pointers 2012-07-22 15:40:31 +00:00
coda Replace the MNT_VNODE_FOREACH interface with MNT_VNODE_FOREACH_ALL. 2012-04-17 16:28:22 +00:00
deadfs
devfs Extend the KPI to lock and unlock f_offset member of struct file. It 2012-07-02 21:01:03 +00:00
ext2fs Use NULL instead of 0 for pointers 2012-07-22 15:40:31 +00:00
fdescfs Use NULL instead of 0 2012-03-13 10:04:13 +00:00
fifofs When a thread is blocked in direct write state, it only sets PIPE_DIRECTW 2012-07-31 02:00:37 +00:00
hpfs Use C99-style initialization for struct dirent in preparation for 2012-05-25 09:16:59 +00:00
msdosfs Use NULL instead of 0 for pointers 2012-07-22 15:40:31 +00:00
nandfs Catch a corner case where ssegs could be 0 and thus i would be 0 and 2012-05-28 16:33:58 +00:00
nfs A problem with the NFSv4 server was reported by Andrew Leonard 2012-05-17 21:52:17 +00:00
nfsclient Do not override an error from uiomove() with (non-)error result from 2012-07-02 09:53:08 +00:00
nfsserver Fix two cases in the new NFS server where a tsleep() is 2012-05-12 22:20:55 +00:00
ntfs Remove a check on MNTK_UPDATE that is not really necessary as it is 2012-07-10 00:23:25 +00:00
nullfs Remove unused thread argument to vrecycle(). 2012-04-23 14:10:34 +00:00
nwfs Rename cache_lookup_times() to cache_lookup() and retire the old API and 2012-02-06 17:00:28 +00:00
portalfs Use NULL instead of 0 for pointers 2012-07-22 15:40:31 +00:00
procfs Add procfs to jail-mountable filesystems. 2012-02-29 00:30:18 +00:00
pseudofs Apply inlined vn_vget_ino() algorithm for ".." lookup in pseudofs. 2012-03-05 11:38:02 +00:00
smbfs Simply error handling by moving the allocation of np down to where it is 2012-07-16 22:07:29 +00:00
tmpfs Remove unused thread argument to vrecycle(). 2012-04-23 14:10:34 +00:00
udf Use NULL instead of 0 for pointers 2012-07-22 15:40:31 +00:00
unionfs Skip directory entries with zero inode number during traversal. 2012-05-16 10:44:09 +00:00