]> git.michaelhowe.org Git - packages/o/openafs.git/log
packages/o/openafs.git
13 years agoafs: Do not always ignore errors in afs_GetDSlot
Andrew Deason [Wed, 21 Dec 2011 20:04:32 +0000 (15:04 -0500)]
afs: Do not always ignore errors in afs_GetDSlot

Currently afs_UFSGetDSlot will silently swallow any error in reading
the specified dslot from disk, and will return a "blank" dcache to the
caller. However, many callers of afs_GetDSlot will be asking for a
dcache that we know exists, and more importantly, we know is on the
global hash table. If a disk error is encountered and we're given a
"blank" dcache, we will erroneously believe the dcache entry is not on
the hash table, causing corruption of the hash table later on.

So instead, modify all callers of afs_GetDSlot to use either
afs_GetValidDSlot or afs_GetNewDSlot. Calling afs_GetValidDSlot
indicates that the given dentry index is known to be valid, and any
error encountered while reading the entry from disk should result in
an error (for disk I/O errors we have no control over, this results in
a NULL dentry returned; for internal consistency errors we panic).
Calling afs_GetNewDSlot indicates that the specified index may not
exist or may not be valid, and so returning a "blank" dentry in that
case is fine.

For memcache, the situation is the same, except any time we go to
"disk" it is an (internal) error, since there is no disk.

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

Change-Id: Ia30e7de919ccc14708112886e492e60f93fe6639
Reviewed-on: http://gerrit.openafs.org/7940
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
13 years agoafs: Remove second argument to afs_GetDSlot
Andrew Deason [Wed, 21 Dec 2011 22:25:29 +0000 (17:25 -0500)]
afs: Remove second argument to afs_GetDSlot

All callers of afs_GetDSlot were passing NULL as the second argument
to afs_GetDSlot. So, remove the argument, and behave as if tmpdc was
NULL unconditionally.

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

Change-Id: Ic1ad6d35a7051e83a811692156b0da7207cb57f4
Reviewed-on: http://gerrit.openafs.org/7939
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
13 years agoafs: clean afs_osi_Alloc() usage
Chas Williams (CONTRACTOR) [Tue, 19 Oct 2010 18:50:35 +0000 (14:50 -0400)]
afs: clean afs_osi_Alloc() usage

Add asserts for any failures cases not explicitly handled and remove
any casting.

Reviewed-on: http://gerrit.openafs.org/3012
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit 0e8cce457763b131de48395a9beed889fd529c1f)

Change-Id: I23497ea7a75a66c01ba7b1013e01dfaa005c9892
Reviewed-on: http://gerrit.openafs.org/7936
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
13 years agoLINUX: Do not lookup immediately recursive mtpts
Andrew Deason [Fri, 6 Apr 2012 19:56:07 +0000 (14:56 -0500)]
LINUX: Do not lookup immediately recursive mtpts

On Linux, having a mountpoint in a volume root that points to the same
volume can cause serious problems. By 'immediately recursive', I mean
a situation like the following:

fs mkm mtpt vol
fs mkm mtpt/mtpt vol

If there are multiple dentry aliases for the directory (which is
possible if the directory is a mountpoint), an 'rmdir' on the
recursive mountpoint can cause the client to deadlock. Since the
'rmdir' code path in Linux locks the parent directory inode to perform
the rmdir, and locks the child directory inode after performing a
couple of sanity checks. For an immediately recursive mountpoint,
these two inodes are the same, and so we will deadlock.

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

Change-Id: I531adbf66cf6714e04811356b072b17335980aa3
Reviewed-on: http://gerrit.openafs.org/7952
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
13 years agoLinux: Make dir dentry aliases act like symlinks
Andrew Deason [Fri, 6 Jul 2012 21:37:39 +0000 (16:37 -0500)]
Linux: Make dir dentry aliases act like symlinks

Currently, we try to invalidate other dentries that exist for a
particular dir inode when we look up a dentry. This is so we try to
avoid duplicate dentries for a directory, which Linux does not like
(you cannot have hardlinks to a dir).

