提交 70d2f7b1 编写于 作者: T Trond Myklebust

pNFS: Use the standard I/O stateid when calling LAYOUTGET

Instead of having a private method for copying the open/delegation stateid,
use the same call that is used for standard I/O through the MDS.

Note that this means we transmit the stateid with a zero seqid, avoiding
issues with NFS4ERR_OLD_STATEID.
Signed-off-by: NTrond Myklebust <trond.myklebust@primarydata.com>
上级 1bd5d6d0
...@@ -1664,7 +1664,7 @@ pnfs_update_layout(struct inode *ino, ...@@ -1664,7 +1664,7 @@ pnfs_update_layout(struct inode *ino,
.offset = pos, .offset = pos,
.length = count, .length = count,
}; };
unsigned pg_offset, seq; unsigned pg_offset;
struct nfs_server *server = NFS_SERVER(ino); struct nfs_server *server = NFS_SERVER(ino);
struct nfs_client *clp = server->nfs_client; struct nfs_client *clp = server->nfs_client;
struct pnfs_layout_hdr *lo = NULL; struct pnfs_layout_hdr *lo = NULL;
...@@ -1754,10 +1754,14 @@ pnfs_update_layout(struct inode *ino, ...@@ -1754,10 +1754,14 @@ pnfs_update_layout(struct inode *ino,
} }
first = true; first = true;
do { if (nfs4_select_rw_stateid(ctx->state,
seq = read_seqbegin(&ctx->state->seqlock); iomode == IOMODE_RW ? FMODE_WRITE : FMODE_READ,
nfs4_stateid_copy(&stateid, &ctx->state->stateid); NULL, &stateid, NULL) != 0) {
} while (read_seqretry(&ctx->state->seqlock, seq)); trace_pnfs_update_layout(ino, pos, count,
iomode, lo, lseg,
PNFS_UPDATE_LAYOUT_INVALID_OPEN);
goto out_unlock;
}
} else { } else {
nfs4_stateid_copy(&stateid, &lo->plh_stateid); nfs4_stateid_copy(&stateid, &lo->plh_stateid);
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册