summaryrefslogtreecommitdiff
path: root/tools/lib/python
diff options
context:
space:
mode:
authorRoberto Bergantinos Corpas <rbergant@redhat.com>2026-09-17 12:49:05 +0200
committerAnna Schumaker <anna.schumaker@hammerspace.com>2026-10-06 12:01:33 -0400
commit4fdfe2312cbed99b1438dcf20b348e72393f9633 (patch)
treeff4446a013f7a4cf76bdcc1df95cf0a27743feb3 /tools/lib/python
parentec906cf7bee60f3bbc8500bac14e65813e38ac93 (diff)
downloadlinux-next-4fdfe2312cbed99b1438dcf20b348e72393f9633.tar.gz
linux-next-4fdfe2312cbed99b1438dcf20b348e72393f9633.zip
NFS: return DENIED in decode_lock_denied if we cannot decode owner
After commit 43502f6e8d1e ("NFS: fix open_owner_id_maxsz and related fields.") we dramatically changed the size of the LOCK/LOCKT reply buffer from 164 to 52 bytes. This made visible a situation on a buggy NFS server that sent oversized denied responses which led to us returning EIO instead of DENIED. Now, apart from buggy server issue, this poses an interesting question: what if other implementations have legitimate but bigger than we expect lock owner response, especially now that we have reduced the size we allocate for it (20 bytes for the lock owner part). This change proposes to tackle that issue returning DENIED instead of EIO regardless of whether we manage to decode the owner or not: - At this point of decode_lock_denied we know there is an owner. - Server legitimately denied the lock request, with an owner that fits on NFS4_OPAQUE_LIMIT but we returned EIO instead to userspace. - The owner data is decoded but actually never used, decode_lock path simply retries, and decode_lockt turns it into 0 on file_lock and returns it to userspace. - LOCK/LOCKT are the last operations on the compound so it's not relevant if we didn't advance the pointer. - Also removes an inverted likely(!p) hint. Fixes: 43502f6e8d1e ("NFS: fix open_owner_id_maxsz and related fields.") Signed-off-by: Roberto Bergantinos Corpas <rbergant@redhat.com> Reviewed-by: Prabhakar Pujeri <prabhakar.pujeri@dell.com> Reviewed-by: Jeff Layton <jlayton@kernel.org> Signed-off-by: Anna Schumaker <anna.schumaker@hammerspace.com>
Diffstat (limited to 'tools/lib/python')
0 files changed, 0 insertions, 0 deletions