@@ -4336,7 +4336,8 @@ readpages_get_pages(struct address_space *mapping, struct list_head *page_list,
43364336			break ;
43374337
43384338		__SetPageLocked (page );
4339- 		if  (add_to_page_cache_locked (page , mapping , page -> index , gfp )) {
4339+ 		rc  =  add_to_page_cache_locked (page , mapping , page -> index , gfp );
4340+ 		if  (rc ) {
43404341			__ClearPageLocked (page );
43414342			break ;
43424343		}
@@ -4352,6 +4353,7 @@ static int cifs_readpages(struct file *file, struct address_space *mapping,
43524353	struct  list_head  * page_list , unsigned  num_pages )
43534354{
43544355	int  rc ;
4356+ 	int  err  =  0 ;
43554357	struct  list_head  tmplist ;
43564358	struct  cifsFileInfo  * open_file  =  file -> private_data ;
43574359	struct  cifs_sb_info  * cifs_sb  =  CIFS_FILE_SB (file );
@@ -4396,7 +4398,7 @@ static int cifs_readpages(struct file *file, struct address_space *mapping,
43964398	 * the order of declining indexes. When we put the pages in 
43974399	 * the rdata->pages, then we want them in increasing order. 
43984400	 */ 
4399- 	while  (!list_empty (page_list )) {
4401+ 	while  (!list_empty (page_list )  &&  ! err ) {
44004402		unsigned int   i , nr_pages , bytes , rsize ;
44014403		loff_t  offset ;
44024404		struct  page  * page , * tpage ;
@@ -4429,9 +4431,10 @@ static int cifs_readpages(struct file *file, struct address_space *mapping,
44294431			return  0 ;
44304432		}
44314433
4432- 		rc  =  readpages_get_pages (mapping , page_list , rsize , & tmplist ,
4434+ 		nr_pages  =  0 ;
4435+ 		err  =  readpages_get_pages (mapping , page_list , rsize , & tmplist ,
44334436					 & nr_pages , & offset , & bytes );
4434- 		if  (rc ) {
4437+ 		if  (! nr_pages ) {
44354438			add_credits_and_wake_if (server , credits , 0 );
44364439			break ;
44374440		}
0 commit comments