If we cannot invalidate the other aliases (because they are being
used), right now we just return the alias. This can make it very easy
to panic the client, due to the sanity checks Linux performs when dong
things like 'rmdir'. If we do something like this:

mkdir dir1
fs mkm dir1/mtpt vol
mkdir dir1/mtpt/dir2
fs mkm dir1/mtpt/dir2/mtpt2 vol
cd dir1/mtpt
rmdir dir2/mtpt2

For the 'rmdir', we will lookup 'mtpt2'. Since 'mtpt' and 'mtpt2'
are mountpoints for the same volume, their dentries point to the same
directory inode. So when we lookup 'mtpt2', we will try to invalidate
the other dentry, but we cannot do that since it is the cwd. So we
return the alias dentry (for 'mtpt'). The Linux VFS layer then does a
sanity check for the rmdir operation, checking that the child dentry's
parent inode is the same as the inode we're performing the rmdir for.
Since the dentry we returned was for 'mtpt', whose parent is 'dir1',
and the actual dir we're performing the rmdir for is 'dir2', this
sanity check fails and we BUG.

To avoid this, make the dentry alias act like a symlink when we
encounter an uninvalidateable dentry alias. That is, we allow multiple
dentry aliases for a directory, however, when the dentry aliases are
actually used, we redirect to a common dentry (via d_automount where
possible, and follow_link elsewhere).

This means that such mountpoints will behave similarly to symlinks, in
that we 'point' to a specific mountpoint dentry. This means that if we
have multiple different ways to get to the same volume, and all are
accessed at the same time, all but one of those mountpoints will
behave like symlinks, pointing to the same mountpoint. So, the '..'
entries for each path will all point to the parent dir of one
mountpoint, meaning that the '..' entry will be "wrong", but for most
cases it will still be correct.

In order to try to make the 'target', pointed-to directory consistent,
we add a new field to struct vcache: target_link. This points to the
dentry we should redirect to, whenever that vcache is referenced. To
avoid (possibly not-feasibly-solvable) problems with refcounting, this
pointer is not actually a reference to the target dentry, but just
serves as a pointer to compare to.

FIXES 130273

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

Change-Id: I68e1f0a3734f56db66e5fee3571597b5eb17eef8
Reviewed-on: http://gerrit.openafs.org/7951
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
13 years agoafs: Indicate error from afs_osi_Read/Write better
Andrew Deason [Thu, 22 Dec 2011 20:01:52 +0000 (15:01 -0500)]
afs: Indicate error from afs_osi_Read/Write better

Currently afs_osi_Read and afs_osi_Write just return -1 on any I/O
error, even though they know the error code given from the OS VFS.
Just return that code instead so the caller can see what the error
was; but negate it, so it's clear that it is an error.

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

Change-Id: Ib5a674af7e0424691887b20d24782a6740d11414
Reviewed-on: http://gerrit.openafs.org/7938
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
13 years agoafs: afs_osi_Read/Write returns negative on error
Andrew Deason [Thu, 22 Dec 2011 19:50:09 +0000 (14:50 -0500)]
afs: afs_osi_Read/Write returns negative on error

afs_osi_Read and afs_osi_Write need to return negative values on
error. EIO is not negative; return -EIO so we don't accidentally
return "success" if someone requested to read or write EIO bytes.

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

Change-Id: Idd2e6b85d27a914cac0169a6e8fdee49ff262dc0
Reviewed-on: http://gerrit.openafs.org/7937
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
13 years agovos: Do not try to remove backup volume id 0
Andrew Deason [Mon, 9 Apr 2012 22:16:42 +0000 (17:16 -0500)]
vos: Do not try to remove backup volume id 0

Currently we always try to delete a BK volume if we're deleting the
RW. If the BK volume id is 0, this is never going to do anything, so
don't try to delete it.

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

Change-Id: I6d5406d6e39513d3f38e7674fa726b627ca5f1f0
Reviewed-on: http://gerrit.openafs.org/7935
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
13 years agoLINUX: Hold GLOCK for proc traversal
Andrew Deason [Thu, 26 Jul 2012 21:40:03 +0000 (16:40 -0500)]
LINUX: Hold GLOCK for proc traversal

