namei: Calculate offset before use in GetFreeTag 54/14654/2
authorAndrew Deason <adeason@sinenomine.net>
Fri, 29 May 2020 19:22:34 +0000 (14:22 -0500)
committerBenjamin Kaduk <kaduk@mit.edu>
Sat, 26 Jun 2021 01:55:14 +0000 (21:55 -0400)
commitb9d8b69590c09d672486ddefd0a6c7b74e219050
tree5942240264cc22cffc6ec22b70bd1f4fac7e0d85
parent78008c38b4895dc6230dd9079cd23f78e6725b27
namei: Calculate offset before use in GetFreeTag

We pass 'offset' to FDH_LOCKFILE here, but 'offset' is calculated a
few lines below. The compiler doesn't catch this, since FDH_LOCKFILE
is a macro that ignores the second argument (except on WINNT).

Just move the calculation a few lines above, to ensure 'offset' is set
before it's actually used, to avoid issues if and when FDH_LOCKFILE is
changed to use the second argument.

Change-Id: If858005cb83370ca905f93f9d3d7eed2941ddf99
Reviewed-on: https://gerrit.openafs.org/14654
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
src/vol/namei_ops.c