]> git.michaelhowe.org Git - packages/o/openafs.git/log
packages/o/openafs.git
13 years agodoc: Remove reference to NetRestrict wildcards
Andrew Deason [Mon, 18 Jun 2012 20:02:09 +0000 (15:02 -0500)]
doc: Remove reference to NetRestrict wildcards

Commit 80fc888a9223050481de932233fe7121a48df194 got some of this, but
forgot the other reference. We don't support these anywhere, so remove
it here, too.

FIXES 125340

Reviewed-on: http://gerrit.openafs.org/7564
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
(cherry picked from commit 4ae005062e2c927b77ea23d95934d5af463878b3)

Change-Id: I58e0fa2ea138a08b45d136abb9fcd43f9f3dc11a
Reviewed-on: http://gerrit.openafs.org/7670
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>
13 years agoLinux 3.5: encode_fh API change
Marc Dionne [Sun, 3 Jun 2012 01:35:53 +0000 (21:35 -0400)]
Linux 3.5: encode_fh API change

The encode_fh export operation now expects two inode arguments
instead of a dentry and a "connectable" flag.  Use the inode of
the dentry we're interested in, and NULL as the parent inode which
is the same as passing a 0 flag in the previous API.

Change-Id: I05cf146fb2a4bacdca20a9f108d04ccb11530804
Reviewed-on: http://gerrit.openafs.org/7523
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
(cherry picked from commit 5227148ae17949705487ea673d558ebfe143e635)
Reviewed-on: http://gerrit.openafs.org/7579

13 years agoLinux 3.3: use umode_t for mkdir and create inode ops
Marc Dionne [Wed, 18 Jan 2012 16:22:35 +0000 (11:22 -0500)]
Linux 3.3: use umode_t for mkdir and create inode ops

The mkdir and create inode operations have switched to using
umode_t instead of int for the file mode.

Change-Id: Ib8bbf6eaa6e87d6a9692c45b1a3fe93fcc3eff7a
Reviewed-on: http://gerrit.openafs.org/6567
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
(cherry picked from commit beafc7f742ebad021bfcbed73884aecedee4e04b)
Reviewed-on: http://gerrit.openafs.org/7577

13 years agoaklog: can't assume krb5_524_conv_principal based on convert_creds
Derrick Brashear [Tue, 12 Jun 2012 17:46:46 +0000 (13:46 -0400)]
aklog: can't assume krb5_524_conv_principal based on convert_creds

add probing for krb5_524_conv_principal directly instead of
assuming finding a 524 library will find it. current heimdal
does not include it.

Reviewed-on: http://gerrit.openafs.org/7551
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Tested-by: Derrick Brashear <shadow@dementix.org>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
(cherry picked from commit 6d3390bc16281e6f889bb555abb1182985556287)

Change-Id: Icc576d1a711fa771fda393c61a15082ffb94defc
Reviewed-on: http://gerrit.openafs.org/7582
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
13 years agoLinux 3.4: replace end_writeback with clear_inode
Marc Dionne [Tue, 29 May 2012 01:43:12 +0000 (21:43 -0400)]
Linux 3.4: replace end_writeback with clear_inode

end_writeback() is renamed to clear_inode().  Add a configure test
and cope.

Change-Id: Icaf5b6b54d0ee377fabcf0b295d690eaa6b4be5e
Reviewed-on: http://gerrit.openafs.org/7503
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
(cherry picked from commit 2b33384a4a7b88842281021129ffccc837d91d36)
Reviewed-on: http://gerrit.openafs.org/7578

13 years agoLinux: remove unused variable
Marc Dionne [Thu, 14 Jul 2011 00:56:53 +0000 (20:56 -0400)]
Linux: remove unused variable

endindex is not used, remove it

Change-Id: I50a89e3f25828c05fd24f4fc6a1068007a68dbc2
Reviewed-on: http://gerrit.openafs.org/5012
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit a76e65034cf3feadfe2af5a20ddae705fda00aa0)
Reviewed-on: http://gerrit.openafs.org/7580
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
13 years agoafs: Do not QueueVCB before osi_dnlc_purge*
Andrew Deason [Fri, 18 May 2012 21:40:38 +0000 (17:40 -0400)]
afs: Do not QueueVCB before osi_dnlc_purge*

In afs_FlushVCache, when we QueueVCB, we might drop the afs_xvcache
lock (as of 76158df491f47de56d1febe1d1d2d17d316c9a74). The vcache may
still be on the DNLC, so a lookup while xvcache is dropped can cause
someone else to grab a reference to the vcache while it is being
flushed. This can cause panics and failed assertions, since someone
will have a reference to the flushed vcache, which is effectively
freed and many of the structure fields are no longer valid.

So instead, do not call QueueVCB until we have purged the vcache from
the DNLC.

Reviewed-on: http://gerrit.openafs.org/7430
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
(cherry picked from commit 0e81db38b549d79a3af5fce0f9f8fa48d9e6efeb)

Change-Id: Idabad9076c6c36bede3faf459abb940aae5a975c
Reviewed-on: http://gerrit.openafs.org/7502
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
13 years agoafsd: Avoid dir interpolation for memcache
Andrew Deason [Mon, 21 May 2012 22:11:29 +0000 (17:11 -0500)]
afsd: Avoid dir interpolation for memcache

memcache doesn't make use of fullpn_DCacheFile, fullpn_VolInfoFile,
etc. Do not even try to generate these strings for memcache, since
cacheBaseDir will be NULL, and so this can cause a segfault on some
platforms including Solaris.

Reviewed-on: http://gerrit.openafs.org/7442
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
(cherry picked from commit 2e2bc535bd03df86f78b648f78d2d0a95d273fab)

Change-Id: I46f2da9b2f0e5f8d004ebd3d799a3c1ac22c3e95
Reviewed-on: http://gerrit.openafs.org/7501
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
13 years agoafsd: Avoid printing cacheBaseDir for memcache
Andrew Deason [Mon, 21 May 2012 23:01:49 +0000 (18:01 -0500)]
afsd: Avoid printing cacheBaseDir for memcache

cacheBaseDir is NULL when memcache is turned on; don't print it.

Reviewed-on: http://gerrit.openafs.org/7443
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
(cherry picked from commit 9eb924f16c6f3bb06d83ed281317f2ba29473202)

Change-Id: Ie5dce3a3ae12b2725c90475cd3f6718f9df63134
Reviewed-on: http://gerrit.openafs.org/7500
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
13 years agovos: volume lock not released on convertROtoRW error
Mark Vitale [Tue, 8 May 2012 19:03:46 +0000 (15:03 -0400)]
vos: volume lock not released on convertROtoRW error

If an error occurs during convertROtoRW, the volume lock may
not be released.

Reviewed-on: http://gerrit.openafs.org/7389
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Alistair Ferguson <alistair.ferguson@mac.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
(cherry picked from commit 33eff6597facc01bbcd5266fb83c8a6bfa40dfa8)

Change-Id: I0b87fd3b99f178d99f997032c14673def111c1de
Reviewed-on: http://gerrit.openafs.org/7499
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
13 years agovos: convertROtoRW does not respect volume lock
Mark Vitale [Tue, 8 May 2012 18:45:16 +0000 (14:45 -0400)]
vos: convertROtoRW does not respect volume lock

vos convertROtoRW was not checking the return code from
ubik_VL_SetLock().

Reviewed-on: http://gerrit.openafs.org/7388
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Alistair Ferguson <alistair.ferguson@mac.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
(cherry picked from commit 38ebd79bafee3c97323aa603906d1d5f279ec450)

Change-Id: I391c5b0d3d385af08eb2aec245f943081c7b84e3
Reviewed-on: http://gerrit.openafs.org/7498
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
13 years agovos: convertROtoRW may create two RW volumes
Mark Vitale [Tue, 8 May 2012 14:01:12 +0000 (10:01 -0400)]
vos: convertROtoRW may create two RW volumes

If the RW volume is listed after the RO convert target in the VLDB,
the code failed to detect that an RW is already present and would
create a second RW volume.

Reviewed-on: http://gerrit.openafs.org/7385
Reviewed-by: Chas Williams - CONTRACTOR <chas@cmf.nrl.navy.mil>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
(cherry picked from commit 9a728fd86c7add13e15dfa0d3062fa94cc77c53f)

Change-Id: I7e4eaf0ffefedb3c665e28656a75959eb8677071
Reviewed-on: http://gerrit.openafs.org/7497
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
13 years agovos: convertROtoRW misc error reporting problems
Mark Vitale [Tue, 8 May 2012 16:38:38 +0000 (12:38 -0400)]
vos: convertROtoRW misc error reporting problems

Fixes a few inconsistencies and bugs in some error messages.

Reviewed-on: http://gerrit.openafs.org/7387
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
(cherry picked from commit e1c6ad7d580041caf35f698c9b2241fb45f02361)

Change-Id: Icee86e1750920d50b94e29acc5504bd1a2ea9e6e
Reviewed-on: http://gerrit.openafs.org/7496
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
13 years agomacos: update AFS prefs pane
Derrick Brashear [Wed, 18 Apr 2012 15:57:10 +0000 (11:57 -0400)]
macos: update AFS prefs pane

modify afshelper to just run what it's told instead
of offering fixed operations. this avoids having a setuid
tool around. in spite of apple's suggestion this is correct,
it's actually more dangerous. instead, elevate privilege only
to run a small set of commands, then drop. allow
unlocking of the prefs pane, but make the menu extra prompt
for authentication when needed.
deactivate controls in the prefs pane when locked.

Reviewed-on: http://gerrit.openafs.org/7196
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
(cherry picked from commit 0524e0d1915f519a76d62540b695abc16634d4c9)

Change-Id: Iba4435829a57e91e45b0beea10a8d6573b62a214
Reviewed-on: http://gerrit.openafs.org/7495
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
13 years agoDOC: vos convertROtoRW security requirements
Mark Vitale [Wed, 2 May 2012 17:55:16 +0000 (13:55 -0400)]
DOC: vos convertROtoRW security requirements