The functions that traverse unixuser structures for display via /proc
(uu_start et al) call various libafs functions hold and release locks,
etc. To do any of that, we need GLOCK. Amongst other issues, we can
panic if we try to acquire a contested lock without GLOCK, since we
assert glock is held when we sleep for the lock or try to wake other
waiters. The same goes for the legacy CellServDB proc file.

So, hold and release GLOCK as appropriate.

Reviewed-on: http://gerrit.openafs.org/7885
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 5237d3d232f22aaf4f67f3a8727a293f4058a7ae)

Change-Id: I5895b4bde32b8efa27abc83cc6b9dab7458d5c75
Reviewed-on: http://gerrit.openafs.org/7914
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
13 years agoLINUX: Fix osi_proc.c formatting
Andrew Deason [Thu, 26 Jul 2012 20:58:45 +0000 (15:58 -0500)]
LINUX: Fix osi_proc.c formatting

osi_proc.c had a few formatting issues:

 - Several function definitions did not have the function name at the
   beginning of the line

 - A few preprocessor directives were not indented

 - A few areas used a tab character for each indentation level, as
   opposed to 4 spaces, then 1 tab, as the rest of the tree has

 - Struct definitions were aligned using tabs, not spaces, causing
   misalignments when the indentation was fixed

Fix these.

Reviewed-on: http://gerrit.openafs.org/7884
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 23f2f1232b03ed02f87582c12b4c4e8474bc9b5d)

Change-Id: I0c1a595ae0599f522ee3681d33f7b82290778b7f
Reviewed-on: http://gerrit.openafs.org/7913
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
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: I2880b5a0caf283324290ffd8f9c25194551e58cd
Reviewed-on: http://gerrit.openafs.org/7589
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
13 years agodoc: Add fs bypassthreshold man page
Andrew Deason [Thu, 28 Jun 2012 23:56:47 +0000 (18:56 -0500)]
doc: Add fs bypassthreshold man page

FIXES 130050

Change-Id: I0ffc7b93ed9dd93765a25efd60fe3430a86366cf
Reviewed-on: http://gerrit.openafs.org/7602
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>
(cherry picked from commit 828ef9c39a14af265796755718c10b63513f952c)
Reviewed-on: http://gerrit.openafs.org/7735
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
13 years agorx: abort on missing service
Derrick Brashear [Fri, 1 Jun 2012 17:16:31 +0000 (13:16 -0400)]
rx: abort on missing service

currently rx does not send an abort if a service does not
exist; it quietly ignores the packet. provide a hint we have
done so.

Reviewed-on: http://gerrit.openafs.org/7563
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Simon Wilkinson <simonxwilkinson@gmail.com>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
(cherry picked from commit 1fbe83f9aacfc36a9c426ba1fd18ad7c72869dc1)

Change-Id: Id3b4952e8d27479f16c950606cacc19c7e52cc02
Reviewed-on: http://gerrit.openafs.org/7593
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
13 years agoAuth: increase size of DNS resolver answer buffer
Niklas Jonsson [Wed, 20 Jun 2012 14:03:54 +0000 (10:03 -0400)]
Auth: increase size of DNS resolver answer buffer

This patchset increases the size of the res_search() answer
buffer from 1024 octets to 4096 octets.   This is not a proper
long term solution but will permit sites with longer response
lists to make use of SRV and AFSDB records.

This patchset only impacts UNIX systems.  Windows uses the
Win32 DNS resolver which dynamically allocates memory based
upon the size of the response.

FIXES 130936

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

Change-Id: Iac7fc7143ff48bd3eb2d3719902dd4549af25b50
Reviewed-on: http://gerrit.openafs.org/7592
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
13 years agorx: provide mechanism to send a bare abort packet
Simon Wilkinson [Fri, 1 Jun 2012 17:20:57 +0000 (13:20 -0400)]
rx: provide mechanism to send a bare abort packet

simply put an abort on the wire

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

Change-Id: I21a8f2b5df84c49bda6b6fced5088cdeb3127017
Reviewed-on: http://gerrit.openafs.org/7591
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
13 years agodoc: Consolidate NetRestrict format docmentation
Andrew Deason [Mon, 18 Jun 2012 20:06:49 +0000 (15:06 -0500)]
doc: Consolidate NetRestrict format docmentation

We were specifying exactly the same format in two different places;
consolidate them into one place. In addition, explicitly say there are
is no way to specify a range of addresses, in case some people are
confused by the previous versions of this man page that erroneously
said you could use 255 as a wildcard.

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

Change-Id: Ie138f8b6e3070d0bc92adae7dae90a26cbd78001
Reviewed-on: http://gerrit.openafs.org/7590
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
13 years agolibafs: put connection always in getcapabilities helper
Derrick Brashear [Tue, 19 Jun 2012 19:54:26 +0000 (15:54 -0400)]
libafs: put connection always in getcapabilities helper

if we get a connection, we need to always put it back. here we exited
with error before doing so. 1.6 only fix

Change-Id: I67abec863c1d60d557277468a681847263d783a1
Reviewed-on: http://gerrit.openafs.org/7570
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
13 years agolibafs: put connection in analyze when conn srvr missing
Derrick Brashear [Tue, 19 Jun 2012 19:11:38 +0000 (15:11 -0400)]
libafs: put connection in analyze when conn srvr missing

we need to putconn in all cases we can in afs_Analyze, but at least
one case we didn't. fixed.

(cherry picked from commit e2d094595fd76e76e4a5861114202f513d02c2b1)

Change-Id: I04e2d0f8b1002b9a6a73b8ff6755157460504da9
Reviewed-on: http://gerrit.openafs.org/7569
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
13 years agodoc: Correct volume size CAUTIONS notes
Andrew Deason [Thu, 28 Jun 2012 20:43:27 +0000 (15:43 -0500)]
doc: Correct volume size CAUTIONS notes

2 terabytes is 2^41 bytes, not 2^31 bytes. Also clarify that volumes
can be much larger than this.

FIXES 130188

Reviewed-on: http://gerrit.openafs.org/7598
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>
(cherry picked from commit 300cbb28b08c2fd3709942cc6c48e7d9369a3394)

Change-Id: I762e18e83d4557c8fd4db3601426bcaaa845199a
Reviewed-on: http://gerrit.openafs.org/7674
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>
13 years agodoc: Fix whitespace errors
Andrew Deason [Thu, 28 Jun 2012 22:47:32 +0000 (17:47 -0500)]
doc: Fix whitespace errors

Reviewed-on: http://gerrit.openafs.org/7599
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>
(cherry picked from commit fcaa53a6d7289665b64037a0d96ae4c6cbf4f776)

Change-Id: I69f90ca4d764a25720e8625443c0b86751914cca
Reviewed-on: http://gerrit.openafs.org/7673
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>
13 years agodoc: Consolidate CAUTIONS notes about volume size
Andrew Deason [Thu, 28 Jun 2012 20:30:40 +0000 (15:30 -0500)]
doc: Consolidate CAUTIONS notes about volume size

Reviewed-on: http://gerrit.openafs.org/7597
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>
(cherry picked from commit 3ff8ef499c56008f4d2ebf5b81e08e98eb0c0826)

Change-Id: Ie29664d105e0f35140fdf3c164da78564f6b5e36
Reviewed-on: http://gerrit.openafs.org/7672
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>
13 years agodoc: Consolidate NetRestrict format docmentation
Andrew Deason [Mon, 18 Jun 2012 20:06:49 +0000 (15:06 -0500)]
doc: Consolidate NetRestrict format docmentation

We were specifying exactly the same format in two different places;
consolidate them into one place. In addition, explicitly say there are
is no way to specify a range of addresses, in case some people are
confused by the previous versions of this man page that erroneously
said you could use 255 as a wildcard.

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

Change-Id: I7bae4786b6a0cc2115688bd54d1c1128dc0f5df2
Reviewed-on: http://gerrit.openafs.org/7671
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>
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>