[PATCH] cifs: ->readpages() fixes

This just ignore the remaining pages, and will fix a forgot put_pages_list().

Signed-off-by: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
Cc: Steven French <sfrench@us.ibm.com>
Cc: Miklos Szeredi <miklos@szeredi.hu>
Cc: Steven Whitehouse <swhiteho@redhat.com>
Cc: Trond Myklebust <trond.myklebust@fys.uio.no>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>

authored by OGAWA Hirofumi and committed by Linus Torvalds 05ac9d4b 029e332e

+1 -22
+1 -22
fs/cifs/file.c
··· 1806 1806 } 1807 1807 if ((rc < 0) || (smb_read_data == NULL)) { 1808 1808 cFYI(1, ("Read error in readpages: %d", rc)); 1809 - /* clean up remaing pages off list */ 1810 - while (!list_empty(page_list) && (i < num_pages)) { 1811 - page = list_entry(page_list->prev, struct page, 1812 - lru); 1813 - list_del(&page->lru); 1814 - page_cache_release(page); 1815 - } 1816 1809 break; 1817 1810 } else if (bytes_read > 0) { 1818 1811 pSMBr = (struct smb_com_read_rsp *)smb_read_data; ··· 1824 1831 this case is ok - if we are at server EOF 1825 1832 we will hit it on next read */ 1826 1833 1827 - /* while (!list_empty(page_list) && (i < num_pages)) { 1828 - page = list_entry(page_list->prev, 1829 - struct page, list); 1830 - list_del(&page->list); 1831 - page_cache_release(page); 1832 - } 1833 - break; */ 1834 + /* break; */ 1834 1835 } 1835 1836 } else { 1836 1837 cFYI(1, ("No bytes read (%d) at offset %lld . " ··· 1832 1845 bytes_read, offset)); 1833 1846 /* BB turn off caching and do new lookup on 1834 1847 file size at server? */ 1835 - while (!list_empty(page_list) && (i < num_pages)) { 1836 - page = list_entry(page_list->prev, struct page, 1837 - lru); 1838 - list_del(&page->lru); 1839 - 1840 - /* BB removeme - replace with zero of page? */ 1841 - page_cache_release(page); 1842 - } 1843 1848 break; 1844 1849 } 1845 1850 if (smb_read_data) {