They were copied from another command; corrected them.

Reviewed-on: http://gerrit.openafs.org/7305
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Ken Dreyer <ktdreyer@ktdreyer.com>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
(cherry picked from commit a2f523b50592e261fe9cd3ef32978e786011c3c7)

Change-Id: I03101cec5bfd20555e33f639ce2c08cde873d646
Reviewed-on: http://gerrit.openafs.org/7494
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
13 years agodoc: add Windows section to fs newcell
Ken Dreyer [Fri, 16 Mar 2012 19:37:20 +0000 (13:37 -0600)]
doc: add Windows section to fs newcell

fs newcell works slightly differently on Windows. Document the
differences in the man page.

FIXES 125094

Reviewed-on: http://gerrit.openafs.org/6919
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Chas Williams - CONTRACTOR <chas@cmf.nrl.navy.mil>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
(cherry picked from commit 186158c9eb2379ec350831b8fb244c51ae234a6e)

Change-Id: Ie0daa8631c45eb457c5eb7a1e80a1f70401127d6
Reviewed-on: http://gerrit.openafs.org/7493
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
13 years agovol: Free vol header on attach_volume_header error
Andrew Deason [Thu, 3 May 2012 21:36:03 +0000 (16:36 -0500)]
vol: Free vol header on attach_volume_header error

In attach_volume_header, make sure we free the volume's header if
we're returning an error. We take care of the locks and i/o handles in
the immediately preceding block, but for an actual error we don't get
rid of the header. Do so.

Noticed by Tom Keiser.

Reviewed-on: http://gerrit.openafs.org/7325
Reviewed-by: Tom Keiser <tkeiser@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
(cherry picked from commit ecfd9549fc29cdad8042e830c656caee1363c6cf)

Change-Id: I1d49c18f23cd576dfcde114238ea2b41e1356039
Reviewed-on: http://gerrit.openafs.org/7492
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
13 years agovol: Pay attention to specialStatus after VAVByVp
Andrew Deason [Wed, 2 May 2012 17:07:49 +0000 (12:07 -0500)]
vol: Pay attention to specialStatus after VAVByVp

attach2/VAttachVolumeByVp_r do not alter the yielded error code
according to specialStatus. So, pay attention to specialStatus after
receiving an error from VAttachVolumeByVp_r, to ensure we respond with
the correct error code.

Reviewed-on: http://gerrit.openafs.org/7303
Reviewed-by: Tom Keiser <tkeiser@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
(cherry picked from commit a81f9237bfa7b2e3a0567a930f3c49234b9a4376)

Change-Id: I1d0cb429b9cd875fa43a3af2e8c5d5d96ee12f85
Reviewed-on: http://gerrit.openafs.org/7491
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
13 years agovol: Avoid VBUSY/VRESTARTING trick for offline vop
Andrew Deason [Wed, 2 May 2012 16:38:57 +0000 (11:38 -0500)]
vol: Avoid VBUSY/VRESTARTING trick for offline vop

Currently, if GetVolume() finds that the volume we're trying to attach
has a vol op that leaves the volume offline, we do the
VBUSY/VRESTARTING trick as described in CheckVnode(). This doesn't
make any sense for a couple of reasons.

For one, VBUSY/VRESTARTING is not the correct error code to return to
the client when an offline vol op is in progress and vp->specialStatus
is not set everywhere else we yield VOFFLINE.

Additionally, this block of code is only hit once for a particular vol
op. Once we reach this section, the volume is in UNATTACHED state, and
so on the next iteration of GetVolume we will immediately return
VOFFLINE (or specialStatus). So the CheckVnode-like situation is not
applicable, since we are not returning VBUSY to the same client for 15
minutes; we would return VBUSY once and then return VOFFLINE.

Reviewed-on: http://gerrit.openafs.org/7302
Reviewed-by: Tom Keiser <tkeiser@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
(cherry picked from commit 21ed79aeaee2d3b2b47436db0491943829ac44a6)

Change-Id: I183db2d337c999e9aafd1eba60a80eb5b84264c7
Reviewed-on: http://gerrit.openafs.org/7490
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
13 years agovos setaddrs: notice unexpected errors
Andrew Deason [Thu, 3 May 2012 17:40:40 +0000 (12:40 -0500)]
vos setaddrs: notice unexpected errors

Currently 'vos setaddrs' only prints a message and errors out if the
VL_RegisterAddrs call fails with certain error codes (VL_MULTIPADDR
and RXGEN_OPCODE). But if we get something else like an access error,
we should of course print that out, instead of reporting success.

Reviewed-on: http://gerrit.openafs.org/7322
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Chas Williams - CONTRACTOR <chas@cmf.nrl.navy.mil>
Reviewed-by: Tom Keiser <tkeiser@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
(cherry picked from commit 663185d62df501fb9d7a18e6ef329e4f53aa8854)

Change-Id: I86b8729cd091007b84fb8b7bf19c58d477626686
Reviewed-on: http://gerrit.openafs.org/7489
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
13 years agovol: A GOING_OFFLINE volume should yield VOFFLINE
Andrew Deason [Fri, 27 Apr 2012 17:59:25 +0000 (12:59 -0500)]
vol: A GOING_OFFLINE volume should yield VOFFLINE

Currently, GetVolume treats a volume in the VOL_STATE_GOING_OFFLINE
state the same as VOL_STATE_SHUTTING_DOWN, and so returns VNOVOL for a
GOING_OFFLINE volume, but these states are very different.

GOING_OFFLINE indicates that a volume should soon be in the UNATTACHED
state, so we should treat GOING_OFFLINE the same as UNATTACHED for
returning errors to the user. For UNATTACHED, we return specialStatus
if it's set, or VOFFLINE otherwise; so, just do the same for
GOING_OFFLINE.

Reviewed-on: http://gerrit.openafs.org/7290
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
(cherry picked from commit d10f71d44fddd7ea6e37481cffd7ee1be2a93217)

Change-Id: I1f75992da7732596c78041e9eac3b1e3a12082e8
Reviewed-on: http://gerrit.openafs.org/7488
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
13 years agolibafs: don't crash on no addresses in afs_Conn
Derrick Brashear [Thu, 26 Apr 2012 13:24:25 +0000 (09:24 -0400)]
libafs: don't crash on no addresses in afs_Conn

we try to avoid a crash on a missing serverHost; do the same
on missing addrs in that host

FIXES 130714

Reviewed-on: http://gerrit.openafs.org/7287
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
(cherry picked from commit 868378cc00b9ac7016da3dc457abf3fa2016687c)

Change-Id: If8f616002cc67cb865549b8b9ea83a6bd1f9256f
Reviewed-on: http://gerrit.openafs.org/7487
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
13 years agomacos: remove mistyped vnode warning
Derrick Brashear [Mon, 23 Apr 2012 02:45:09 +0000 (22:45 -0400)]
macos: remove mistyped vnode warning

newborn vnodes are corrected if needed; don't worry about it.

Reviewed-on: http://gerrit.openafs.org/7270
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Tested-by: Derrick Brashear <shadow@dementix.org>
(cherry picked from commit be1f110f3efb41a72278c7abc8a22cbfcfa8d0e3)

Change-Id: I82485f348afe9adbd0dc5743a4f15f18b7e04420
Reviewed-on: http://gerrit.openafs.org/7486
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
13 years agolibafs: stop bkg first
Derrick Brashear [Wed, 18 Apr 2012 15:58:52 +0000 (11:58 -0400)]
libafs: stop bkg first

because background daemons can have dependence on other subsystems, but
are not needed for other operations, stop them first.

Reviewed-on: http://gerrit.openafs.org/7246
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Chas Williams - CONTRACTOR <chas@cmf.nrl.navy.mil>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
(cherry picked from commit e3c93b87b7fa751e9cf4c1356d606b7bb399b06c)

Change-Id: I258519a2ad85af53784cf4db381a7f4a8b429dc8
Reviewed-on: http://gerrit.openafs.org/7485
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
13 years agomacos: lock module against unload during shutdown
Derrick Brashear [Wed, 18 Apr 2012 15:58:03 +0000 (11:58 -0400)]
macos: lock module against unload during shutdown

during shutdown, once umount finished, it was possible to
unload the module before shutdown completed. fix that.

Reviewed-on: http://gerrit.openafs.org/7245
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Chas Williams - CONTRACTOR <chas@cmf.nrl.navy.mil>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Tested-by: Derrick Brashear <shadow@dementix.org>
(cherry picked from commit a08f9baa7620a6643f12f0b847c2bbab41a0b255)

Change-Id: I6467b9ead03262a6ec8b0de673d2eeb664df1aef
Reviewed-on: http://gerrit.openafs.org/7484
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
13 years agolibafs: dont handle outstatus on write error
Derrick Brashear [Wed, 15 Feb 2012 02:58:09 +0000 (21:58 -0500)]
libafs: dont handle outstatus on write error

if a write errored, we can't trust the OutStatus we got. don't.

Reviewed-on: http://gerrit.openafs.org/6714
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Reviewed-by: Alistair Ferguson <alistair.ferguson@mac.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
(cherry picked from commit 4c8a3cd789a8495d0c0b3f8ff1a7ebb2a20f5336)

Change-Id: I69b26330aca2e5fd0d2092b579a0fcf1514acb53
Reviewed-on: http://gerrit.openafs.org/7483
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
13 years agorefactor afs_CheckServers
Derrick Brashear [Wed, 1 Dec 2010 20:22:30 +0000 (15:22 -0500)]
refactor afs_CheckServers

basically, we need the ability to reuse this function, so, let's make it work
differently so we can.

Reviewed-on: http://gerrit.openafs.org/3403
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit e8d8a2240a57f9f4a11ee45b60c229d3f8447b86)

