---------- Forwarded message ---------- From: Steve French <[email protected]> Date: Fri, Jun 27, 2014 at 9:12 AM Subject: Re: [PATCH v2 01/16] CIFS: Fix async reading on reconnects To: Jeff Layton <[email protected]> Cc: Pavel Shilovsky <[email protected]>, "[email protected]" <[email protected]>
On Fri, Jun 27, 2014 at 5:52 AM, Jeff Layton <[email protected]> wrote: > > On Fri, 27 Jun 2014 13:57:38 +0400 > Pavel Shilovsky <[email protected]> wrote: > > > If we get into read_into_pages() from cifs_readv_receive() and then > > loose a network, we issue cifs_reconnect that moves all mids to > > a private list and issue their callbacks. The callback of the async > > read request sets a mid to retry, frees it and wakes up a process > > that waits on the rdata completion. > > > > After the connection is established we return from read_into_pages() > > with a short read, use the mid that was freed before and try to read > > the remaining data from the a newly created socket. Both actions are > > not what we want to do. In reconnect cases (-EAGAIN) we should not > > mask off the error with a short read but should return the error > > code instead. > > > > I'm not sure I understand what problem this solves. Why is returning a > short read wrong here? > It will oops since the mid has already been freed and the caller uses the mid (cifs_readv_receive calls dequeue_mid with the mid). rdata->read_into_pages succeeded with a short read so length > 0 but the mid was freed due to the reconnect -- Thanks, Steve -- Thanks, Steve -- To unsubscribe from this list: send the line "unsubscribe linux-cifs" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
