Commit Graph

9537 Commits

Author SHA1 Message Date
Simon Wilkinson
bb25bdfcb0 dir: Protect against circular hash chains
The dir package didn't protect against circular hash chains when
performing directory lookups. A corrupt directory could therefore
cause a client or a fileserver to go into an endless loop if that
directory contained a loop in its hash chain pointers.

Fix this by exiting the lookup if the hash chain has more elements
than the total number of entries in a directory. This maximum number
of entries is taken as being (number of entries per page) * (max
number of pages), which is considerably more than the real maximum
value.

Change-Id: I9e281571f3b01bd8de346ee5418df38b2f5edaa1
Reviewed-on: http://gerrit.openafs.org/5242
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
2011-08-13 05:56:31 -07:00
Simon Wilkinson
d1946ffe9b libafs/dir: Verify directory pathnames
Provide a new routine, afs_dir_GetVerifiedBlob() which will ensure
that the pathname contained within a directory blob is correctly
terminated before returning it to the caller. For the purposes of this
function, correct termination is defined as having a terminating
\0 character within the same directory page as the blob itself.

Change-Id: I4b3bbb95cb49645a8ac52e6061f9e24f89924831
Reviewed-on: http://gerrit.openafs.org/5241
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
2011-08-13 05:56:20 -07:00
Jeffrey Altman
6f725c4415 Windows: ChangeLog for 1.6.0 (final)
Change-Id: Idd457c7ea4617f9d698d07359f750df25bab4c7c
Reviewed-on: http://gerrit.openafs.org/5239
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2011-08-12 15:05:18 -07:00
Garrett Wollman
e3148c6bfa FBSD: coalesce three assignments to the same variable
Change-Id: Iadc9652c03a2d3453addab759c9f8f0048929e2b
Found-by: clang static analyzer
Reviewed-on: http://gerrit.openafs.org/5233
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2011-08-12 12:36:28 -07:00
Michael Meffie
cbdca2996a volser: log host address of caller in extra logging
When the volserver is running with extra logging (-log),
log the address of the host running vos in addition
to the user name.

Change-Id: I040be71a84dede255e43c30dd7d8ae56f767f721
Reviewed-on: http://gerrit.openafs.org/5234
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2011-08-12 08:27:15 -07:00
Derrick Brashear
a3b4cd3c73 viced: avoid aborting on host table exhaustion
if we exhaust the host table, instead of aborting, return VBUSY at
the client, to defer until hopefully hosts are freed.

Change-Id: Ie8b026992bdde1b46117e6f592f9cf0ea4c85a7e
Reviewed-on: http://gerrit.openafs.org/5181
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2011-08-11 20:18:24 -07:00
Garrett Wollman
8a25d1a1de rx: make queue macros easier to follow
Nothing depends on the queue-manipulation macros having the expression
nature, so make them proper statements and unpack the comma-expressions
to make it easier to read and understand how they work.  This should
not change the object code.

Change-Id: Icf14537f902768429aa27f67f8acfe39ac996214
Reviewed-on: http://gerrit.openafs.org/5200
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2011-08-11 18:42:18 -07:00
Derrick Brashear
d18ff03b59 macos: axe static vfs_fsentry
for whatever reason, lion 32 bit doesn't like it when this is static.
fine, so it's not static now.

Change-Id: Ia9fe6d96615c7fa816f4a88b794faa6ee7e1d010
Reviewed-on: http://gerrit.openafs.org/5206
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
2011-08-11 11:50:04 -07:00
Jeffrey Altman
7ab3405812 Windows: Interlocked operations for cm_buf
cm_buf flags and qFlags

Separate flags and qFlags in the cm_buf structure to improve
performance.

Change-Id: I3d9504827cb74f8770e344cea1c06a6e786785b3
Reviewed-on: http://gerrit.openafs.org/5197
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
2011-08-10 23:16:47 -07:00
Jeffrey Altman
4876a416d2 Windows: Interlocked for cm_buf cmFlags
Change-Id: I7ed2847afdcbc94c9023c6686d3c81f7863d7f61
Reviewed-on: http://gerrit.openafs.org/5196
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
2011-08-10 23:15:54 -07:00
Jeffrey Altman
8661c9b671 Windows: fix tptserver director creation
Change-Id: Ifc2433068e1811633f4ac80d3b4a2a9d16226f16
Reviewed-on: http://gerrit.openafs.org/5195
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
2011-08-10 23:15:13 -07:00
Jeffrey Altman
cbd075a360 Windows: Interlocked ops for cm_volume
Use Interlocked operations for protection of cm_volume flags and
qFlags as well as cm_vol_state flags.

