Skip to contentSkip to conversation

kNFSd - 1 of 8 - Fix bug in svc_pushback_unused_pages that occurs on zero byte NFS read

PATCH New NeilBrown 1 participant 1 message Jun 17, 2003

Subsystems (2)
lore
Share & tools
lore

NeilBrown

author
#0 lore raw

PATCH 1/1 kNFSd - 1 of 8 - Fix bug in svc_pushback_unused_pages that occurs on zero byte NFS read

Here come 8 kNFSd patches for 2.5.72.
Several are nfsv4 related, but the first two are more generally applicable.

NeilBrown
### Comments for ChangeSet

svc_pushback_unused_pages must be ready of the possibility that no pages were allocated or will need to be pushed back.

----------- Diffstat output ------------

 ./include/linux/sunrpc/svc.h |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)
include/linux/sunrpc/svc.h renamed from include/linux/sunrpc/svc.h~current~ +3 -3
diff ./include/linux/sunrpc/svc.h~current~ ./include/linux/sunrpc/svc.h
@@ -196,14 +196,14 @@ static inline void svc_pushback_allpages
 
 static inline void svc_pushback_unused_pages(struct svc_rqst *rqstp)
 {
-        while (rqstp->rq_resused) {
+	while (rqstp->rq_resused &&
+	       rqstp->rq_res.pages != &rqstp->rq_respages[rqstp->rq_resused]) {
+
 		if (rqstp->rq_respages[--rqstp->rq_resused] != NULL) {
 			rqstp->rq_argpages[rqstp->rq_arghi++] =
 				rqstp->rq_respages[rqstp->rq_resused];
 			rqstp->rq_respages[rqstp->rq_resused] = NULL;
 		}
-		if (rqstp->rq_res.pages == &rqstp->rq_respages[rqstp->rq_resused])
-			break;
 	}
 }
 

-------------------------------------------------------
This SF.Net email is sponsored by: INetU
Attention Web Developers & Consultants: Become An INetU Hosting Partner. Refer Dedicated Servers. We Manage Them. You Get 10% Monthly Commission! INetU Dedicated Managed Hosting http://www.inetu.net/partner/index.php
_______________________________________________
NFS maillist - [email protected]
https://lists.sourceforge.net/lists/listinfo/nfs