summaryrefslogtreecommitdiff
path: root/tools/perf/scripts/python
diff options
context:
space:
mode:
authorRobbie Ko <robbieko@synology.com>2026-06-16 13:40:00 +0800
committerChuck Lever <cel@kernel.org>2026-08-10 09:54:35 -0400
commit868f1ff2e7c79a549a1e68d4c999051a96af295e (patch)
tree3ef4f9b15c82be626d920dfd1bfd566b9a897783 /tools/perf/scripts/python
parenteb0eca7720662ba5847df1510e73801f7f473094 (diff)
nfsd: use NSEC_PER_SEC in nfsd4_decode_nfstime4()
nfsd4_decode_nfstime4() open-codes the nanoseconds upper bound as the literal (u32)1000000000. Use the named constant NSEC_PER_SEC instead, matching the NFSv3 setattr check and improving readability. The original code cast the literal to u32 to force an unsigned comparison, which matters on 32-bit where tv_nsec is a 32-bit signed long: an out-of-range u32 wire nseconds (>= 0x80000000) assigned to it becomes negative and a signed compare against NSEC_PER_SEC (a signed long) would wrongly pass. Keep that protection by casting tv_nsec to unsigned long, the same width as tv_nsec, matching timespec64_valid(). No functional change. Signed-off-by: Robbie Ko <robbieko@synology.com> Reviewed-by: Jeff Layton <jlayton@kernel.org> Link: https://patch.msgid.link/20260616054027.2360930-3-robbieko@synology.com Signed-off-by: Chuck Lever <cel@kernel.org>
Diffstat (limited to 'tools/perf/scripts/python')
0 files changed, 0 insertions, 0 deletions