Fwd: [PATCH v2 01/16] CIFS: Fix async reading on reconnects

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



---------- Forwarded message ----------
From: Steve French <smfrench@xxxxxxxxx>
Date: Fri, Jun 27, 2014 at 9:12 AM
Subject: Re: [PATCH v2 01/16] CIFS: Fix async reading on reconnects
To: Jeff Layton <jlayton@xxxxxxxxxxxxxxx>
Cc: Pavel Shilovsky <pshilovsky@xxxxxxxxx>,
"linux-cifs@xxxxxxxxxxxxxxx" <linux-cifs@xxxxxxxxxxxxxxx>





On Fri, Jun 27, 2014 at 5:52 AM, Jeff Layton <jlayton@xxxxxxxxxxxxxxx> wrote:
>
> On Fri, 27 Jun 2014 13:57:38 +0400
> Pavel Shilovsky <pshilovsky@xxxxxxxxx> 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 majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux