NFSv4: Ensure that we track the NFSv4 lock state in read/write requests.
This patch fixes bugzilla entry 14501: https://bugzilla.kernel.org/show_bug.cgi?id=14501 Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
This commit is contained in:
@@ -1324,14 +1324,14 @@ static void encode_putrootfh(struct xdr_stream *xdr, struct compound_hdr *hdr)
|
||||
hdr->replen += decode_putrootfh_maxsz;
|
||||
}
|
||||
|
||||
static void encode_stateid(struct xdr_stream *xdr, const struct nfs_open_context *ctx)
|
||||
static void encode_stateid(struct xdr_stream *xdr, const struct nfs_open_context *ctx, const struct nfs_lock_context *l_ctx)
|
||||
{
|
||||
nfs4_stateid stateid;
|
||||
__be32 *p;
|
||||
|
||||
p = reserve_space(xdr, NFS4_STATEID_SIZE);
|
||||
if (ctx->state != NULL) {
|
||||
nfs4_copy_stateid(&stateid, ctx->state, ctx->lockowner);
|
||||
nfs4_copy_stateid(&stateid, ctx->state, l_ctx->lockowner);
|
||||
xdr_encode_opaque_fixed(p, stateid.data, NFS4_STATEID_SIZE);
|
||||
} else
|
||||
xdr_encode_opaque_fixed(p, zero_stateid.data, NFS4_STATEID_SIZE);
|
||||
@@ -1344,7 +1344,7 @@ static void encode_read(struct xdr_stream *xdr, const struct nfs_readargs *args,
|
||||
p = reserve_space(xdr, 4);
|
||||
*p = cpu_to_be32(OP_READ);
|
||||
|
||||
encode_stateid(xdr, args->context);
|
||||
encode_stateid(xdr, args->context, args->lock_context);
|
||||
|
||||
p = reserve_space(xdr, 12);
|
||||
p = xdr_encode_hyper(p, args->offset);
|
||||
@@ -1523,7 +1523,7 @@ static void encode_write(struct xdr_stream *xdr, const struct nfs_writeargs *arg
|
||||
p = reserve_space(xdr, 4);
|
||||
*p = cpu_to_be32(OP_WRITE);
|
||||
|
||||
encode_stateid(xdr, args->context);
|
||||
encode_stateid(xdr, args->context, args->lock_context);
|
||||
|
||||
p = reserve_space(xdr, 16);
|
||||
p = xdr_encode_hyper(p, args->offset);
|
||||
|
Reference in New Issue
Block a user