aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfs/pnfs.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/nfs/pnfs.c')
-rw-r--r--fs/nfs/pnfs.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/fs/nfs/pnfs.c b/fs/nfs/pnfs.c
index 0c7e0d45a4de..0fbe734cc38c 100644
--- a/fs/nfs/pnfs.c
+++ b/fs/nfs/pnfs.c
@@ -361,8 +361,10 @@ pnfs_layout_remove_lseg(struct pnfs_layout_hdr *lo,
361 list_del_init(&lseg->pls_list); 361 list_del_init(&lseg->pls_list);
362 /* Matched by pnfs_get_layout_hdr in pnfs_layout_insert_lseg */ 362 /* Matched by pnfs_get_layout_hdr in pnfs_layout_insert_lseg */
363 atomic_dec(&lo->plh_refcount); 363 atomic_dec(&lo->plh_refcount);
364 if (list_empty(&lo->plh_segs)) 364 if (list_empty(&lo->plh_segs)) {
365 set_bit(NFS_LAYOUT_INVALID_STID, &lo->plh_flags);
365 clear_bit(NFS_LAYOUT_BULK_RECALL, &lo->plh_flags); 366 clear_bit(NFS_LAYOUT_BULK_RECALL, &lo->plh_flags);
367 }
366 rpc_wake_up(&NFS_SERVER(inode)->roc_rpcwaitq); 368 rpc_wake_up(&NFS_SERVER(inode)->roc_rpcwaitq);
367} 369}
368 370
@@ -1290,6 +1292,7 @@ alloc_init_layout_hdr(struct inode *ino,
1290 INIT_LIST_HEAD(&lo->plh_bulk_destroy); 1292 INIT_LIST_HEAD(&lo->plh_bulk_destroy);
1291 lo->plh_inode = ino; 1293 lo->plh_inode = ino;
1292 lo->plh_lc_cred = get_rpccred(ctx->cred); 1294 lo->plh_lc_cred = get_rpccred(ctx->cred);
1295 lo->plh_flags |= 1 << NFS_LAYOUT_INVALID_STID;
1293 return lo; 1296 return lo;
1294} 1297}
1295 1298
@@ -1297,6 +1300,8 @@ static struct pnfs_layout_hdr *
1297pnfs_find_alloc_layout(struct inode *ino, 1300pnfs_find_alloc_layout(struct inode *ino,
1298 struct nfs_open_context *ctx, 1301 struct nfs_open_context *ctx,
1299 gfp_t gfp_flags) 1302 gfp_t gfp_flags)
1303 __releases(&ino->i_lock)
1304 __acquires(&ino->i_lock)
1300{ 1305{
1301 struct nfs_inode *nfsi = NFS_I(ino); 1306 struct nfs_inode *nfsi = NFS_I(ino);
1302 struct pnfs_layout_hdr *new = NULL; 1307 struct pnfs_layout_hdr *new = NULL;
@@ -1565,8 +1570,7 @@ lookup_again:
1565 * stateid, or it has been invalidated, then we must use the open 1570 * stateid, or it has been invalidated, then we must use the open
1566 * stateid. 1571 * stateid.
1567 */ 1572 */
1568 if (lo->plh_stateid.seqid == 0 || 1573 if (test_bit(NFS_LAYOUT_INVALID_STID, &lo->plh_flags)) {
1569 test_bit(NFS_LAYOUT_INVALID_STID, &lo->plh_flags)) {
1570 1574
1571 /* 1575 /*
1572 * The first layoutget for the file. Need to serialize per 1576 * The first layoutget for the file. Need to serialize per