aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfs/pnfs.c
diff options
context:
space:
mode:
authorWeston Andros Adamson <dros@netapp.com>2013-02-28 20:30:10 -0500
committerTrond Myklebust <Trond.Myklebust@netapp.com>2013-02-28 20:41:35 -0500
commit3000512137602b84d1ad5fd89d62984993a19bb6 (patch)
treead75f7487669d2977fa1fcb0b45de533c35f29e2 /fs/nfs/pnfs.c
parentedddbb1eda61753c886a3c5e159293a7b3a9e30a (diff)
NFSv4.1: LAYOUTGET EDELAY loops timeout to the MDS
The client will currently try LAYOUTGETs forever if a server is returning NFS4ERR_LAYOUTTRYLATER or NFS4ERR_RECALLCONFLICT - even if the client no longer needs the layout (ie process killed, unmounted). This patch uses the DS timeout value (module parameter 'dataserver_timeo' via rpc layer) to set an upper limit of how long the client tries LATOUTGETs in this situation. Once the timeout is reached, IO is redirected to the MDS. This also changes how the client checks if a layout is on the clp list to avoid a double list_add. Signed-off-by: Weston Andros Adamson <dros@netapp.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs/nfs/pnfs.c')
-rw-r--r--fs/nfs/pnfs.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/fs/nfs/pnfs.c b/fs/nfs/pnfs.c
index 97767c8683f9..48ac5aad6258 100644
--- a/fs/nfs/pnfs.c
+++ b/fs/nfs/pnfs.c
@@ -1181,7 +1181,7 @@ pnfs_update_layout(struct inode *ino,
1181 struct nfs_client *clp = server->nfs_client; 1181 struct nfs_client *clp = server->nfs_client;
1182 struct pnfs_layout_hdr *lo; 1182 struct pnfs_layout_hdr *lo;
1183 struct pnfs_layout_segment *lseg = NULL; 1183 struct pnfs_layout_segment *lseg = NULL;
1184 bool first = false; 1184 bool first;
1185 1185
1186 if (!pnfs_enabled_sb(NFS_SERVER(ino))) 1186 if (!pnfs_enabled_sb(NFS_SERVER(ino)))
1187 goto out; 1187 goto out;
@@ -1215,10 +1215,9 @@ pnfs_update_layout(struct inode *ino,
1215 goto out_unlock; 1215 goto out_unlock;
1216 atomic_inc(&lo->plh_outstanding); 1216 atomic_inc(&lo->plh_outstanding);
1217 1217
1218 if (list_empty(&lo->plh_segs)) 1218 first = list_empty(&lo->plh_layouts) ? true : false;
1219 first = true;
1220
1221 spin_unlock(&ino->i_lock); 1219 spin_unlock(&ino->i_lock);
1220
1222 if (first) { 1221 if (first) {
1223 /* The lo must be on the clp list if there is any 1222 /* The lo must be on the clp list if there is any
1224 * chance of a CB_LAYOUTRECALL(FILE) coming in. 1223 * chance of a CB_LAYOUTRECALL(FILE) coming in.