Re: [PATCH] net: 9p: free what was emitted when read count is 0

2021-03-02 Thread Jisheng Zhang
On Tue, 2 Mar 2021 17:08:13 +0900 Dominique Martinet wrote: > > > Jisheng Zhang wrote on Tue, Mar 02, 2021 at 03:39:40PM +0800: > > > Rather than make an exception for 0, how about just removing the if as > > > follow ? > > > > IMHO, we may need to keep the "if" in current logic. When count

Re: [PATCH] net: 9p: free what was emitted when read count is 0

2021-03-02 Thread Dominique Martinet
Jisheng Zhang wrote on Tue, Mar 02, 2021 at 03:39:40PM +0800: > > Rather than make an exception for 0, how about just removing the if as > > follow ? > > IMHO, we may need to keep the "if" in current logic. When count > reaches zero, we need to break the "while(iov_iter_count(to))" loop, so >

Re: [PATCH] net: 9p: free what was emitted when read count is 0

2021-03-02 Thread Jisheng Zhang
On Tue, 2 Mar 2021 13:38:08 +0900 Dominique Martinet wrote: > > > Jisheng Zhang wrote on Mon, Mar 01, 2021 at 11:01:57AM +0800: > > Per my understanding of iov_iter, we need to call iov_iter_advance() > > even when the read out count is 0. I believe we can see this common style > > in other fs.

Re: [PATCH] net: 9p: free what was emitted when read count is 0

2021-03-02 Thread Dominique Martinet
Jisheng Zhang wrote on Mon, Mar 01, 2021 at 11:01:57AM +0800: > Per my understanding of iov_iter, we need to call iov_iter_advance() > even when the read out count is 0. I believe we can see this common style > in other fs. I'm not sure where you see this style, but I don't see exceptions for

Re: [PATCH] net: 9p: free what was emitted when read count is 0

2021-02-28 Thread Jisheng Zhang
On Mon, 1 Mar 2021 11:51:24 +0900 Dominique Martinet wrote: > > > Jisheng Zhang wrote on Mon, Mar 01, 2021 at 10:33:36AM +0800: > > I met below warning when cating a small size(about 80bytes) txt file > > on 9pfs(msize=2097152 is passed to 9p mount option), the reason is we > > miss

Re: [PATCH] net: 9p: free what was emitted when read count is 0

2021-02-28 Thread Dominique Martinet
Jisheng Zhang wrote on Mon, Mar 01, 2021 at 10:33:36AM +0800: > I met below warning when cating a small size(about 80bytes) txt file > on 9pfs(msize=2097152 is passed to 9p mount option), the reason is we > miss iov_iter_advance() if the read count is 0, so we didn't truncate > the pipe, then

[PATCH] net: 9p: free what was emitted when read count is 0

2021-02-28 Thread Jisheng Zhang
I met below warning when cating a small size(about 80bytes) txt file on 9pfs(msize=2097152 is passed to 9p mount option), the reason is we miss iov_iter_advance() if the read count is 0, so we didn't truncate the pipe, then iov_iter_pipe() thinks the pipe is full. Fix it by calling