aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfs
diff options
context:
space:
mode:
Diffstat (limited to 'fs/nfs')
-rw-r--r--fs/nfs/pnfs.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/fs/nfs/pnfs.c b/fs/nfs/pnfs.c
index 2d25670bbe44..fa00b56f176a 100644
--- a/fs/nfs/pnfs.c
+++ b/fs/nfs/pnfs.c
@@ -1288,7 +1288,6 @@ pnfs_update_layout(struct inode *ino,
1288 struct nfs_client *clp = server->nfs_client; 1288 struct nfs_client *clp = server->nfs_client;
1289 struct pnfs_layout_hdr *lo; 1289 struct pnfs_layout_hdr *lo;
1290 struct pnfs_layout_segment *lseg = NULL; 1290 struct pnfs_layout_segment *lseg = NULL;
1291 bool first;
1292 1291
1293 if (!pnfs_enabled_sb(NFS_SERVER(ino))) 1292 if (!pnfs_enabled_sb(NFS_SERVER(ino)))
1294 goto out; 1293 goto out;
@@ -1321,16 +1320,15 @@ pnfs_update_layout(struct inode *ino,
1321 if (pnfs_layoutgets_blocked(lo, 0)) 1320 if (pnfs_layoutgets_blocked(lo, 0))
1322 goto out_unlock; 1321 goto out_unlock;
1323 atomic_inc(&lo->plh_outstanding); 1322 atomic_inc(&lo->plh_outstanding);
1324
1325 first = list_empty(&lo->plh_layouts) ? true : false;
1326 spin_unlock(&ino->i_lock); 1323 spin_unlock(&ino->i_lock);
1327 1324
1328 if (first) { 1325 if (list_empty(&lo->plh_layouts)) {
1329 /* The lo must be on the clp list if there is any 1326 /* The lo must be on the clp list if there is any
1330 * chance of a CB_LAYOUTRECALL(FILE) coming in. 1327 * chance of a CB_LAYOUTRECALL(FILE) coming in.
1331 */ 1328 */
1332 spin_lock(&clp->cl_lock); 1329 spin_lock(&clp->cl_lock);
1333 list_add_tail(&lo->plh_layouts, &server->layouts); 1330 if (list_empty(&lo->plh_layouts))
1331 list_add_tail(&lo->plh_layouts, &server->layouts);
1334 spin_unlock(&clp->cl_lock); 1332 spin_unlock(&clp->cl_lock);
1335 } 1333 }
1336 1334