[pnfs] [PATCH 08/11] pnfs: enable short read handling for all drivers

Fred Isaman iisaman at citi.umich.edu
Thu Apr 10 10:05:08 EDT 2008


The nfs short read infrastructure is useful even for layout drivers
that set PNFS_NO_RPC, so enable it.  In particular, it is necessary
for the correct functioning of nfs_readpage_result_partial for the
(NO_RPC) layout drivers to either enable short read handling, or
ensure they return an error in task->tk_status upon a short read.

Signed-off-by: Fred Isaman <iisaman at citi.umich.edu>
---
 fs/nfs/read.c |   11 +++++++----
 1 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/fs/nfs/read.c b/fs/nfs/read.c
index 4055126..774a21a 100644
--- a/fs/nfs/read.c
+++ b/fs/nfs/read.c
@@ -375,10 +375,6 @@ static int nfs_readpage_retry(struct rpc_task *task, struct nfs_read_data *data)
 	struct nfs_readargs *argp = &data->args;
 	struct nfs_readres *resp = &data->res;
 
-#ifdef CONFIG_PNFS
-	if (data->pnfsflags & PNFS_NO_RPC)
-		return 0;
-#endif /* CONFIG_PNFS */
 	if (resp->eof || resp->count == argp->count)
 		return 0;
 
@@ -392,6 +388,13 @@ static int nfs_readpage_retry(struct rpc_task *task, struct nfs_read_data *data)
 	argp->offset += resp->count;
 	argp->pgbase += resp->count;
 	argp->count -= resp->count;
+#ifdef CONFIG_PNFS
+	if (data->pnfsflags & PNFS_NO_RPC) {
+		/* Note can't use return value, shouldn't really have one */
+		pnfs_try_to_read_data(data, data->call_ops);
+		return -EAGAIN;
+	}
+#endif /* CONFIG_PNFS */
 	rpc_restart_call(task);
 	return -EAGAIN;
 }
-- 
1.5.3.3



More information about the pNFS mailing list