Change-Id: I1a062a5c49d793162b83b9f4f3c32185ae596369
Reviewed-on: http://gerrit.openafs.org/5194
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
2011-08-10 23:14:51 -07:00
Jeffrey Altman
75297d4439 Windows: Interlocked ops for cm_scache
Use Interlocked operations for cm_scache flags and mask field
changes.

Change-Id: Ice87dc5de395b54e7e30e362d2e72caa9062120e
Reviewed-on: http://gerrit.openafs.org/5193
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
2011-08-10 23:14:12 -07:00
Jeffrey Altman
deb8c893c2 Windows: Interlocked ops for cm_cell
Use Interlocked operations for cm_cell flag updates.

Change-Id: I45c0a39ea935db2c231a30ecb02963f35b6d734c
Reviewed-on: http://gerrit.openafs.org/5192
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
2011-08-10 23:13:32 -07:00
Jeffrey Altman
ec1295d11b Windows: implement InterlockedAnd/Or for X86 Debug
Change-Id: I56b3f9534daf0cd152eeea293b1a357d062b9166
Reviewed-on: http://gerrit.openafs.org/5191
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
2011-08-10 23:12:38 -07:00
Jeffrey Altman
3993b215af Windows: correct prototype for ChangeList fs_acl.h
Change-Id: I63e3b37bd4348da0789dfa78599e513753f34a62
Reviewed-on: http://gerrit.openafs.org/5190
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
2011-08-10 23:12:15 -07:00
Jeffrey Altman
6691ff6dac Windows: make osi_Log macro safe for if..else
wrap the osi_Log macro's internal if statement with
a do {...} while(0) block in order to ensure that
it is safe for use in if..else controls without bracing.

Change-Id: Ica7bb95dfb1c0285a925771a9b659f85ec0e075f
Reviewed-on: http://gerrit.openafs.org/5189
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
2011-08-10 23:11:51 -07:00
Garrett Wollman
833010acac stds.h: __nonnull__ has four underscores
Compile-testing AFS_NONNULL doesn't prove anything until something
actually uses it.  Fix 342be35354
to use the spelling that the compilers actually support.

Change-Id: I4a6b965d459a90a1832f2e813e886c15d3477962
Reviewed-on: http://gerrit.openafs.org/5198
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2011-08-10 20:49:23 -07:00
Derrick Brashear
e8607d8d25 macos: reset next vcache pointer after reacquiring xvcache
dropping the xvcache lock means that things can change out from under
us. in case they do, reset the next vcache pointer before looping

Change-Id: I71be39a2f2986804257c50b1d5b7d557b58a3573
Reviewed-on: http://gerrit.openafs.org/5184
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2011-08-10 10:49:01 -07:00
Garrett Wollman
7d0cd1393f FBSD: catch up with the disappearance of VOP_GETVOBJECT
The vnode operation VOP_GETVOBJECT disappeared in FreeBSD 6.0, an
embarrassingly long time ago.  Six years ago, a kluge was added
to emulate its behavior, but it did not correctly emulate the
return value of the old VOP implementation.  As a result,
osi_VM_StoreAllSegments() could never actually do anything.  Since we
don't support FreeBSD before 8.0, remove all references to VOP_GETVOBJECT
and examine vp->v_object directly instead.

This has the result that osi_VM_StoreAllSegments() will actually do
something now, which may not be desirable.  (Previously, if somehow
the vnode had no associated VM object, it would crash, and otherwise
it would do nothing at all.)

Change-Id: Ifdad92ae8e393e85c3f97907af7119ce342b25dd
Found-by: clang static analyzer
Reviewed-on: http://gerrit.openafs.org/5183
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2011-08-10 10:48:39 -07:00
Garrett Wollman
342be35354 stds.h: introduce AFS_NONNULL
AFS_NONNULL wraps the GCC/Clang function attribute __nonnull__, which
tells the compiler and the static analyzer that the pointer arguments
to a function (or specific ones, if provided) cannot be null.  Note
that GCC has only limited support for warning about violations of these
constraints.

Usage examples:
int myfunc(struct foo *a, bar_t, struct baz *c) AFS_NONNULL((1));

tells the compiler that the first argument cannot be null (but the
third one can).