Change-Id: I2ad9de15cc5471810abfecf0cbc504da7da624b0
Reviewed-on: http://gerrit.openafs.org/6341
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
13 years agoAdd OpenAFS to the dependencies of remote-fs.
Edward Z. Yang [Sun, 20 Nov 2011 20:48:33 +0000 (15:48 -0500)]
Add OpenAFS to the dependencies of remote-fs.

Signed-off-by: Edward Z. Yang <ezyang@mit.edu>
Reviewed-on: http://gerrit.openafs.org/6093
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
(cherry picked from commit 3328770612b7205abb92df5b5f4737eb3349c910)

Change-Id: I16b7b0ac6e68bf91c48652faab339871f18549a5
Reviewed-on: http://gerrit.openafs.org/7449
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
13 years agobozo: preserve all options over restart
Michael Meffie [Fri, 30 Sep 2011 16:22:27 +0000 (12:22 -0400)]
bozo: preserve all options over restart

On unix, save all the bosserver command-line options and reuse
them on bosserver restarts. On Windows, the SCM integrator saves
the argument list, just use them.

Reviewed-on: http://gerrit.openafs.org/5532
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Tested-by: Derrick Brashear <shadow@dementix.org>
(cherry picked from commit db472e730e3989dac1d49b54d7371b54b24cd63c)

Change-Id: Ic6a8534f84f31f94e69c18fd970ecd368f7ee39e
Reviewed-on: http://gerrit.openafs.org/7395
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
13 years agoviced: Do not offline volume on successful IH_DEC
Andrew Deason [Thu, 5 Apr 2012 22:55:17 +0000 (17:55 -0500)]
viced: Do not offline volume on successful IH_DEC

If we fail to CoW a file due to ENOSPC, we try to IH_DEC the new file
copy, and if IH_DEC fails, we take the volume offline for salvaging.
But IH_DEC returns 0 on success, not on error. So take the salvaging
path when we get non-zero.

Reviewed-on: http://gerrit.openafs.org/7054
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>
(cherry picked from commit 613f14727fbb404fb7fc1cac953dda46b671222e)

Change-Id: I207ffc4db59bdbd8b80fa4ffad9210d13d76b68f
Reviewed-on: http://gerrit.openafs.org/7394
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
13 years agofs: Report default storebehind when errors exist
Andrew Deason [Mon, 7 May 2012 20:49:34 +0000 (15:49 -0500)]
fs: Report default storebehind when errors exist

After 904c9fbe, we no longer print out the default store asynchrony
when any of the supplied paths results in a pioctl error. However, if
just one (or a few) of the paths supplied results in an error (such
as, the path does not exist), this does not prevent us from reporting
the default value.

Instead, keep track of whether or not we have a valid value, and try
to determine the default if we haven't already by the end of
StoreBehindCmd, and print it out.

Reviewed-on: http://gerrit.openafs.org/7376
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Chas Williams - CONTRACTOR <chas@cmf.nrl.navy.mil>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
(cherry picked from commit 427f53eea7f9c05e7b1913c91d57777d72bc30b2)

Change-Id: I04bebe60fbb275ca44caeed9b8696283c4ded36b
Reviewed-on: http://gerrit.openafs.org/7384
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
13 years agoafs: Use cell for md5 inode numbers
Andrew Deason [Wed, 22 Jun 2011 19:39:39 +0000 (14:39 -0500)]
afs: Use cell for md5 inode numbers

When calculating the inode number for a file with md5 inodes, include
the cell number in the calculation, in order to reduce collisions
between cells.

Reviewed-on: http://gerrit.openafs.org/4902
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
(cherry picked from commit 42943aead4db2bdf9b8ec01c3917eb1c9ac9eb76)

Change-Id: I5cf88ecd30a5813697dbf3b86964d53bb1f3915a
Reviewed-on: http://gerrit.openafs.org/7277
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
13 years agoafs: Ensure afs_calc_inum yields nonzero ino
Andrew Deason [Wed, 22 Jun 2011 18:44:38 +0000 (13:44 -0500)]
afs: Ensure afs_calc_inum yields nonzero ino

afs_calc_inum can currently yield an inode of 0 if MD5-based inode
numbers are turned on. Some userspace applications (and for some
platforms, maybe even the kernel) make certain assumptions about the
inode number for a file; in particular for example, 'ls' will not
display a file with inode 0 in a normal directory listing.

So, read the md5 digest until we get a non-zero result. Fall back to
the non-md5 calculation if we still somehow end up with a 0.

While this case may at first glance seem to be extremely rare, in
practice it can occur, as the current calculation for volume
538313506, vnode 26178 does actually yield a 0.

Reviewed-on: http://gerrit.openafs.org/4901
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
(cherry picked from commit 39083fe1edab784fcd75eacbdaaf7f6affa14c9f)

Change-Id: I3d06a4b5dc76934b24ced883b1985bced35c893a
Reviewed-on: http://gerrit.openafs.org/7276
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
13 years agoSOLARIS: Correct misplaced osi_machdep.h #endif
Andrew Deason [Mon, 2 Apr 2012 21:16:37 +0000 (16:16 -0500)]
SOLARIS: Correct misplaced osi_machdep.h #endif

Commit 64778fd7bece52360482f9a51f19b34dac1d2678 removed some '#ifdef
KERNEL' blocks, but for one block in SOLARIS/osi_machdep.h, the wrong
trailing #endif was removed. This effectively makes the last part of
the file Solaris 10+ only, and bypasses the header guard. On systems
before Solaris 10, this causes us to lose the osi_procname definition,
which eventually shows up as an undefined symbol.

So, reinstate the original #endif, and remove the correct #endif
instead.

Reviewed-on: http://gerrit.openafs.org/7042
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
(cherry picked from commit a66268f69a2da0dc21957338eebe5c91b279ddda)

Change-Id: I0edd54c9984c591d56531e4eb210e8374ed8b608
Reviewed-on: http://gerrit.openafs.org/7045
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Alistair Ferguson <alistair.ferguson@mac.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
13 years agoviced: AFSDisk, AFSFetchVolumeStatus Int31 PartSize
Jeffrey Altman [Tue, 3 Apr 2012 02:35:41 +0000 (22:35 -0400)]
viced: AFSDisk, AFSFetchVolumeStatus Int31 PartSize

The AFSDisk and AFSFetchVolumeStatus structures use signed
32-bit integers for representation partition size and
available blocks.  RoundInt64ToInt31() should be used instead
of RoundInt64ToInt32() when assigning their values.

Change-Id: I3834141fce2d54ce8bdfac3dc566074583bb305e
Reviewed-on: http://gerrit.openafs.org/7022
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Tested-by: Derrick Brashear <shadow@dementix.org>
(cherry picked from commit e8f6dfac59fe042a04a9ac5eb3c37356cb3a22a3)
Reviewed-on: http://gerrit.openafs.org/7023
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>
13 years agoWindows: Fix VNOSERVICE EventLog parameters
Jeffrey Altman [Tue, 27 Mar 2012 04:00:30 +0000 (00:00 -0400)]
Windows: Fix VNOSERVICE EventLog parameters

Add missing volume and cell.

Reviewed-on: http://gerrit.openafs.org/6969
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>
(cherry picked from commit d1d51852be1daf45f92a8cbf5f294892141108f2)

Change-Id: I86004a463b118493828c5296b684a019085e59fd
Reviewed-on: http://gerrit.openafs.org/6974
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>
13 years agomacos: iterate mdfound packagemakers when spaces are present
Derrick Brashear [Tue, 27 Mar 2012 16:09:38 +0000 (12:09 -0400)]
macos: iterate mdfound packagemakers when spaces are present

even if we get more than one match, and even if there's a space,
work anyway

Reviewed-on: http://gerrit.openafs.org/6971
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Tested-by: Derrick Brashear <shadow@dementix.org>
(cherry picked from commit 745e1bb00350ac481cd0998b1623b6e040fc7312)

Change-Id: Ibd4ca5cbd5cee45793735cede8cf488a944add3c
Reviewed-on: http://gerrit.openafs.org/6972
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
13 years agomacos: find packagemaker instead of assuming path
Derrick Brashear [Tue, 27 Mar 2012 00:33:26 +0000 (20:33 -0400)]
macos: find packagemaker instead of assuming path

in xcode 4.3, packagemaker is unbundled. make no assumptions
about where it can be found; instead, let spotlight tell us

Reviewed-on: http://gerrit.openafs.org/6966
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
(cherry picked from commit fba35ba4e1d933126c788824f464a78ca1c93bf8)

Change-Id: I5d4083fa743ef181d680ffc2934a56d8429a75dc
Reviewed-on: http://gerrit.openafs.org/6968
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Tested-by: Derrick Brashear <shadow@dementix.org>
13 years agoosx: deal with more kerberos damage
Derrick Brashear [Thu, 15 Mar 2012 15:51:39 +0000 (11:51 -0400)]
osx: deal with more kerberos damage

the number of things which can return success without succeeding is
truly sad.

Reviewed-on: http://gerrit.openafs.org/6911
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Tested-by: Derrick Brashear <shadow@dementix.org>
(cherry picked from commit 59b57ff85acbef10bcec9724c42e3bad78538687)

Change-Id: I487ece6f991157a95e200f7764027902a2402e7b
Reviewed-on: http://gerrit.openafs.org/6965
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Tested-by: Derrick Brashear <shadow@dementix.org>
13 years agoviced: Do not ignore all InlineBulkStatus errors
Andrew Deason [Fri, 2 Mar 2012 20:55:04 +0000 (14:55 -0600)]
viced: Do not ignore all InlineBulkStatus errors

InlineBulkStatus currently returns 0 unconditionally, no matter what
errors are encountered. If we encounter an error early enough, from
CallPreamble for example, we do not fill in the OutStats nor CallBacks
structures at all. Since we return success anyway, this results in the
client getting AFSFetchStatus structures full of zeroes (or garbage,
before commit 726e1e13ff93e2cc1ac21964dc8d906869e64406).

Since current OpenAFS clients do not perform any sanity checks on the
information received, this can result in cache corruption of files
being seen incorrectly as empty, and, before commit 726e1e, more
arbitrary corruption.

