Re: [patch] updates for the pipe code

From: Manfred Spraul (manfreds@colorfullife.com)
Date: Sat Mar 04 2000 - 04:44:23 EST


Manfred Spraul wrote:
>
> without any locking. This is not SMP safe, but you wrote that it also
> happens on UP.
>

I think I spotted the bug:
        
        fifo_open() doesn't initialize PIPE_WAITING_{READERS,WRITERS}.

> if PIPE_WAITING_WRITERS gets stuck at one, then pipe_read(,32k) will not
> return until 32k bytes are written.
>

could you initialize PIPE_WAITING_{READERS,WRITERS} to 1 and boot that
kernel?

* fs/fifo.c, line 40

+ PIPE_WAITING_READERS(*inode) = PIPE_WAITING_WRITERS(*inode) = 1;

* fs/pipe.c, line 556

- PIPE_WAITING_READERS(*inode) = PIPE_WAITING_WRITERS(*inode) = 0;
+ PIPE_WAITING_READERS(*inode) = PIPE_WAITING_WRITERS(*inode) = 1;

AFAIKS, the kernel should boot, and if your shell scripts lock up, then
we are on the right track.

Additionally, one goto look weird: "goto do_more_write" is never
executed, because when the code reaches that if-clause, either
O_NONBLOCK is set, or count is zero.

I also noticed that my patch has a similar problem, I'll post an updated
patch soon.

--
	Manfred

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



This archive was generated by hypermail 2b29 : Tue Mar 07 2000 - 21:00:16 EST