int myfunc2(struct foo *a, bar_t, struct baz *c) AFS_NONNULL();

tells the compiler that both pointer arguments cannot be null.

Change-Id: Id81f0c382a6a3bdd9bf9c716eb4091b433129d69
Suggested-by: Simon Wilkinson, comment on change Ic8751737 (#5180)
Reviewed-on: http://gerrit.openafs.org/5182
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2011-08-10 10:48:17 -07:00
Andrew Deason
2cd9d0536b volinfo: Include nfs.h
nfs.h is required for various types used in vol-info.c. Include it. On
namei this header gets pulled in indirectly via other means, but on
inode it does not (and we shouldn't be relying on such anyway).

Change-Id: If917f8c3b0382572d2146450116399498257ffc7
Reviewed-on: http://gerrit.openafs.org/5185
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Tested-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2011-08-10 10:48:01 -07:00
Simon Wilkinson
a868209c4a aklog: Add -config option
Add the -config option to aklog so that a different configuration
directory location can be specified on the command line for testing
purposes.

Change-Id: Ic5f8d778304a43c823e53bf1855a3e6bf426f80c
Reviewed-on: http://gerrit.openafs.org/5170
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2011-08-09 20:55:21 -07:00
Simon Wilkinson
8b60082c1f pts: Add the -config option
Add the -config option to all pts commands, so that the user can set
the location of the configuration directory to use. This is primarily
provided for testing purposes, to make it simpler to build fake AFS
cells with configuration in non-standard locations.

Change-Id: I90c9c95cbf99b3853bfbe93dab1ab71c3ae7e228
Reviewed-on: http://gerrit.openafs.org/5103
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2011-08-09 20:54:51 -07:00
Marc Dionne
784a410d0f venus depends on libafsauthent
Add an explicit dependency on libafsauthent for src/venus, since it
is needed to build afsio.  This can cause parallel builds to fail.

Change-Id: Ifda59983cda0711e9e1568d5a6be25e6ea934eee
Reviewed-on: http://gerrit.openafs.org/5171
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
2011-08-09 20:54:36 -07:00
Marc Dionne
d28188382b pam: fix unused but set warnings
Fix a few cases of set but unused variables.

Change-Id: I0a3e0906dbc708e2449121f3de1726d7055efc27
Reviewed-on: http://gerrit.openafs.org/5173
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
2011-08-09 20:54:05 -07:00
Marc Dionne
4b4a52b314 volser: flag unused variable
nearInode can be unused, flag it as such to prevent warnings and
keep enable_checking happy.

Change-Id: Ic79d101380b79c3c3d90c4c4f949abe7c3f476ff
Reviewed-on: http://gerrit.openafs.org/5172
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
2011-08-09 20:53:58 -07:00
Garrett Wollman
bf4b2fd3e2 bos: don't dereference a null pointer when printing an error message
The parameter we are interested in is at MRAFS_OFFSET + 17, not
MRAFS_OFFSET + 13.

Change-Id: Ib856ff40c5949cde95a2b277cd44253b87c3c2a4
Found-by: clang static analyzer
Reviewed-on: http://gerrit.openafs.org/5178
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2011-08-09 20:53:43 -07:00
Garrett Wollman
7fe4125fe3 dir/vol: Die() really does
Die() is an abort routine shared by the dir and vol modules.  Move its
prototype into dir.h to ensure that its declaration matches its three
different definitions, and add an AFS_NORETURN annotation so that the
static analyzer knows that it aborts.

Change-Id: If01f35fe796708f6187b9767497a32458888ec1c
Reviewed-on: http://gerrit.openafs.org/5177
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2011-08-09 20:52:56 -07:00
Garrett Wollman
9b0f53b2bf vos: eliminate unnecessary global variables
tserver is used by three different functions but not shared by them;
make it private to each one to improve static analysis.  tconn is
not used by anything, so just delete it.

Change-Id: Ic9fc4add66dbbb02170846154e44d261dcc6b061
Reviewed-on: http://gerrit.openafs.org/5176
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2011-08-09 09:07:40 -07:00
Garrett Wollman
292b375e39 volser: let it be known that Abort() really aborts
The compiler and static checkers can do a better job if they know that
certain functions never return.  Tell it that common.c:Abort() is such
a function.  While we're at it, let volser_internal.h provide the
declarations for this function (Log() was already there).  This makes
volser parallel to the way the same functions are declared in vol.

Change-Id: I8b684bf96866edfc9edaae126d789d245a8d2356
Reviewed-on: http://gerrit.openafs.org/5175
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2011-08-09 09:07:08 -07:00
Garrett Wollman
ae6a392948 kdb: don't dereference a null pointer on corrupt database
When iterating through the database, kdb would dereference a
null pointer if it encountered an error retrieving the value
or if the value was not the right length, in code that was clearly
cut-and-pasted from the other branch of an "if" statement where a
specific entry was requested on the command line.  Print the name
of the entry with the problem as was apparently intended.

Change-Id: Idc2d3c9b6049e5d3b0eb302353a68bcfdad6a90d
Found-by: clang static analyzer
Reviewed-on: http://gerrit.openafs.org/5174
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2011-08-09 09:06:49 -07:00
Garrett Wollman
90ea68979c afsd: look in the right place for -splitcache argument
The argument to -splitcache is in as->parms[34], not [30].

Change-Id: I4d7be16a1ad99a03025c80f9782c4f678da868ae
Found-by: clang static analyzer
Reviewed-on: http://gerrit.openafs.org/5169
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2011-08-07 11:50:27 -07:00
Garrett Wollman
8776f19417 afs_pioctl: don't use cell uninitialized in PGetTokens2
An unlikely error condition could lead to the variable cell in
PGetTokens2 being passed uninitialized to afs_PutCell.  Initialize
it to NULL beforehand to avoid this.

Change-Id: Ia8ded86df9d8af2f08c02d39749252d98a6c9ffe
Found-by: clang static analyzer
Reviewed-on: http://gerrit.openafs.org/5168
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2011-08-07 11:50:19 -07:00
Garrett Wollman
43834bff1a butc: avoid freeing uninitialized pointer in writeDbDump()
In error conditions, charList could be freed before it is initialized.
Move the initialization up to before the error checks.

Change-Id: I678f40552590e238f494507f7410233cdbb949ac
Found-by: clang static analyzer
Reviewed-on: http://gerrit.openafs.org/5167
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2011-08-07 11:50:08 -07:00
Derrick Brashear
1fc4c9dbe2 pam: stop building it wrong
in the new lwp/pthread/shared universe, well, we have the
opportunity to be correct. and we chose to do it entirely wrong.
we're building a shared object. use the right rules. we need
to add some CFLAGS for PAM. do that using MODULE_CFLAGS instead
of just building a whole new CCRULE

Change-Id: Ie3e3c5ba902e5364cfa99d4dbd1b5b7fd4451127
Reviewed-on: http://gerrit.openafs.org/5153
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2011-08-07 11:49:42 -07:00
Derrick Brashear
3d84c065fb pam: clean up unused variables and prototyping
don't define variables on platforms we won't use them on
do prototype functions we call. basically, we compile with warnings
enabled now, so, fix everything so we *can*.

Change-Id: I749f27c227ac70c58ccc68f1548f8274f10e3587
Reviewed-on: http://gerrit.openafs.org/5154
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2011-08-07 11:49:20 -07:00
Derrick Brashear
496fb87372 rx: avoid nat ping until connection is attached
drop nat pings on connections we haven't talked on yet

Change-Id: Ie333d50a090f1f086c958440cc37849413442dea
Reviewed-on: http://gerrit.openafs.org/5130
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2011-08-07 11:49:00 -07:00
Garrett Wollman
c92f04af60 butc: avoid testing stack garbage; remove dead initializer
"code" is unconditionally set early in saveDbToTape() so there's
no need to initialize it.  On the other hand, dumpEntry.id is used
before dumpEntry is initialized, so set it to what appears to be
the expected value before any non-local exits could cause it to be
inspected.

Change-Id: I133f8e84e46d0faedf3c9683330d92158bcd8935
Found-by: clang static analyzer
Reviewed-on: http://gerrit.openafs.org/5166
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2011-08-07 08:56:09 -07:00
Garrett Wollman
34cc26a1b1 butc: initialize startTime before it is used
In some unusual error situations, startTime may be used uninitialized.
Move the initialization up above the first such error condition.
(None of the intervening code can take measurably long to execute
so this should not make any difference in the non-error case.)

Change-Id: I25bf7a5e149540593febec79f9f5111434807514
Found-by: clang static analyzer
Reviewed-on: http://gerrit.openafs.org/5165
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2011-08-07 08:55:37 -07:00
Garrett Wollman
619b420903 vos: don't free stack garbage on error
If wantExtendedInfo is true, then pntr is used uninitialized.
In the other case, UV_ListVolumes will have set it to NULL
before doing anything (even if it returns an error), so this
free() is dead anyway.

Change-Id: I6979a69d33ecbbdb906eb9a075bbf13180e36646
Found-by: clang static analyzer
Reviewed-on: http://gerrit.openafs.org/5164
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2011-08-07 08:55:05 -07:00
Simon Wilkinson
55beacdc38 libafsauthent: Add volser and vldb
Add the volser and vldb families of functions to libafsauthent. This
allows applications such as per-AFS which are building pthreaded clients
to use a single library, rather than trying to mix LWP and pthreaded
code within the same process.

Change-Id: I3682876e91ca03311a798ac71e3a7a28f3205d42
Reviewed-on: http://gerrit.openafs.org/5157
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2011-08-07 08:54:38 -07:00
Simon Wilkinson
400c72561e volser doesn't depend on tviced, but on vlserver
Nothing within the volser/ directory depends on tviced, so remove the
unecessary dependency. Add an explicit dependency on vlserver, so that
libvldb is available to us.

This is required to get rid of some potential circular loops when we
start including volser objects in libafsauthent

Change-Id: Ibb6b8fb87dfe6e9eb4fa6d1dde195fd5261a8959
Reviewed-on: http://gerrit.openafs.org/5156
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2011-08-07 08:54:27 -07:00
Jeffrey Altman
0246f6e968 Windows: symlink make should translate \\afs target
If the target is a UNC path beginning with the AFS netbios name,
convert the path to use Unix /afs mountpoint notation.

Change-Id: I01e01b70938f8eb383fd3e7458a140d9e89dd237
Reviewed-on: http://gerrit.openafs.org/5162
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
2011-08-05 06:22:35 -07:00
Jeffrey Altman
c512683859 Windows: adjust scache LRU postion upon deletion
If the object represented by a scache object is deleted,
update the LRU position of the scache object to make it
the first object in the LRU queue to be recycled.  This
preserves the cached objects for those that might prove
useful in the future.

Change-Id: I0e862b1270e10c31f20ecde06d208f4b8c405c3a
Reviewed-on: http://gerrit.openafs.org/5161
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
2011-08-04 19:03:07 -07:00
Jeffrey Altman
4e42d6fd18 Windows: fix condition calls to osi_Log
The osi_Log macro is if(foo) osi_AddLog()

If osi_Log macros will be conditionally called, the conditonal
needs to have bracing.

Change-Id: I59de78a5b7b35cc822a648a51cd63a14037c1ca5
Reviewed-on: http://gerrit.openafs.org/5160
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
2011-08-04 19:00:45 -07:00
Jeffrey Altman
17e50a4b98 Windows: LockOrderValidation memory usage optimization
Instead of using malloc() and free() to allocation lock reference
structures, cache allocated objects in a free list.  This reduces
memory fragmentation.

Change-Id: Idffe82282c77202d0fc3a9be9123c3b7384ecd63
Reviewed-on: http://gerrit.openafs.org/5159
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
2011-08-04 19:00:26 -07:00
Jeffrey Altman
2bce3b50ef Windows: after dir enum adjust dir scache LRU
During a directory enumeration the directory scache object
is reference counted so it can't be recycled.  However, if
there are more directory entries than the maximum number
of cached scache objects the directory scache object will
end up being the next object to be recycled after the refcount
is dropped.  Since the directory is clearly a hot object, before
dropping the reference, adjust the scache LRU position so that
it is the last object to be recycled.

Fix the variable name for the directory scache to be 'dscp'
for consistency.

Change-Id: Ia2089fb9b47dab77abc0911ab009e5aed75ed848
Reviewed-on: http://gerrit.openafs.org/5158
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
2011-08-04 19:00:03 -07:00
Jeffrey Altman
4111ee2374 Windows: use %p to print cm_scache_t pointers
Change-Id: Iee13204820b3adc4359e42d46d9f9050ab07bcb2
Reviewed-on: http://gerrit.openafs.org/5152
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
2011-08-04 18:59:42 -07:00
Simon Wilkinson
88725587e9 tbudb depends on tubik ...
... so say so in the Makefile

Change-Id: I84f0ac3c06953eff98e0194ad375c32b3656af58
Reviewed-on: http://gerrit.openafs.org/5155
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2011-08-03 12:58:35 -07:00