So instead, return an error if we encounter an error before we iterate
over the given FIDs. We still of course do not return an error for any
errors encountered during the actual metadata retrieval, as those are
reflected in the individual per-fid status structures.

Reviewed-on: http://gerrit.openafs.org/6871
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
(cherry picked from commit 690a4c144b53fd1f3538d83017ecf581a2bcded5)

Change-Id: I364b35cfa865d88ab664e45a5d1fc9c542cffc1a
Reviewed-on: http://gerrit.openafs.org/6957
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
13 years agodoc: correct implicit ACL permissions volume owner
Jeffrey Altman [Sun, 25 Mar 2012 13:56:48 +0000 (09:56 -0400)]
doc: correct implicit ACL permissions volume owner

OpenAFS changed the behavior of implicit administrator permission
for directory ownership.  In OpenAFS only the volume root directory
owner has implicit administrator permissions and they apply to all
directories in the volume not just those with matching ownership.

Reviewed-on: http://gerrit.openafs.org/6951
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
(cherry picked from commit 95ec152a850c0cde33829481b8e71e7e7e686a58)

Change-Id: I33fd24db250ef03a60f7f24853715e6f76d297a8
Reviewed-on: http://gerrit.openafs.org/6952
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>
13 years agoWindows: Client handling of VNOSERVICE
Jeffrey Altman [Thu, 22 Mar 2012 19:55:47 +0000 (15:55 -0400)]
Windows: Client handling of VNOSERVICE

VNOSERVICE should not be grouped together with the volume status
error codes.  It is used to indicate that the RPC was not serviced.
The file server issues it when its idle dead timeout period is reached
while receiving rx call data.  The client's existing status information
is still valid and the client can retry the call.

Reviewed-on: http://gerrit.openafs.org/6938
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>
(cherry picked from commit 39964d08792f3a09694f97d7c7fa76a86ca213a7)

Change-Id: I2baf441144d24411907760175cc7fa665dc33e41
Reviewed-on: http://gerrit.openafs.org/6940
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>
13 years agoLinux 3.4: Switch to d_make_root
Marc Dionne [Thu, 22 Mar 2012 02:19:04 +0000 (22:19 -0400)]
Linux 3.4: Switch to d_make_root

If d_make_root is available, use it instead of d_alloc_root.
The helper was introduced in 3.3, and d_alloc_root gets removed
in 3.4.

Reviewed-on: http://gerrit.openafs.org/6931
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
(cherry picked from commit f246aa5f84a5233b6525ae43456a8da5b7e92984)

Change-Id: I036a3845d72f99c8ba647975593da496c12a53c1
Reviewed-on: http://gerrit.openafs.org/6932
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
13 years agoLINUX: Use afs_convert_code in afs_notify_change
Andrew Deason [Wed, 22 Feb 2012 21:40:20 +0000 (15:40 -0600)]
LINUX: Use afs_convert_code in afs_notify_change

afs_notify_change currently just returns "-code". This can cause a
panic if the error code is negative, since we will return a positive
error code, which may get interpreted as a valid pointer value in
higher levels.

Specifically, if we hit afs_notify_change via something like this code
path:

do_sys_open -> do_filp_open -> open_namei -> may_open -> do_truncate
-> notify_change -> afs_notify_change (via inode->i_op->setattr)

the positive error value will be interpreted by do_sys_open as a valid
'struct file' pointer, and will be dereferenced.

So pass the return value through afs_convert_code, like all of the
other vnode ops, so we ensure we return an error properly.

Reviewed-on: http://gerrit.openafs.org/6776
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
(cherry picked from commit 634c6f184b17e30ade86c0a838ab55ddddc730d6)

Change-Id: I5083f6ce4bea5b3bea551e5d47155453b7ff2328
Reviewed-on: http://gerrit.openafs.org/6918
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Alistair Ferguson <alistair.ferguson@mac.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
13 years agoLINUX: move afs_notify_change to osi_vnodeops.c
Andrew Deason [Wed, 22 Feb 2012 21:36:37 +0000 (15:36 -0600)]
LINUX: move afs_notify_change to osi_vnodeops.c

afs_notify_change is almost always used solely in inode_operations
structs, and is more similar to the other per-vnode functions. Put it
with the other per-vnode functions for better organization, and so
they can use the same static functions.

Move the helper functions iattr2vattr and vattr2inode along with it.

Reviewed-on: http://gerrit.openafs.org/6775
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
(cherry picked from commit 620d4169b73088579e691aec2cfdafc7f44e2fee)

Change-Id: If721c0b13518f8a925f39bcfa1dff005ce97a6cb
Reviewed-on: http://gerrit.openafs.org/6917
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
13 years agoafs: Never #define away afsd_dynamic_vcaches
Andrew Deason [Wed, 7 Mar 2012 22:36:57 +0000 (16:36 -0600)]
afs: Never #define away afsd_dynamic_vcaches

Some versions of the Solaris Studio compiler on SPARC (at least 12.2
and possibly others, but not 12.3) get a little confused by code like
this:

    extern int foo;
    int
    somefunc(void) {
        if (0) return foo;
        return 0;
    }

When optimization is turned off, this results in an undefined symbol
reference to 'foo' (which is normal), but the resulting object file
lacks a relocation entry for the symbol 'foo', so the symbol remains
undefined after linking. In the OpenAFS tree, this occurs in
afs_daemons.c which references afs_vcount and afs_cacheStats in this
manner due to afsd_dynamic_vcaches being defined as '0' on Solaris.
The end result is that the libafs kernel module is not loadable, since
it complains about afs_vcount and afs_cacheStats being undefined, even
though the symbol definitions are also in the module.

While this is a bug in Solaris Studio and has since been fixed, it is
simple to work around this so we are usable with more compilers. If we
just always declare afsd_dynamic_vcaches as a regular variable, it
works around this issue and keeps the code a tiny bit simpler. So, do
that.

Reviewed-on: http://gerrit.openafs.org/6888
Tested-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
(cherry picked from commit e5821239cde138f74f73bec1bd9a3880d08ac3df)

Change-Id: I42073ebc7d6822f05de89f1c38370dd70e5c7508
Reviewed-on: http://gerrit.openafs.org/6910
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
13 years agorx: hold call->lock across RXS_PreparePacket
Simon Wilkinson [Wed, 14 Mar 2012 14:56:06 +0000 (10:56 -0400)]
rx: hold call->lock across RXS_PreparePacket

RX Security Classes have a right to assume that when RXS_PreparePacket
is called that they have exclusive access to the rx_call structure.
Commit e445faa68c5ec6e47d3fd9d7318ade71d98703a9 unintentionally
failed to acquire the call->lock prior to RXS_PreparePacket being
called.

Reviewed-on: http://gerrit.openafs.org/6904
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Alistair Ferguson <alistair.ferguson@mac.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>
(cherry picked from commit 0fdcf171a8d2b2153648b6b799096e09eb469beb)

Change-Id: I184a3c71418eb78742fbf1bf609daca1aea57f26
Reviewed-on: http://gerrit.openafs.org/6909
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
13 years agoredhat: Don't replace modified configuration files during rpm update
Jonathan Billings [Thu, 8 Mar 2012 14:23:40 +0000 (09:23 -0500)]
redhat: Don't replace modified configuration files during rpm update

The previous setting for three %config files mentioned in the spec file:

%config /etc/sysconfig/openafs
%config %{_prefix}/vice/etc/ThisCell
%config %{_prefix}/vice/etc/cacheinfo

