Commit cfc88944 authored by Neil Brown's avatar Neil Brown Committed by Linus Torvalds

[PATCH] nfsd4: nfsd oopsed when encountering a conflict with a local lock

Bug Fix: Non NFSD conflicting byte-range locks were causing an Oops.

Encode a zero length owner and zero clientid for non NFSD conflicting locks in
the lock_denied response.
Signed-off-by: default avatarAndy Adamson <andros@umich.edu>
Signed-off-by: default avatarJ. Bruce Fields <bfields@citi.umich.edu>
Signed-off-by: default avatarNeil Brown <neilb@cse.unsw.edu.au>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 456beee3
...@@ -1995,13 +1995,18 @@ nfsd4_encode_lock_denied(struct nfsd4_compoundres *resp, struct nfsd4_lock_denie ...@@ -1995,13 +1995,18 @@ nfsd4_encode_lock_denied(struct nfsd4_compoundres *resp, struct nfsd4_lock_denie
{ {
ENCODE_HEAD; ENCODE_HEAD;
RESERVE_SPACE(32 + XDR_LEN(ld->ld_sop->so_owner.len)); RESERVE_SPACE(32 + XDR_LEN(ld->ld_sop ? ld->ld_sop->so_owner.len : 0));
WRITE64(ld->ld_start); WRITE64(ld->ld_start);
WRITE64(ld->ld_length); WRITE64(ld->ld_length);
WRITE32(ld->ld_type); WRITE32(ld->ld_type);
WRITEMEM(&ld->ld_sop->so_client->cl_clientid, 8); if (ld->ld_sop) {
WRITE32(ld->ld_sop->so_owner.len); WRITEMEM(&ld->ld_sop->so_client->cl_clientid, 8);
WRITEMEM(ld->ld_sop->so_owner.data, ld->ld_sop->so_owner.len); WRITE32(ld->ld_sop->so_owner.len);
WRITEMEM(ld->ld_sop->so_owner.data, ld->ld_sop->so_owner.len);
} else { /* non - nfsv4 lock in conflict, no clientid nor owner */
WRITE64((u64)0); /* clientid */
WRITE32(0); /* length of owner name */
}
ADJUST_ARGS(); ADJUST_ARGS();
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment