From dbd6e343b70c101fb43896110aed7d9b3442a1e9 Mon Sep 17 00:00:00 2001 From: Trond Myklebust Date: Mon, 11 Mar 2002 22:04:53 -0800 Subject: [PATCH] 2.5.6 correct NFS client handling of EJUKEBOX error... The following patch resyncs 2.5.6 with the 2.4.x series w.r.t. the handling of the EJUKEBOX error. The latter is an NFS-specific error that is returned by servers that support hierarchical storage: it notifies the client that the request cannot be completed in a timely fashion (Imagine for instance a situation where you have a cdrom jukebox system, and the user has just requested a file on another cd). Under these circumstances, the RFC specifies that the request should be retried after suitable timeout during which the server will attempt to perform whatever action is required to make the file available again. --- include/linux/nfs_fs.h | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'include/linux') diff --git a/include/linux/nfs_fs.h b/include/linux/nfs_fs.h index e95a085a2fdd..ef81457b484b 100644 --- a/include/linux/nfs_fs.h +++ b/include/linux/nfs_fs.h @@ -16,6 +16,7 @@ #include #include +#include #include #include @@ -419,6 +420,29 @@ extern void * nfs_root_data(void); __retval; \ }) +#ifdef CONFIG_NFS_V3 + +#define NFS_JUKEBOX_RETRY_TIME (5 * HZ) +static inline int +nfs_async_handle_jukebox(struct rpc_task *task) +{ + if (task->tk_status != -EJUKEBOX) + return 0; + task->tk_status = 0; + rpc_restart_call(task); + rpc_delay(task, NFS_JUKEBOX_RETRY_TIME); + return 1; +} + +#else + +static inline int +nfs_async_handle_jukebox(struct rpc_task *task) +{ + return 0; +} +#endif /* CONFIG_NFS_V3 */ + #endif /* __KERNEL__ */ /* -- cgit v1.2.3