When using an unadorned %config, it's possible that these files will
be replaced by the packaged version during a package update.  Changing
%config to %config(noreplace) means that the packaged file will be
installed with the extension .rpmnew if there is already a modified
(from the existing package's version) file with the same name on the
installed machine.

The concern here is that updating an existing system could potentially
change the configuration if the person installing doesn't pay close
attention.  The Rule of Least Surprise indicates that we should
try to preserve existing configuration changes whenever possible.

Change-Id: Ie132c12a3c5defe9bf6fec9ec0f8bd08f3d98646
Reviewed-on: http://gerrit.openafs.org/6887
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Tested-by: Derrick Brashear <shadow@dementix.org>
Reviewed-on: http://gerrit.openafs.org/6889
Tested-by: BuildBot <buildbot@rampaginggeek.com>
13 years agoviced: fix inverted lockCount assignment
Jens Wegener [Tue, 6 Mar 2012 13:28:32 +0000 (07:28 -0600)]
viced: fix inverted lockCount assignment

FIXES 130605

Reviewed-on: http://gerrit.openafs.org/6884
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
(cherry picked from commit 7dce85e4e5db7420c5c359fdd02a8005a12fb29c)

Change-Id: I518c753e04d0e23ef2da39b0773b5c12c2833551
Reviewed-on: http://gerrit.openafs.org/6891
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>
13 years agoWindows: 1.6.1pre4 change log
Jeffrey Altman [Sun, 4 Mar 2012 21:18:22 +0000 (16:18 -0500)]
Windows: 1.6.1pre4 change log

Change-Id: Ie00cd79a113a3729b0318da1856962fc613a2259
Reviewed-on: http://gerrit.openafs.org/6872
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>
13 years agomacos: don't crash on krb5 damage
Derrick Brashear [Sun, 4 Mar 2012 14:48:07 +0000 (09:48 -0500)]
macos: don't crash on krb5 damage

if we get success but still no client, don't crash

Reviewed-on: http://gerrit.openafs.org/6868
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Tested-by: Derrick Brashear <shadow@dementix.org>
(cherry picked from commit 0a3f0608fcf6c14b44484cfa6fe106c568aa1035)

Change-Id: I6c3147ab45552d9f393a05de21cc06d2dcabcf38
Reviewed-on: http://gerrit.openafs.org/6870
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Tested-by: Derrick Brashear <shadow@dementix.org>
13 years agoFixes dkms.conf for Redhat Enterprise
Dave Botsch [Thu, 1 Mar 2012 17:43:36 +0000 (12:43 -0500)]
Fixes dkms.conf for Redhat Enterprise

commit 8e0aaae076f4cccfd2d6ed81ede4e355235b578e , while fixing dkms.conf for
Fedora, broke dkms.conf for RHEL. In RHEL, you get a dkms.conf with too
many backslashes in the "mv" line. The dkms.conf should have the mv line
reading:

mv src/libafs/MODLOAD-*/\$KMODNAME \$DSTKMOD"

for Fedora.

This change checks if we are building on Fedora, and if so, maintains
the extra backslashes. Otherwise, not.

modified:   src/packaging/RedHat/openafs.spec.in

Uses the dist tags as specified at
http://fedoraproject.org/wiki/Packaging:DistTag

Reviewed-on: http://gerrit.openafs.org/6851
Reviewed-by: Ken Dreyer <ktdreyer@ktdreyer.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
(cherry picked from commit 81a9a33e0bc5455841ba105dab52735c64c7096b)

Change-Id: I7b1e09700d9b17e6616be71ab9dd8bc0a760996d
Reviewed-on: http://gerrit.openafs.org/6862
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Tested-by: Derrick Brashear <shadow@dementix.org>
13 years agounix: always retry RX_CALL_BUSY
Jeffrey Altman [Thu, 1 Mar 2012 20:49:12 +0000 (15:49 -0500)]
unix: always retry RX_CALL_BUSY

RX_CALL_BUSY is an indication that the call channel is busy not
that the server is down or otherwise cannot respond.  Unconditionally
retry the RPC and do not alter state.  We just want to force the use
of a different call channel.

Reviewed-on: http://gerrit.openafs.org/6852
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Hartmut Reuter <reuter@rzg.mpg.de>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>
(cherry picked from commit 579976cf246bd55dea2dfd3bf8470fd8bb8bde0a)

Change-Id: I1ab5ed69dc707f13620d91a01227679c47bb97df
Reviewed-on: http://gerrit.openafs.org/6853
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>
13 years agoWindows: Workaround Win7 SMB Reconnect Bug
Jeffrey Altman [Wed, 29 Feb 2012 18:07:47 +0000 (13:07 -0500)]
Windows: Workaround Win7 SMB Reconnect Bug

The SMB specification permits the server to save a round trip
in the GSS negotiation by sending an initial security blob.
Unfortunately, doing so trips a bug in Windows 7 and Server 2008 R2
whereby the SMB 1.x redirector drops the blob on the floor after
the first connection to the server and simply attempts to reuse
the previous authentication context.  This bug can be avoided by
the server sending no security blob in the SMB_COM_NEGOTIATE
response.  This forces the client to send an initial GSS init_sec_context
blob under all circumstances which works around the bug in Microsoft's
code.

Do not call smb_NegotiateExtendedSecurity(&secBlob, &secBlobLength);

As a result of the SMB 1.x bug, all attempts to reconnect fail due to
SMB connection resets.  The SMB 1.x redirector will retry indefinitely
but all processes with outstanding requests to \\AFS will block until
the machine is rebooted.

Reviewed-on: http://gerrit.openafs.org/6846
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
(cherry picked from commit 28a33f8492098c23f7c3c58763ace93b82ea80a7)

Change-Id: Iae19a76dfbcb95c5e3cdea046a97f26feba86b33
Reviewed-on: http://gerrit.openafs.org/6848
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>
13 years agoWindows: disable Adv ICF support if not supported
Jeffrey Altman [Sun, 26 Feb 2012 19:45:43 +0000 (14:45 -0500)]
Windows: disable Adv ICF support if not supported

OpenAFS 1.6.x does not require the use of SDK 6.0 or above.
Therefore the Advanced Internet Connection Firewall support
may not be available.  In particular, the 32-bit distribution
for 1.6.x does not rely on SDK 6.0 or higher.

This is a 1.6.x only change.

Change-Id: I8ab5bbf4c5d6e4893d5389c04ec020114a3d5683
Reviewed-on: http://gerrit.openafs.org/6841
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>
13 years agoWindows: ChangeLog for 1.6.1pre3
Jeffrey Altman [Sun, 26 Feb 2012 15:52:53 +0000 (10:52 -0500)]
Windows: ChangeLog for 1.6.1pre3

Change-Id: Ie2264743a69f330718c3ddedfd5dd93b43294a8c
Reviewed-on: http://gerrit.openafs.org/6838
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Tested-by: Derrick Brashear <shadow@dementix.org>
13 years agoWindows: failover and retry for VBUSY
Jeffrey Altman [Wed, 18 Jan 2012 00:46:30 +0000 (19:46 -0500)]
Windows: failover and retry for VBUSY

When a file server returns the VBUSY error for an RPC the
cache manager records the 'srv_busy' state in the cm_serverRef_t
structure binding that file server to the active cm_volume_t
object.  The 'srv_busy' was never cleared which prevents the
volume from being accessed.

Clear the 'srv_busy' flag whenever cm_Analyze() receives a
CM_ERROR_ALLBUSY error which means that all replicas have
been tried or whenever the error is not VBUSY or VRESTARTING.

FIXES 130537

Reviewed-on: http://gerrit.openafs.org/6563
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>
(cherry picked from commit 9056d09887c84a480e0a9ee3457a9469fbb97064)

Change-Id: Ifd8204a3bba83a893188e96f85b1ad3ba078fe49
Reviewed-on: http://gerrit.openafs.org/6831
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>
13 years agoWindows: improved idle dead time handling
Jeffrey Altman [Fri, 25 Nov 2011 14:28:18 +0000 (09:28 -0500)]
Windows: improved idle dead time handling

RX_CALL_IDLE has been treated the same as RX_CALL_DEAD which is
a fatal error that results in the server being marked down.  This
is not the appropriate behavior for an idle dead timeout error
which should not result in servers being marked down.

Idle dead timeouts are locally generated and are an indication
that the server:

 a. is severely overloaded and cannot process all
    incoming requests in a timely fashion.

 b. has a partition whose underlying disk (or iSCSI, etc) is
    failing and all I/O requests on that device are blocking.

 c. has a large number of threads blocking on a single vnode
    and cannot process requests for other vnodes as a result.

 d. is malicious.

RX_CALL_IDLE is distinct from RX_DEAD_CALL in that idle dead timeout
handling should permit failover to replicas when they exist in a
timely fashion but in the non-replica case should not be triggered
until the hard dead timeout.  If the request cannot be retried, it
should fail with an I/O error.  The client should not retry a request
to the same server as a result of an idle dead timeout.

In addition, RX_CALL_IDLE indicates that the client has abandoned
the call but the server has not.  Therefore, the client cannot determine
whether or not the RPC will eventually succeed and it must discard
any status information it has about the object of the RPC if the
RPC could have altered the object state upon success.

This patchset splits the RX_CALL_DEAD processing in cm_Analyze() to
clarify that only RX_CALL_DEAD errors result in the server being marked
down.  Since Rx idle dead timeout processing is per connection and
idle dead timeouts must differ depending upon whether or not replica
sites exist, cm_ConnBy*() are extended to select a connection based
upon whether or not replica sites exist.  A separate connection object
is used for RPCs to replicated objects as compared to RPCs to non-replicated
objects (volumes or vldb).

For non-replica connections the idle dead timeout is set to the hard
dead timeout.  For replica connections the idle dead timeout is set
to the configured idle dead timeout.

Idle dead timeout events and whether or not a retry was triggered
are logged to the Windows Event Log.

cm_Analyze() is given a new 'storeOp' parameter which is non-zero
when the execute RPC could modify the data on the file server.

Reviewed-on: http://gerrit.openafs.org/6118
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
(cherry picked from commit f768fb95f3eb3815d6225e074c43341ed2ad5347)

Change-Id: If7194292be0fc2350af9f26c397bd3a1e840abdc
Reviewed-on: http://gerrit.openafs.org/6830
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>
13 years agoWindows: cm_UpdateCell never applies to Freelance mode
Jeffrey Altman [Fri, 24 Feb 2012 17:21:46 +0000 (12:21 -0500)]
Windows: cm_UpdateCell never applies to Freelance mode

The Freelance.Local.Cell is updated by the registry monitor
thread and cm_UpdateCell should be a no-op.  Make it so.

Reviewed-on: http://gerrit.openafs.org/6791
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>
(cherry picked from commit cfb7f205d8153899c0165594a29d91926a40425d)

Change-Id: I2607ea87ebcc849474f4e0a183d7ad4eba121de9
Reviewed-on: http://gerrit.openafs.org/6829
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>
13 years agoWindows: fix cm_DirOpDelBuffer assert
Jeffrey Altman [Fri, 3 Feb 2012 16:21:45 +0000 (11:21 -0500)]
Windows: fix cm_DirOpDelBuffer assert

In cm_DirOpDelBuffer() the data version field for a buffer
in cm_dirOp_t.buffers[] can be CM_BUF_VERSION_BAD if the buffer
was added to the buffer list but was never fetched from the file
server.  If the buffer was recycled by buf_Get() an attempt to
remove an entry from the directory will be failed as opposed to
fetching the buffer from the file server and performing the local
removal.

Reviewed-on: http://gerrit.openafs.org/6650
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>
(cherry picked from commit 865f2442e682ff71b28a6b21363de8262f9e2bd1)

Change-Id: I4d822d9286ca891fc50cf04fdd68272c0af2e38e
Reviewed-on: http://gerrit.openafs.org/6828
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>
13 years agoWindows: buffer DV ranges do not work for directories
Jeffrey Altman [Fri, 3 Feb 2012 16:17:40 +0000 (11:17 -0500)]
Windows: buffer DV ranges do not work for directories

In cm_MergeStatus, always set cm_scache_t.bufDataVersionLow
to the new data version because the cm_dir package does not
support version ranges.   All modified dir buffers have their
dataVersion field set to the current data version value.

Failure to update the bufDataVersionLow field can result in
B+ Trees being constructed from out of date directory information.

Reviewed-on: http://gerrit.openafs.org/6649
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>
(cherry picked from commit 25142a9c2db933607507ee20e20216c635465d6d)

Change-Id: I9bdad7bed4ce76e0425adff433982b9bf35ac15f
Reviewed-on: http://gerrit.openafs.org/6827
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>
13 years agoWindows: VIOC_GETUNIXMODE = smb_IoctlGetUnixMode
Jeffrey Altman [Sun, 22 Jan 2012 23:38:49 +0000 (18:38 -0500)]
Windows: VIOC_GETUNIXMODE = smb_IoctlGetUnixMode

VIOC_GETUNIXMODE pioctl should execute smb_IoctlGetUnixMode not
smb_IoctlSetUnixMode.

Reviewed-on: http://gerrit.openafs.org/6600
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>
(cherry picked from commit 1474b4a739c60f96a8d2e38546778ab9572c138d)

Change-Id: I248effacd831849f33fe0fd9785d3c00117a2607
Reviewed-on: http://gerrit.openafs.org/6826
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>
13 years agoWindows: fix fs setcrypt help message
Jeffrey Altman [Sun, 22 Jan 2012 23:37:14 +0000 (18:37 -0500)]
Windows: fix fs setcrypt help message

Options are on, auth, and off.

Reviewed-on: http://gerrit.openafs.org/6599
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>
(cherry picked from commit 898930fc3ca81a5e5dde31967c00cdf5f4734ffa)

Change-Id: I6ef9294554eeedc9f6963a92b815e118fff87139
Reviewed-on: http://gerrit.openafs.org/6825
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>
13 years agoWindows; release BIOD after status merge
Jeffrey Altman [Sun, 22 Jan 2012 23:33:43 +0000 (18:33 -0500)]
Windows; release BIOD after status merge

Releasing the BIOD permits the accumulated buffers to be accessed.
Releasing the BIOD before the cm_MergeStatus() call creates a
window where the buffer data version is larger than the cm_scache
data version.  Release the BIOD after the status merge.

Reviewed-on: http://gerrit.openafs.org/6598
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>
(cherry picked from commit 111de76ea8dac713247c99ebe2182ae16cc0a3c0)

Change-Id: I7c8dd9f3e22e83b82679b9d3a4ee3aa5f45a49aa
Reviewed-on: http://gerrit.openafs.org/6824
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>
13 years agoWindows: cm_buf refcnt must hold buf_globalLock
Jeffrey Altman [Thu, 19 Jan 2012 20:25:44 +0000 (15:25 -0500)]
Windows: cm_buf refcnt must hold buf_globalLock

An assertion in buf_Recycle() was being triggered when a cm_buf_t
object was supposed to be in the free buffer list but wasn't.
buf_Recycle() was racing with another thread.  The test for
refCount == 0 was performed while holding the buf_globalLock
exclusively but the InterlockedDecrement(refCount) in buf_Release()
was performed without holding buf_globalLock at all.  buf_globalLOck
must be held at least as a read lock.  Otherwise, the refCount can
reach 0 prior to the thread blocking for exclusive access to the
buf_globalLock.  This provides buf_Recycle() which is holding
buf_globalLock the opportunity to race.

The solution is to make sure that buf_Release() always holds
buf_globalLock as a read lock and then use buf_ReleaseLocked()
to perform the actual decrement and test.

Reviewed-on: http://gerrit.openafs.org/6576
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>
(cherry picked from commit 22cba8e9702f3673c335bf834a9ee2c5e5fd9b6e)

Change-Id: I82c6480859a85e00e8602421204dac9a9ce588ed
Reviewed-on: http://gerrit.openafs.org/6823
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>
13 years agoWindows: restrict service to 2 cpus by default
Jeffrey Altman [Sat, 14 Jan 2012 15:31:01 +0000 (10:31 -0500)]
Windows: restrict service to 2 cpus by default

Performance drops off considerably when the number of processors
increases due to lock contention and the cm_SyncOp wait processing.
If the MaxCPUs registry value is not set, limit ourselves to two.
Setting MaxCPUs to zero permits use of all CPUs.

Reviewed-on: http://gerrit.openafs.org/6555
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>
(cherry picked from commit 69196e41ec9c5a6ce8efd370fb8582f66667bcf7)

Change-Id: I0cf2d2eeb3d8f7c708e7c365520f10fcd5f22d83
Reviewed-on: http://gerrit.openafs.org/6822
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>
13 years agoWindows: dir buffers out of date - mark them as such
Jeffrey Altman [Wed, 4 Jan 2012 02:10:32 +0000 (21:10 -0500)]
Windows: dir buffers out of date - mark them as such

if cm_CheckForSingleDirChange() fails, mark the cm_scache_t
bufDataVersionLow as the current data version so that old directory
buffers are discarded.

Reviewed-on: http://gerrit.openafs.org/6498
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>
(cherry picked from commit e77b6858ee889ec9e4e3fe3bb62c23b1c1f5727f)

Change-Id: I8b149d3655c249fc3ea034d179b919f4370f19a2
Reviewed-on: http://gerrit.openafs.org/6821
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>
13 years agoWindows: replace strdup with xdr_alloc in callback processing
Jeffrey Altman [Wed, 28 Dec 2011 22:07:01 +0000 (17:07 -0500)]
Windows: replace strdup with xdr_alloc in callback processing

The CRT allocator cannot be used for memory that will be freed
by afsrpc.dll.  Use xdr_alloc() instead.

Reviewed-on: http://gerrit.openafs.org/6439
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
(cherry picked from commit 19f1e0f7cf40c3da1d49c789358bd814f7e3b3eb)

Change-Id: Ie2359b4df312d090f0579ecd6d50ee197b51d68a
Reviewed-on: http://gerrit.openafs.org/6820
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>
13 years agoWindows: kauth search for kerberos iv port first
Jeffrey Altman [Sat, 24 Dec 2011 20:16:12 +0000 (15:16 -0500)]
Windows: kauth search for kerberos iv port first

Modify src/kauth/user_nt.c to match the service name search
order of the Unix code:

 kerberos4
 kerberos-iv
 kerberos

The standard Windows SERVICES file includes "kerberos-iv" as
port 750.

FIXES 127907

Reviewed-on: http://gerrit.openafs.org/6430
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
(cherry picked from commit 2cdd59d8f318193d0ef7937910466531caf1c963)

Change-Id: I936c35bbd45395f26ad6c523b72398584d1384f9
Reviewed-on: http://gerrit.openafs.org/6819
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
13 years agoWindows: cm_BufWrite() must wait in cm_SyncOp()
Jeffrey Altman [Sat, 24 Dec 2011 08:11:04 +0000 (03:11 -0500)]
Windows: cm_BufWrite() must wait in cm_SyncOp()

Now that it is permissible for more than one store data operation
to construct BIOD lists in parallel, cm_BufWrite() must be willing
to wait in cm_SyncOp().  Otherwise, the daemon threads will spin.

Reviewed-on: http://gerrit.openafs.org/6423
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>
(cherry picked from commit 17ce77f843e01ff96f66e05b4b932b0c6187493e)

Change-Id: I8ae9d057413252e73774c5209465223fa5a36947
Reviewed-on: http://gerrit.openafs.org/6818
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
13 years agoWindows: terminate HOSTS/LMHOSTS with newline
Jeffrey Altman [Sun, 18 Dec 2011 17:08:24 +0000 (12:08 -0500)]
Windows: terminate HOSTS/LMHOSTS with newline

If the original file did not terminate with a newline,
add one before appending the "AFS" entry.

FIXES 130210

Reviewed-on: http://gerrit.openafs.org/6375
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>
(cherry picked from commit 2d8f9141fa98df50ce682364ef5a7958ce422613)

Change-Id: I1a95a42b420b4695b52ae0c2e2de46cd97a5294a
Reviewed-on: http://gerrit.openafs.org/6817
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
13 years agoWindows: Update Adv Firewall Rules
Jeffrey Altman [Wed, 14 Dec 2011 17:58:36 +0000 (12:58 -0500)]
Windows: Update Adv Firewall Rules

Do not specify the Service Name property.  According to feedback
on openafs-info the Service Name blocks the rule from working properly.

If the rule already exists, attempt to remove the Service Name filter
and update NAT Edge Traversal and Permitted interface rules.

Reviewed-on: http://gerrit.openafs.org/6332
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>
(cherry picked from commit 2d472f94ab1017724e56bcdd29b9ef451a13f182)

Change-Id: I8184074adbd4c19426d87d48673402b3c8cd97a3
Reviewed-on: http://gerrit.openafs.org/6816
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
13 years agoWindows: memory leak when setting tokens via smb
Jeffrey Altman [Sat, 10 Dec 2011 18:28:17 +0000 (13:28 -0500)]
Windows: memory leak when setting tokens via smb

The SID string of the RPC used to set the token sessionKey
was being leaked.  Be sure to free it when it is no longer
required.

Reviewed-on: http://gerrit.openafs.org/6244
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>
(cherry picked from commit f30d70ba5575753302be0a2b08c27a639898d4aa)

Change-Id: I1133b50841919ca5957081c82625c2b1607c34ae
Reviewed-on: http://gerrit.openafs.org/6815
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
13 years agoWindows: apply Nat Pings only to cm_rootUser connections
Jeffrey Altman [Sat, 3 Dec 2011 22:49:47 +0000 (17:49 -0500)]
Windows: apply Nat Pings only to cm_rootUser connections

Use CM_UCELLFLAG_ROOTUSER flag to identify the cm_rootUser
connections and only apply Nat pings to those connections
instead of examining the security state of the connection.

Reviewed-on: http://gerrit.openafs.org/6208
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>
(cherry picked from commit 01f55bbf14210ef3e4f4c0246409af370de3a383)

Change-Id: Id26a955190aace50ca4740b910325474077941e1
Reviewed-on: http://gerrit.openafs.org/6814
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
13 years agoWindows: track cm_rootUser connections
Jeffrey Altman [Sat, 3 Dec 2011 22:46:41 +0000 (17:46 -0500)]
Windows: track cm_rootUser connections

Add CM_UCELLFLAG_ROOTUSER flag to cm_ucell_t for the purpose
of tracking which connections belong to the cm_rootUser.

Reviewed-on: http://gerrit.openafs.org/6207
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>
(cherry picked from commit 2495d02951fa1a9f6f48cc2a5bc7750f310dae75)

Change-Id: Ie0014200d9e3ed3832bf875a9788aad1f55f29ec
Reviewed-on: http://gerrit.openafs.org/6813
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
13 years agoWindows: fix buf_Recycle() comment
Jeffrey Altman [Fri, 2 Dec 2011 16:19:13 +0000 (11:19 -0500)]
Windows: fix buf_Recycle() comment

buf_Recycle() does not return with a reference count to the
cm_buf_t object held.  Correct the comment.

Reviewed-on: http://gerrit.openafs.org/6173
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>
(cherry picked from commit 7dccf17840a53e96b21f8c092910f3e4d7628b71)

Change-Id: I0890439df967f8b2a87d5079adcd71a646500876
Reviewed-on: http://gerrit.openafs.org/6812
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
13 years agoWindows: buf_CleanAsync is not async; rename it
Jeffrey Altman [Fri, 2 Dec 2011 16:14:11 +0000 (11:14 -0500)]
Windows: buf_CleanAsync is not async; rename it

buf_CleanAsync() calls cm_BufWrite() which stores the dirty
buffers synchronously.  There is nothing asynchronous about
buf_CleanAsync() so rename it to buf_Clean() and buf_CleanAsyncLocked()
to buf_CleanLocked().   Update the comments to remove the references
to the asynchronous processing which doesn't exist.

That is not to say that the call to buf_Clean() in buf_GetNewLocked()
should not be asynchronous; it should.  There is no such functionality
at the moment.  One approach would be to modify buf_IncrSyncer to
trigger on an event set by buf_GetNewLocked() instead of the call
to buf_Clean().  Another approach would be registering a background
store event.  In any case, that is for another patchset.

Reviewed-on: http://gerrit.openafs.org/6172
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>
(cherry picked from commit c712403f192bd9932f3ec1dce5fb23461d3d0349)

Change-Id: Ib8d5bb06b0c4ffa3e53d53e24ca9f970b7cb63b0
Reviewed-on: http://gerrit.openafs.org/6811
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
13 years agoWindows: Wix cell names can be greater than 120 chars
Jeffrey Altman [Mon, 28 Nov 2011 23:45:55 +0000 (18:45 -0500)]
Windows: Wix cell names can be greater than 120 chars

Increase the permitted length in the UI to 255 characters.

Reviewed-on: http://gerrit.openafs.org/6133
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>
(cherry picked from commit bf4f9f33dc55150d991d9eec4ea95d78208f6949)

Change-Id: Ibf24b85990a054e84724c52e481c19098fe5cbe0
Reviewed-on: http://gerrit.openafs.org/6810
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
13 years agoWindows: cm_GetSCache do not release unheld lock
Jeffrey Altman [Mon, 21 Nov 2011 18:14:40 +0000 (13:14 -0500)]
Windows: cm_GetSCache do not release unheld lock

if cm_GetNewSCache() fails, an attempt would be made to
release cm_scacheLock which is not held.  However, it should
be noted that cm_GetNewSCache() cannot fail without itself
triggering a panic.

Reviewed-on: http://gerrit.openafs.org/6103
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
(cherry picked from commit d42db13152fb8fa374db6531020da6effca51ab4)

Change-Id: Ibb3aff0a256c6846ac8b9336a50ea021f8a1e2f6
Reviewed-on: http://gerrit.openafs.org/6809
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
13 years agoWindows: buf_CleanAsyncLocked dirty range only
Jeffrey Altman [Tue, 15 Nov 2011 23:35:26 +0000 (18:35 -0500)]
Windows: buf_CleanAsyncLocked dirty range only

buf_CleanAsyncLocked() should not instruct cm_BufWrite() to
write a full chunk if the current buffer is the only one that
is dirty.  cm_BufWrite() will determine if it is appropriate
to fill a full chunk when storing.  Instructing it to check
a full chunk forces it to do more work than necessary.

Reviewed-on: http://gerrit.openafs.org/6054
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>
(cherry picked from commit fd42e08bf1882a02c3200e1c33a101e644aa046a)

Change-Id: Ibbd823feb5fe18f0ab0ee54af8c9b8ccb531c8bc
Reviewed-on: http://gerrit.openafs.org/6808
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
13 years agoWindows: cm_SetupStoreBIOD use firstModOffset chunk
Jeffrey Altman [Wed, 16 Nov 2011 00:00:05 +0000 (19:00 -0500)]
Windows: cm_SetupStoreBIOD use firstModOffset chunk

When cm_SetupStoreBIOD attempts to store a chunk to the file
server it should not use *inOffsetp as the start of the range.
There is no guarantee that the buffer at *inOffsetp is dirty.
Instead use firstModOffset which refers to the first known
dirty buffer in the range specified by the caller.  Attempt
to fill a chunk of consecutive dirty buffers from that point.

Reviewed-on: http://gerrit.openafs.org/6057
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
(cherry picked from commit 320c7292e6ae014e44e89b0da736bcc04ef42b2b)

Change-Id: I26f7fc9e0c7281ca2118205d7916102c2471bb43
Reviewed-on: http://gerrit.openafs.org/6807
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
13 years agoWindows: smb_ReceiveNTCreateX create smb_fid earlier
Jeffrey Altman [Sat, 12 Nov 2011 23:33:18 +0000 (18:33 -0500)]
Windows: smb_ReceiveNTCreateX create smb_fid earlier

smb_ReceiveNTCreateX() calls cm_CheckNTOpen() which now
requires the smb_fid_t allocated fid value for use in share
mode locking.   Move the allocation of the smb_fid earlier
in the function and apply necessary cleanup in error paths.

Reviewed-on: http://gerrit.openafs.org/6004
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>
(cherry picked from commit 38fbf93fcc21aaecbf9a7e27d19131b9de4c3839)

Change-Id: I9399d8f16ee236b4724a0ec825fca1ce72f363ce
Reviewed-on: http://gerrit.openafs.org/6806
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
13 years agoWindows: fix locking hierarchy in service
Jeffrey Altman [Sat, 12 Nov 2011 18:41:30 +0000 (13:41 -0500)]
Windows: fix locking hierarchy in service

The smb username lock and the daemon global lock can be requested
while the scache dirlock is held if there are no free buffers
and the service is forced to claw back extents from the redirector.
Adjust the locking hierarchy accordingly.

Reviewed-on: http://gerrit.openafs.org/6000
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>
(cherry picked from commit 2fc9edc6e34ebef60413fad9a2af2aa73ea1681f)

Change-Id: I74e87494c1360c61812908e3b4fb012829f71cf3
Reviewed-on: http://gerrit.openafs.org/6805
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
13 years agoWindows: log SMB or RDR in use at startup
Jeffrey Altman [Sat, 3 Sep 2011 22:17:21 +0000 (18:17 -0400)]
Windows: log SMB or RDR in use at startup

SMB only in 1.6

Reviewed-on: http://gerrit.openafs.org/5338
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
(cherry picked from commit b861e17c0bc34ea2042879bc705f5d26a7e0a77f)

Change-Id: I67569c2d261a8afbbffbe7777e360139d25c73ca
Reviewed-on: http://gerrit.openafs.org/6804
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
13 years agoWindows: Add version number to event log start pending message
Jeffrey Altman [Sun, 24 Oct 2010 04:21:26 +0000 (00:21 -0400)]
Windows: Add version number to event log start pending message

LICENSE MIT

Reviewed-on: http://gerrit.openafs.org/3034
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
(cherry picked from commit b743b32b8b715edf673833a150f9f3d5a72b0b39)

Change-Id: Id7fb16cc9b7d00cb0a880bbdad9dff7bfffff78b
Reviewed-on: http://gerrit.openafs.org/6803
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
13 years agoWindows: afslogon network provider debug registry value
Jeffrey Altman [Sun, 28 Aug 2011 16:03:53 +0000 (12:03 -0400)]
Windows: afslogon network provider debug registry value

create a new TransarcAFSDaemon\NetworkProvider "Debug" value
to be used for activating the network provider debugging.
The overlapping use of TransarcAFSDaemon\Parameters "TraceOption"
is just too confusing.

Permit both methods to be used.

Reviewed-on: http://gerrit.openafs.org/5316
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
(cherry picked from commit 3d4e111dd6c4201476e7447fdfaa27ed630032c5)

Change-Id: Ibc8b56d64aa843076b191afa42c4a3e93cf7a26f
Reviewed-on: http://gerrit.openafs.org/6802
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
13 years agoWindows: afslogon.dll is not a file system interface
Jeffrey Altman [Fri, 26 Aug 2011 17:57:15 +0000 (13:57 -0400)]
Windows: afslogon.dll is not a file system interface

Do not return a file system network type that corresponds
to a real file system inter since afslogon is in fact not
associated with a file system interface.  We can't return
WNNC_NET_NONE (0) because that prevents NPLogonNotify()
from being executed.  However, if we return an in use
file system value that can confuse the system when the
actual file system's network provider is also installed.

Reviewed-on: http://gerrit.openafs.org/5313
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
(cherry picked from commit 9052974812e33d186613c31e318673f9268467c6)

Change-Id: I60bc66440b548c3901914df8193c3999c3388abc
Reviewed-on: http://gerrit.openafs.org/6801
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
13 years agoWindows: torture error reporting
Jeffrey Altman [Fri, 26 Aug 2011 13:36:04 +0000 (09:36 -0400)]
Windows: torture error reporting

When LeaveThread() is called and GetLastError() has already
been called, pass the last error value to LeaveThread().  Otherwise,
the GetLastError() call in LeaveThread() may return an inaccurrate
result.

Reviewed-on: http://gerrit.openafs.org/5312
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
(cherry picked from commit 209d59a61ba9614a8b9d231d828f74a3e9bdaa27)

Change-Id: I8f1b5b6431bad4413e7d81c95835ed852fbba16f
Reviewed-on: http://gerrit.openafs.org/6800
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
13 years agoWindows: change buf_Find*() signature to accept cm_fid_t
Jeffrey Altman [Tue, 23 Aug 2011 20:02:28 +0000 (16:02 -0400)]
Windows: change buf_Find*() signature to accept cm_fid_t

The buf_Find*() functions require a cm_fid_t to match with the
cm_buf_t objects not a cm_scache_t.  Change the signature so
that the cm_scache_t is not required.  It should be possible to
search for a buffer even if the cm_scache_t is not present in
the cache.

Reviewed-on: http://gerrit.openafs.org/5304
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
(cherry picked from commit c23b27a69322f4c9963a532d5cbcb136b23bb20c)

Change-Id: Ie4546de582e0ffe9103f1bb01e05cf387265da49
Reviewed-on: http://gerrit.openafs.org/6799
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
13 years agoWindows: do not drop lock unnecessarily
Jeffrey Altman [Sun, 21 Aug 2011 04:37:34 +0000 (00:37 -0400)]
Windows: do not drop lock unnecessarily

do not drop cm_serverLock for a cm_PutServer call since
it will only reacquire it.  use cm_PutServerNoLock() instead.

Reviewed-on: http://gerrit.openafs.org/5302
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
(cherry picked from commit b804e027f1a9d8dfaad3d348390a83493b53a6c7)

Change-Id: Ic9c4f1550636555568e3c67b2bb5f9e772116e9f
Reviewed-on: http://gerrit.openafs.org/6798
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
13 years agoWindows: cm_serverLock read required not write
Jeffrey Altman [Sun, 21 Aug 2011 04:36:44 +0000 (00:36 -0400)]
Windows: cm_serverLock read required not write

Reviewed-on: http://gerrit.openafs.org/5301
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
(cherry picked from commit bca64c70467afd00ca02290a4236bc295ec4633c)

Change-Id: I9c0c04ce619f2f85ae821621f9468715ba7deefe
Reviewed-on: http://gerrit.openafs.org/6797
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
13 years agoWindows: be explicit when mapping sharing violation
Jeffrey Altman [Fri, 19 Aug 2011 01:57:12 +0000 (21:57 -0400)]
Windows: be explicit when mapping sharing violation

Only one lock acquistion failure should be mapping to
CM_ERROR_SHARING_VIOLATION.  That is CM_ERROR_LOCK_NOT_GRANTED.
Make it clear that is what we are doing.

Reviewed-on: http://gerrit.openafs.org/5299
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
(cherry picked from commit a576ff1e53a539e88b9f3fa6b8132d4f161b0bd4)

Change-Id: I558c6989a2a8f4042129e2a60bcd340a7863222c
Reviewed-on: http://gerrit.openafs.org/6796
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
13 years agoWindows: avoid duplicate volume update queries
Jeffrey Altman [Tue, 9 Aug 2011 18:26:33 +0000 (14:26 -0400)]
Windows: avoid duplicate volume update queries

If multiple volume update queries have stacked up in
cm_UpdateVolumeLocation() and the active query failed,
do not re-issued the blocked queries.  Instead, prevent new
queries for 60 seconds and fail those that blocked during
the active query.

Reviewed-on: http://gerrit.openafs.org/5296
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
(cherry picked from commit 21acdd92c8510a9f99243588388a2a1078547533)

Change-Id: I7f0bc97ca7c194624ac854558bbed6b93a13ce63
Reviewed-on: http://gerrit.openafs.org/6795
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
13 years agoWindows: fix condition calls to osi_Log
Jeffrey Altman [Thu, 4 Aug 2011 21:21:59 +0000 (17:21 -0400)]
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.

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>
(cherry picked from commit 4e42d6fd18097d0c8d2e4b455d3c540743d7dbda)

Change-Id: Ic8063144a5069736c95a57965a28d6a101749b3e
Reviewed-on: http://gerrit.openafs.org/6794
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
13 years agoRewrite make_h_tree.pl in shell script
Andrew Deason [Fri, 24 Feb 2012 00:28:21 +0000 (18:28 -0600)]
Rewrite make_h_tree.pl in shell script

The current usage of make_h_tree.pl adds a build requirement of
/usr/bin/perl that we did not have prior to commit
1d6593e952ce82c778b1cd6e40c6e22ec756daf1. Do the same thing in a
bourne shell script instead, so we don't need perl.

Note that this is not as generalized as make_h_tree.pl, but it doesn't
need to be. Specifically, this does not strip a leading ../ from found
include directives (nothing in the tree that includes h/* files uses
this), and header filenames containing whitespace almost certainly do
not work correctly.

The h => sys mapping is also much more hardcoded, but that's all we
were using this for anyway.

Reviewed-on: http://gerrit.openafs.org/6790
Reviewed-by: Russ Allbery <rra@stanford.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
(cherry picked from commit fb03b1380f82a6bdc8a78ad92069da38b4e98c26)

Change-Id: If6bfedea0b563dce6135fbf2f4554ee602ee822c
Reviewed-on: http://gerrit.openafs.org/6793
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
13 years agosalvager: Do not abort on large volume IDs
Andrew Deason [Tue, 21 Feb 2012 21:28:08 +0000 (15:28 -0600)]
salvager: Do not abort on large volume IDs

We have already checked that 'vid' is valid; no need to check if it is
negative. Also change vid to be a VolumeId.

This is partially cherry-picked from
0884e9d0fddf2be81abf6468209048331efa8a1e. The commit
4d691ae10903e01db4d6b24a4eb02da536cadf7c is comprised of changes from
both ce5e263b488f8cb85662031ee08eea448dab2d27 and
0884e9d0fddf2be81abf6468209048331efa8a1e, but it missed a few things
from 0884e9d0fddf2be81abf6468209048331efa8a1e. This commit brings in
the rest of the changes from 0884e9d0fddf2be81abf6468209048331efa8a1e.

Change-Id: I8e001bfe81128b2e2214b3b2fa83e4797374022b
Reviewed-on: http://gerrit.openafs.org/6778
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
13 years agolibafs: retry retriable RPCs instead of abandoning
Derrick Brashear [Wed, 22 Feb 2012 20:57:46 +0000 (15:57 -0500)]
libafs: retry retriable RPCs instead of abandoning

if we get e.g. an idle dead error we should retry
retriable actions, namely data stores. in order
for writing files to work correctly given how
the writeback code is structured it's important that
this not interfere with analyze's shouldRetry decision
on those RPCs

Reviewed-on: http://gerrit.openafs.org/6749
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
(cherry picked from commit 75a3dabe66a9fbc232b05e2f744ad5b867e18262)

Change-Id: I9c611eeb9a71298e9725268392cdf94074324bf1
Reviewed-on: http://gerrit.openafs.org/6777
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
13 years agolibafs: ensure one nat ping connection per srvAddr
Derrick Brashear [Mon, 13 Feb 2012 03:45:59 +0000 (22:45 -0500)]
libafs: ensure one nat ping connection per srvAddr

track the natping conn with the srvAddr, ensuring exactly one.

Reviewed-on: http://gerrit.openafs.org/6706
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
(cherry picked from commit 2378895fc66a19a050f302711f2e18dbbf2e3d6f)

Change-Id: I5e74ec3f46f9af335653b6910d2c31c788181c5c
Reviewed-on: http://gerrit.openafs.org/6772
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Alistair Ferguson <alistair.ferguson@mac.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
13 years agovolser: Remove unused variable
Marc Dionne [Mon, 20 Feb 2012 22:56:29 +0000 (17:56 -0500)]
volser: Remove unused variable

tid is now unused - remove it to avoid a warning.

Reviewed-on: http://gerrit.openafs.org/6743
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
(cherry picked from commit fd19b39b151e3dddd18b4280252ac3e0fdf3964d)

Change-Id: Ib402c84689d61baefed3b76138f7fac7c2b36de0
Reviewed-on: http://gerrit.openafs.org/6771
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Alistair Ferguson <alistair.ferguson@mac.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
13 years agoviced: Relax "h_TossStuff_r failed" warnings
Andrew Deason [Fri, 17 Feb 2012 23:12:46 +0000 (17:12 -0600)]
viced: Relax "h_TossStuff_r failed" warnings

Currently, h_TossStuff_r bails out and logs a message if we detect
that somebody grabbed a reference or locked the host while we tried to
h_NBLock_r. The reasoning for this is that it is not legal for anyone
to h_Hold_r a host that has HOSTDELETED set (but the error is
detectable and recoverable); callers are supposed to check for
HOSTDELETED and not hold a host in that case.

However, HOSTDELETED may not be set when h_TossStuff_r is called,
since we call it if either HOSTDELETED _or_ CLIENTDELETED are set. If
CLIENTDELETED is set and HOSTDELETED is not, it's perfectly fine (and
necessary) for callers to grab a reference to the host. So, if that's
what is going on, don't log a message, since that's normal behavior.

Check for HOSTDELETED before we h_NBLock_r, since it is technically
possible (and legal) for someone to grab a reference to the host and
somehow set HOSTDELETED while we wait for h_NBLock_r to return. Also
log the flags when we see this message.

Reviewed-on: http://gerrit.openafs.org/6733
Reviewed-by: Alistair Ferguson <alistair.ferguson@mac.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
(cherry picked from commit fe4e52655ce7e5a8e5f6c23cde678fc66c3db490)

Change-Id: Ic1b72c808aec158d99f088a3144e86adf969efcc
Reviewed-on: http://gerrit.openafs.org/6770
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Alistair Ferguson <alistair.ferguson@mac.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>