Commit 1209bbdf authored by Pavel Shilovsky's avatar Pavel Shilovsky Committed by Steve French
Browse files

CIFS: Fix readpages retrying on reconnects

If we got a reconnect error from async readv we re-add pages back
to page_list and continue loop. That is wrong because these pages
have been already added to the pagecache but page_list has pages that
have not been added to the pagecache yet. This ends up with a general
protection fault in put_pages after readpages. Fix it by not retrying
the read of these pages and falling back to readpage instead.

Fixes debian bug 762306
Signed-off-by: default avatarPavel Shilovsky <>
Signed-off-by: default avatarSteve French <>
Tested-by: default avatarArthur Marsh <>
parent 19e81573
......@@ -3568,15 +3568,9 @@ static int cifs_readpages(struct file *file, struct address_space *mapping,
if (rc == -EAGAIN)
list_add_tail(&page->lru, &tmplist);
/* Fallback to the readpage in error/reconnect cases */
kref_put(&rdata->refcount, cifs_readdata_release);
if (rc == -EAGAIN) {
/* Re-add pages to the page_list and retry */
list_splice(&tmplist, page_list);
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment