summaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorPavel Shilovsky <pshilovsky@samba.org>2014-10-02 18:13:35 +0200
committerSteve French <smfrench@gmail.com>2014-10-02 21:17:41 +0200
commit1209bbdff2f6bbffa6eb5823033bbd7b8799a5e2 (patch)
treeaf0f44e0266ad9b4e36a2b2eb37e781b72d3288f /fs
parentFix problem recognizing symlinks (diff)
downloadlinux-1209bbdff2f6bbffa6eb5823033bbd7b8799a5e2.tar.xz
linux-1209bbdff2f6bbffa6eb5823033bbd7b8799a5e2.zip
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: Pavel Shilovsky <pshilovsky@samba.org> Signed-off-by: Steve French <smfrench@gmail.com> Tested-by: Arthur Marsh <arthur.marsh@internode.on.net>
Diffstat (limited to '')
-rw-r--r--fs/cifs/file.c8
1 files changed, 1 insertions, 7 deletions
diff --git a/fs/cifs/file.c b/fs/cifs/file.c
index 7c018a1c52f7..5f29354b072a 100644
--- a/fs/cifs/file.c
+++ b/fs/cifs/file.c
@@ -3568,15 +3568,9 @@ static int cifs_readpages(struct file *file, struct address_space *mapping,
lru_cache_add_file(page);
unlock_page(page);
page_cache_release(page);
- 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);
- continue;
- }
break;
}