openafs.git
9 years agoWindows: avoid deadlock during SetRenameInformation
Jeffrey Altman [Sun, 18 Dec 2011 23:36:14 +0000]
Windows: avoid deadlock during SetRenameInformation

The VolumeLock must be held before the Fcb->NPFcb->Resource.
Obtain the VolumeLock in AFSSetFileInformation only in the
rename case instead of obtaining the VolumeLockin AFSSetRenameInformation.

Change-Id: I84f086e3a8f7d08630266c9e409e1e22c1f92742
Reviewed-on: http://gerrit.openafs.org/6377
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>

9 years agoWindows: terminate HOSTS/LMHOSTS with newline
Jeffrey Altman [Sun, 18 Dec 2011 17:08:24 +0000]
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

Change-Id: I35f96120904d09679d62ea4fb65f29648c4abfa5
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>

9 years agoWindows: Track AuthGroup in Context Control Block
Peter Scott [Wed, 14 Dec 2011 19:27:54 +0000]
Windows: Track AuthGroup in Context Control Block

Tracking the AuthGroup in the File Control Block proved to be
insufficient to ensure that dirty extents can be stored back
to the file server when an anti-virus service opens a file
in authgroup without 'write' permission immediate after the
application performing a WriteFile() opens it.  In this situation
the Fcb ends up with the AuthGroup set to the anti-virus value
and not the one that belongs to the writing application.

Tracking the AuthGroup by Ccb provides the ability to select
an AuthGroup from the list of open handles instead of tracking
the most recent one.

Change-Id: I851ea646feb531d7c765e1cf789a4ba541e4a150
Reviewed-on: http://gerrit.openafs.org/6333
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>

9 years agoWindows: Tear down extents upon file deletion
Jeffrey Altman [Sat, 17 Dec 2011 17:14:28 +0000]
Windows: Tear down extents upon file deletion

When processing AFS_INVALIDATE_REMOVED, tear down all extents
since they are no longer necessary and return them to the service
for recycling.

Change-Id: Iec6c0d2c68db16dbf3bd04c51536e13d45f0c1b8
Reviewed-on: http://gerrit.openafs.org/6365
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>

9 years agoWindows: notify file size change if flushed
Jeffrey Altman [Sat, 17 Dec 2011 17:13:17 +0000]
Windows: notify file size change if flushed

When processing AFS_INVALIDATE_FLUSHED, notify any listeners
that the file size has changed to force a complete refresh.

Change-Id: Ie5f0076ea786357ae77ef6a76f162c776d555953
Reviewed-on: http://gerrit.openafs.org/6364
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>

9 years agoWindows: forget data version only for flushing
Jeffrey Altman [Sat, 17 Dec 2011 17:08:49 +0000]
Windows: forget data version only for flushing

The AFS redirector was intentionally forgetting the data version
number for AFS_INVALIDATE_DATA_VERSION events.  The point of that
event is to ensure that clean data be purged if the data version
in fact changed.  Checking the data version for change cannot be
performed if the data version is reset to -1.

Only when AFS_INVALIDATE_FLUSHED is processed should the data
version be reset to ensure that all of the data is purged.

Change-Id: I430afc4889c55c49ef24904a987b08042994cfea
Reviewed-on: http://gerrit.openafs.org/6363
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>

9 years agoWindows: fix indentation
Jeffrey Altman [Sat, 17 Dec 2011 17:07:53 +0000]
Windows: fix indentation

Change-Id: I187cfa466830a528d0ac2c77b0006e2b66b0a47c
Reviewed-on: http://gerrit.openafs.org/6362
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>

9 years agoWindows: AFSSetRenameInfo log message
Jeffrey Altman [Sat, 17 Dec 2011 16:57:15 +0000]
Windows: AFSSetRenameInfo log message

Fix a typo in the log message and change its priority from
error to verbose

Change-Id: I807d7d6d9118b0fa6af3de638bb9fa2c0d90cbcb
Reviewed-on: http://gerrit.openafs.org/6361
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>

9 years agoWindows: return error to system paging requests
Jeffrey Altman [Fri, 16 Dec 2011 22:24:36 +0000]
Windows: return error to system paging requests

If an error has been set on a file, return that error to the
System process for any outstanding extent requests.

Change-Id: I8f7244f19cc0e3f96a1599ce011251ade0afe3f4
Reviewed-on: http://gerrit.openafs.org/6360
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>

9 years agoWindows: log volume and authgroup for redir open
Jeffrey Altman [Fri, 16 Dec 2011 23:24:50 +0000]
Windows: log volume and authgroup for redir open

If opening a volume root fails, log the authgroup and volume
to make it easier to debug the error.

Change-Id: I0c9ffc58ffaf7582a1b22043de2b5d096530de5b
Reviewed-on: http://gerrit.openafs.org/6352
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>

9 years agoWindows: save fid/type for redirector invalidation
Jeffrey Altman [Fri, 16 Dec 2011 05:12:39 +0000]
Windows: save fid/type for redirector invalidation

Must save the fid/type fields of the cm_scache_t object before
recycling in order to invalidate the contents in the redirector.

Change-Id: I7914faaa80082033044980deb471eaffbddf3cfc
Reviewed-on: http://gerrit.openafs.org/6359
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>

9 years agoWindows: move to head of queue no-op if not in queue
Jeffrey Altman [Fri, 16 Dec 2011 22:22:49 +0000]
Windows: move to head of queue no-op if not in queue

If the buffer is not in the queue, do nothing.

Change-Id: Icdb95775bcc6d010ca1926ce4384d9edcd8f1cd3
Reviewed-on: http://gerrit.openafs.org/6351
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>

9 years agoWindows: Properly convert FID structures
Jeffrey Altman [Fri, 16 Dec 2011 21:15:56 +0000]
Windows: Properly convert FID structures

Use the FID conversion function in RDR_SetFileStatus().
The FID structures are not the same in afsd_service and the
afsredirlib.sys driver.

Change-Id: I6360f39c8b90c46d468a06c08f0911f55f9142fb
Reviewed-on: http://gerrit.openafs.org/6350
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>

9 years agoWindows: propagate directory enumeration failures
Jeffrey Altman [Fri, 16 Dec 2011 16:43:32 +0000]
Windows: propagate directory enumeration failures

If a directory is enumerated with an AuthGroup that has no
permissions, do not treat the enumeration as successful.

Change-Id: I6a543a1b19b9d2e68ee2c99f67398ed94ad52896
Reviewed-on: http://gerrit.openafs.org/6344
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>

9 years agoWindows Problem with cross-directory rename
Peter Scott [Fri, 16 Dec 2011 00:52:54 +0000]
Windows Problem with cross-directory rename

Not correctly handling cross-directory rename processing

Change-Id: I36e30a68d7755241c727868074e344beb9580c2d
Reviewed-on: http://gerrit.openafs.org/6343
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>

9 years agoWindows: Update Adv Firewall Rules
Jeffrey Altman [Wed, 14 Dec 2011 17:58:36 +0000]
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.

Change-Id: I1ab1a0c57f9271b68f91b08e530483a1fa40a165
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>

9 years agovol: fix a08c3207255756c825ab69a19e04f79dd879c646
Jeffrey Altman [Thu, 15 Dec 2011 08:28:34 +0000]
vol: fix a08c3207255756c825ab69a19e04f79dd879c646

Patchset a08c3207255756c825ab69a19e04f79dd879c646 broke the suse
and windows builds by relying on C99 language syntax.  Fix it.

Change-Id: I8220e0504048d2caff00deb08e3bf53599e596b7
Reviewed-on: http://gerrit.openafs.org/6337
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>

9 years agoafs: Clear VHardMount on ResetVolumeInfo
Andrew Deason [Wed, 14 Dec 2011 20:42:08 +0000]
afs: Clear VHardMount on ResetVolumeInfo

afs_Analyze sets VHardMount on a volume struct when a hard-mount
scenario is encountered, and clears it after sleeping. However, if the
volume struct has VRecheck set, or if it's not in memory, afs_Analyze
cannot retrieve the volume struct in order to clear VHardMount again.

For the VRecheck case, this can results in VHardMount never getting
cleared, and so hard-mount messages for the volume seem to disappear.
So, clear VHardMount when we set VRecheck so this does not occur.

For the case where the volume struct is not in memory, this is not a
problem, since when we allocate a volume struct again, the VHardMount
state will not be retained.

Change-Id: I607741241e330391b8c857b2a72f0e0cfc0b91cc
Reviewed-on: http://gerrit.openafs.org/6335
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>

9 years agoviced: Yell when we GetSomeSpace_r
Andrew Deason [Wed, 14 Dec 2011 20:16:16 +0000]
viced: Yell when we GetSomeSpace_r

A GetSomeSpace_r call indicates we don't have enough callbacks
configured. For many people, this can happen without the administrator
realizing anything is wrong, since we never give any indication that
something is amiss, unless the administrator checks the xstat
statistics.

Since this can indicate a serious performance problem, yell in the log
when this happens. Only do it once, so we don't spam the log.

Change-Id: I5c881a3c127c20b4f086d59bf3768864307efe92
Reviewed-on: http://gerrit.openafs.org/6334
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Tested-by: Derrick Brashear <shadow@dementix.org>
Reviewed-by: Derrick Brashear <shadow@dementix.org>

9 years agoRevert "Windows: cs_CZ localization"
Jeffrey Altman [Thu, 15 Dec 2011 15:00:28 +0000]
Revert "Windows: cs_CZ localization"

This reverts commit 642153cae6700e855a8abcc20be207612e1e6b3c

cs_CZ localization cannot be committed to the repository until:

1. Resource DLLs for all components are built in the tree.

2. All built components have been successfully tested so that OpenAFS is not shipping code that caused executable components to crash in the cs_CZ locale.

Change-Id: Id287d150a4c63afdc3f4105d26c9faf211da5395
Reviewed-on: http://gerrit.openafs.org/6339
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>

9 years agobozo: retry start after error stops
Michael Meffie [Thu, 29 Sep 2011 18:44:11 +0000]
bozo: retry start after error stops

After a bnode is stopped because of two many consecutive exits
delay for some time and attempt to start the bnode again. Countine
to retry on each error stop, doubling the delay for each retry
attempt until a maxium number of attempts.

Change-Id: Ib6a4935d09c70c69de87f65717562bd3dcde761b
Reviewed-on: http://gerrit.openafs.org/5534
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>

9 years agobozo: preserve all options over restart
Michael Meffie [Fri, 30 Sep 2011 16:22:27 +0000]
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.

Change-Id: Ib54d1b0c9430946cce666d09f5ed923016d5ac8b
Reviewed-on: http://gerrit.openafs.org/5532
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Tested-by: Derrick Brashear <shadow@dementix.org>

9 years agovolser: Do not reset copyDate in ReClone
Andrew Deason [Thu, 3 Feb 2011 22:11:38 +0000]
volser: Do not reset copyDate in ReClone

When we ReClone in the volserver, do not reset the clone's copyDate to
the current time. If we retain the copyDate between ReClone
operations, then we can know when the clone was first created (and
thus makes local RO clones more consistent with remote RO sites).

Change-Id: Ic76862c1a03ee3cafaf199f414fabc90e3b058d2
Reviewed-on: http://gerrit.openafs.org/3892
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>

9 years agoutil: simplify thread-name interface
Garrett Wollman [Sat, 30 Jul 2011 01:33:10 +0000]
util: simplify thread-name interface

It appears that we don't actually need an interface to set the name
of an arbitrary thread (which Mac OS can't do), so remove the
afs_pthread_setname() interface and promote afs_pthread_setname_self()
to the status of primary.

Change-Id: I2d915d8165dac9ccfe0cb99630db657cb1473389
Reviewed-on: http://gerrit.openafs.org/5121
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>

9 years agoWindows: AFSRDFSProvider stack overrun
Jeffrey Altman [Wed, 14 Dec 2011 04:28:15 +0000]
Windows: AFSRDFSProvider stack overrun

StringCchXXX functions take the number of characters not
the number of bytes.   Use StringCbXXXX functions whenever the
buffer size is being specified.

Check return codes from StringXXXXXX functions and return errors
instead of blindly continuing with a truncated string.

Allocate a larger buffer for substitution strings since they
need to handle the device path plus the target path.

FIXES 130392

Change-Id: I62ca980d145d6fef8cf771c26cd634ce1dd55b91
Reviewed-on: http://gerrit.openafs.org/6248
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>

9 years agovos: fix code to not triple-negate
Derrick Brashear [Tue, 13 Dec 2011 17:19:48 +0000]
vos: fix code to not triple-negate

!!! is !. just write it that way.

Change-Id: I8e788177280c4a1d78cedaffd144a5c4ecba28f2
Reviewed-on: http://gerrit.openafs.org/6252
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>

9 years agobuild tsalvaged, tvolser, and dvolser targets on *nbsd*
Jonathan A. Kollasch [Tue, 11 Oct 2011 17:33:19 +0000]
build tsalvaged, tvolser, and dvolser targets on *nbsd*

Change-Id: Idb744f57ab92ba2d9af4d7d9ca7c800b3ee880d2
Reviewed-on: http://gerrit.openafs.org/5595
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Tested-by: Derrick Brashear <shadow@dementix.org>

9 years agovolscan: print vnode metadata information
Michael Meffie [Tue, 26 Jul 2011 13:18:44 +0000]
volscan: print vnode metadata information

volscan program to print vnode meta-data in a grep/awk/perl friendly
format. Optionally, find the paths of each vnode relative to the volume
root.  Access control list data can be reported, and are listed as one
access entry per line. Mount point information can be shown to which
volumes are mounted from given volumes.

The path lookup code originally written by Tom Keiser.

Change-Id: I743e1a33d9e6076e4f1b1b2cc462960a94e3763b
Reviewed-on: http://gerrit.openafs.org/5102
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Tested-by: Derrick Brashear <shadow@dementix.org>

9 years agoUnix CM: Log reason for marking server up or down
Simon Wilkinson [Thu, 24 Nov 2011 17:43:45 +0000]
Unix CM: Log reason for marking server up or down

When we mark a server up or down also log the error code that says
why we did so, for help in debugging connection issues.

Change-Id: I1a14434607499c9932e23724b8e403442dc400c7
Reviewed-on: http://gerrit.openafs.org/6116
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Tested-by: Derrick Brashear <shadow@dementix.org>

9 years agovolinfo: implement -checkout option
Michael Meffie [Tue, 26 Jul 2011 02:02:04 +0000]
volinfo: implement -checkout option

Implement the -checkout option using the FSSYNC communication
channel with the fileserver.

Change-Id: I119fab0c238fd37eb85c9810626ee91210b2efb6
Reviewed-on: http://gerrit.openafs.org/5101
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>

9 years agovol: log error reason on header read failure
Michael Meffie [Tue, 22 Nov 2011 00:12:56 +0000]
vol: log error reason on header read failure

Log the error reason instead of just VSALVAGE when
ReadHeader() fails.

Change-Id: I24d5ca175310345ee4ce095229b08d9e7c75f700
Reviewed-on: http://gerrit.openafs.org/6108
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@dementix.org>

9 years agoWindows: cs_CZ localization
Lukas Volf [Sun, 4 Dec 2011 23:52:49 +0000]
Windows: cs_CZ localization

Resource conversion for the cs_CZ locale.  Does not include
installer updates.

Change-Id: Ifac0d7d9818dc662e584bc74701133cada9fbf33
Reviewed-on: http://gerrit.openafs.org/6227
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>

9 years agolibafs: disable mtu discovery
Derrick Brashear [Wed, 14 Dec 2011 04:49:38 +0000]
libafs: disable mtu discovery

we need to rework this to use lack of soft acks instead of this
method, which is too fragile

Change-Id: Iedcd1e57e2c6a6c15ce3c040a9a9e6ae7d78bb36
Reviewed-on: http://gerrit.openafs.org/6256
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Tested-by: Derrick Brashear <shadow@dementix.org>

9 years agolibafs: only do pings for default conn with root uid
Derrick Brashear [Wed, 14 Dec 2011 04:20:01 +0000]
libafs: only do pings for default conn with root uid

instead of doing it for potentially every unauth user, just do it for
root.

Change-Id: I39ef22578eb07c339b096b25753a1775c9917e0b
Reviewed-on: http://gerrit.openafs.org/6255
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Tested-by: Derrick Brashear <shadow@dementix.org>

10 years agoWindows: memory leak when setting tokens via smb
Jeffrey Altman [Sat, 10 Dec 2011 18:28:17 +0000]
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.

Change-Id: I28261643680d608d5c8805e095650a751193ab6d
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>

10 years agoWindows: Suspend/Resume for afsd_service
Jeffrey Altman [Fri, 9 Dec 2011 23:40:42 +0000]
Windows: Suspend/Resume for afsd_service

The power mgmt events are received in the service.  The service
can block all requests from the redirector from being processed
until it knows that it is safe to process them.

The service will receive a SERVICE_CONTROL_APMSUSPEND just before
the system goes to sleep.  The service has two seconds to respond
and it uses that time to attempt to send RXAFS_GiveUpAllCallBacks
to all file servers as an rx_multi with no wait.  It also marks
all servers down and updates the callback expirations to be just
after the servers were marked down so that they will be forced to
be refreshed when the server is marked up.

Upon resume the service receives two events.  First,
SERVICE_CONTROL_APMRESUMEAUTOMATIC which is used to perform an
SMB lan adapter change detection and perform a probe of all down
servers.  The second, SERVICE_CONTROL_APMRESUMESUSPEND is used to
resume SMB listeners, perform a 2nd lan adapter change check (just
in case), check the status of all down servers in additional
networks have come up, and finally resume processing of redirector
requests.

With these changes no special logic in the redirector is required.

Change-Id: I5405ecab754dca04f34afb024c4dacc3fe089088
Reviewed-on: http://gerrit.openafs.org/6243
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>

10 years agoPrint "waiting for job termination" at most once.
Karl Ramm [Sun, 4 Dec 2011 18:56:29 +0000]
Print "waiting for job termination" at most once.

This message is useless, annoying, and is the UI equivalent of littering... but
it does explain why your backup command is just sitting there.

Change-Id: Ied49d0bf9f81b0e10804133c6f05814321d80438
Reviewed-on: http://gerrit.openafs.org/6223
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>

10 years agoWindows: increase timeout for extent request retries
Jeffrey Altman [Thu, 8 Dec 2011 15:00:57 +0000]
Windows: increase timeout for extent request retries

The AFS Redirector requests file data extents from the afsd_service.exe.  If
it does not receive the requested extent within 10 seconds it issues another
request for that extent.  Extent processing in the afsd_service is handled
by background daemons that process tasks serially from a work queue.   When
the load on the system is large enough that satisfying the work queue takes
longer than 10 seconds, the redirector would retry the request.  This would
increase the length of the work queue and increase lock contention.

Increasing the timeout period for extent retries to two minutes
significantly reduces the number of retry attempts while maintaining
protection against a lost extent request.  Two minutes is selected because
that is the rx hard dead call timeout.

Change-Id: I8169fbdc2d3456f151359ffe9eaa8eeccb2ceaf1
Reviewed-on: http://gerrit.openafs.org/6237
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>

10 years agoWindows: include owner/group in Security DACL
Peter Scott [Thu, 8 Dec 2011 01:29:00 +0000]
Windows: include owner/group in Security DACL

Include the World (Everyone) SID as the owner and group for
all files in AFS.

FIXES 130343

Change-Id: I01d697d7a6dea8e0bea67b81c14597c197b4241d
Reviewed-on: http://gerrit.openafs.org/6236
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>

10 years agoafs: prevent nat pings on destroyed connections
Jeffrey Altman [Mon, 5 Dec 2011 04:15:13 +0000]
afs: prevent nat pings on destroyed connections

If the connection is no longer in use, reset the nat keep alive
timer to 0 seconds.

Change-Id: I72b69979fb8b15ab5afaa654b317edc254253b4b
Reviewed-on: http://gerrit.openafs.org/6230
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>

10 years agoWindows: Release Notes Updates
Jeffrey Altman [Sun, 4 Dec 2011 18:42:08 +0000]
Windows: Release Notes Updates

Updates for 1.7.3.

Grammar improvements.

Reformatting.

Change-Id: Iff829f343e0140943495a19406746b30a70ed235
Reviewed-on: http://gerrit.openafs.org/6222
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>

10 years agorx: Make CALL_RELE and CALL_HOLD lock refcnt mutex
Simon Wilkinson [Sun, 20 Nov 2011 23:11:53 +0000]
rx: Make CALL_RELE and CALL_HOLD lock refcnt mutex

The reference count mutex must always be held when calling CALL_RELE
or CALL_HOLD. Instead of requiring that the caller obtain, and release
the mutex, do so within the HOLD and RELE macros, greatly simplifying
calling code. Provide CALL_RELE_R and CALL_HOLD_R as versions of these
macros which can be used by callers who already hold the reference
count mutex for other purposes.

Change-Id: Ie3e9df8b9d2a79476f1707bd65e588f43271c636
Reviewed-on: http://gerrit.openafs.org/6219
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>

10 years agoFBSD: switch afsi_SetServerIPRank implementation
Ben Kaduk [Sat, 3 Dec 2011 19:37:09 +0000]
FBSD: switch afsi_SetServerIPRank implementation

Upstream has removed the ia_net{,mask} elements from
struct in_ifaddr, so we can no longer use them directly.
Switch to passing an rx_ifaddr_t (i.e. struct ifaddr*) in instead,
as that uses a slightly different codepath which still works
for our purposes.

We compile the kernel module with -Werror, so storing a pointer
(memcpy return value) in an int is forbidden, hence the conditional
declaration of 't'.

Change-Id: Ifefef88a353f4bd50a714ad88afa3a6f012fa3a1
Reviewed-on: http://gerrit.openafs.org/6203
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>

10 years agorx: Helper function for decrementing conn refcnt
Simon Wilkinson [Sun, 20 Nov 2011 23:07:41 +0000]
rx: Helper function for decrementing conn refcnt

The code to lock the reference count mutex, reduce the connection
reference count, then unlock the mutex, is duplicated many times
throughout rx.c. Replace all of these multiple copies with a single
inline function.

Change-Id: I7adb460019d7434b32a16250cc026be667e7c55d
Reviewed-on: http://gerrit.openafs.org/6218
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Reviewed-by: Derrick Brashear <shadow@dementix.org>

10 years agorx: Hide the rx_packet.h
Simon Wilkinson [Sun, 20 Nov 2011 16:31:28 +0000]
rx: Hide the rx_packet.h

Hide the rx_packet.h, and hence the rx_packet structure from
application view. rx_packet.h is currently still installed, and is
included directly by RX security classes, to reduce the per-packet
overhead there.

Change-Id: I269ccf4405a8f83cab4b0392b830bc1f36471c29
Reviewed-on: http://gerrit.openafs.org/6182
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>

10 years agoWindows: define MIN and MAX
Jeffrey Altman [Sun, 4 Dec 2011 02:20:05 +0000]
Windows: define MIN and MAX

MIN and MAX are used throughout the tree.  Windows does
not define them.  A future patchset should convert the
openafs src tree to use min and max.

Change-Id: Ibe7bba6a49e3c85f94cd1e1c45e904764bf06e02
Reviewed-on: http://gerrit.openafs.org/6209
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>

10 years agorx: Make the rx_call structure private
Simon Wilkinson [Sun, 20 Nov 2011 14:58:28 +0000]
rx: Make the rx_call structure private

Hide the rx_call structure for public view. Provide accessors for
those elements which are currently accessed by applications.

Note that this change as it currently stands removes the visibility
of the last sent time, and sequence number information, from the
VolMonitor function.

Change-Id: Ib25ab5635126f893ae43acb684d92a78278d6ca6
Reviewed-on: http://gerrit.openafs.org/6181
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>

10 years agorx: Make struct rx_connection private
Simon Wilkinson [Tue, 15 Nov 2011 10:40:44 +0000]
rx: Make struct rx_connection private

Move the rx_connection structure into a private header file, so that
it is only visible from within the rx module. This allows us to use
types within the structure that are not visible to everywhere that
includes rx.h, as well as being a step towards a more stable ABI for
RX.

Add accessor functions for all of the connection members which are
currently used by external callers, and modify those accessors
which were implemented as macros to also be functions.

Change all external access to the connection structures to use these
new functions.

Change-Id: Ife67e63f37cb04273fbfc9079db3907bde78ab98
Reviewed-on: http://gerrit.openafs.org/6180
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>

10 years agoWindows: apply Nat Pings only to cm_rootUser connections
Jeffrey Altman [Sat, 3 Dec 2011 22:49:47 +0000]
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.

Change-Id: I978501972509d1e58b08b630e1ff046b404e59d8
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>

10 years agoWindows: track cm_rootUser connections
Jeffrey Altman [Sat, 3 Dec 2011 22:46:41 +0000]
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.

Change-Id: Icd809631637d4fc6c2bb1bd93e7cab74f2fb5c2b
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>

10 years agorx: rx_conn/rx_peer refCount signed
Jeffrey Altman [Sat, 3 Dec 2011 20:45:53 +0000]
rx: rx_conn/rx_peer refCount signed

Can't trace reference count underflows with rxi_LowConnRefCount
and rxi_LowPeerRefCount if they cannot become negative.

Change-Id: I429da00a8e711c2e562378ec5d6601093293a55b
Reviewed-on: http://gerrit.openafs.org/6205
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>

10 years agorx: Some kernels have no reschedule function
Simon Wilkinson [Sat, 3 Dec 2011 21:10:43 +0000]
rx: Some kernels have no reschedule function

If RXK_TIMEDSLEEP_ENV isn't set, then Unix kernel cache managers
call rxevent_Init without a reschedule function. Check for this so
we don't end up calling a NULL function in these situations.

Change-Id: I5e89f5247aeffc4c27d3f81c0ccabe4979232846
Reviewed-on: http://gerrit.openafs.org/6206
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>

10 years agoWindows: npdll connected query returns no usage
Jeffrey Altman [Sat, 3 Dec 2011 04:38:01 +0000]
Windows: npdll connected query returns no usage

In response to a NPEnumResources CONNECTED scope query, the usage
field is always set to zero.  If the CONNECTABLE flag is set,
mpr.dll will filter the entry out of the result list.

Change-Id: If939f9f168fe2e02a1a8287c661ec2e1cda5eb8f
Reviewed-on: http://gerrit.openafs.org/6195
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>

10 years agoWindows: Use roken's min and max
Simon Wilkinson [Sat, 3 Dec 2011 11:20:57 +0000]
Windows: Use roken's min and max

roken provides min() and max() macros. Use these, rather than our own
MIN() and MAX()

Change-Id: I82456c061cb274490e2ef2966a7075c2bde1f016
Reviewed-on: http://gerrit.openafs.org/6196
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>

10 years agoAdd OpenAFS to the dependencies of remote-fs.
Edward Z. Yang [Sun, 20 Nov 2011 20:48:33 +0000]
Add OpenAFS to the dependencies of remote-fs.

Signed-off-by: Edward Z. Yang <ezyang@mit.edu>

Change-Id: Icd1fd34dc3a5c849a2b698c1da08eb4003e6efa1
Reviewed-on: http://gerrit.openafs.org/6093
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>

10 years agoRemove dead code from rxi_FindIfnet()
Ben Kaduk [Sat, 3 Dec 2011 01:24:04 +0000]
Remove dead code from rxi_FindIfnet()

There is a separate implementation for DARWIN and XBSD above, so
having a check for DARWIN here is pointless.

Change-Id: I66741dd1d8dbddc19809fd6e6fcd0897f047f222
Reviewed-on: http://gerrit.openafs.org/6193
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>

10 years agorx: Refactor MaxMTU error checking
Simon Wilkinson [Sun, 20 Nov 2011 16:29:55 +0000]
rx: Refactor MaxMTU error checking

The error checking on the rxMaxMTU parameter was done individually by
every server that sets it, using "internal" RX #defines to do so.
Instead, do the error checking within the function that actually sets
the MTU, reducing both the amount of code duplication, and the amount
of RX knowledge held within the servers.

Change-Id: Ic2cdd9425d5344a5137f76f66f711f4dee91a7b6
Reviewed-on: http://gerrit.openafs.org/6091
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>

10 years agosalvager: Create link table with volume group id
Andrew Deason [Fri, 2 Dec 2011 20:36:59 +0000]
salvager: Create link table with volume group id

The link table needs to be created with the VG id or RW vol id, not
the non-RW vol id. Unlike other special inodes, this goes for both the
'parent' and 'volume' volume ids, not just the 'parent' id, since
there is only one link table per VG.

Without this, the salvager can generate invalid linktable special
inodes if it encounters a VG with no inodes for the RW vol.

Change-Id: I10725c514ef1b8a5b09a506e42596b51b74af5a2
Reviewed-on: http://gerrit.openafs.org/6179
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>

10 years agoDAFS: Ensure logging on attach2 errors
Andrew Deason [Wed, 30 Nov 2011 23:41:53 +0000]
DAFS: Ensure logging on attach2 errors

The attach2 error path transitions a volume to VOL_STATE_ERROR, in
case whatever got us to that error path did not already put the volume
in an appropriate state. Log when we do this, to make sure we do not
end up with a volume in VOL_STATE_ERROR state silently.

Change-Id: I02c842b64882d96e707e867ee0f7730a2bebd405
Reviewed-on: http://gerrit.openafs.org/6168
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>

10 years agoDAFS: Avoid unnecessary preattach on FSYNC_VOL_ON
Andrew Deason [Wed, 30 Nov 2011 23:35:56 +0000]
DAFS: Avoid unnecessary preattach on FSYNC_VOL_ON

FSYNC_VOL_ON/FSYNC_VOL_ATTACH can be called to "online" a volume that
was actually kept online for the duration of the volume operation.
Avoid calling VPreAttachVolumeByVp_r for such a volume if it's already
attached, in order to avoid an unnecessary log message and to save a
tiny bit of processing.

Change-Id: I7776b933599ec0488941ccbd9a8e1279f5a552f4
Reviewed-on: http://gerrit.openafs.org/6167
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>

10 years agoDAFS: Log more for VPreAttachVolumeByVp odd states
Andrew Deason [Wed, 30 Nov 2011 23:21:32 +0000]
DAFS: Log more for VPreAttachVolumeByVp odd states

When we encounter "odd" states in VPreAttachVolumeByVp_r, say what the
actual state we encountered was, along with the attach flags, so we
have a better idea of what's going on.

Change-Id: Ic5d07d249db7b51301b3ac903ba987cfa21922ee
Reviewed-on: http://gerrit.openafs.org/6166
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>

10 years agoDAFS: Ensure GetVolume errors on ERROR volumes
Andrew Deason [Wed, 30 Nov 2011 23:08:57 +0000]
DAFS: Ensure GetVolume errors on ERROR volumes

In GetVolume, after we call VAttachVolumeByVp_r, there is no explicit
check to see if vp is in VOL_STATE_ERROR state. Make sure we don't try
to use such a volume, or blindly transition the volume away from that
state.

Change-Id: Ib2c975ac215eeff28b4ff5f5bb0a387298d7aab9
Reviewed-on: http://gerrit.openafs.org/6165
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>

10 years agoDAFS: Do not transition to ERROR on trivial errors
Andrew Deason [Wed, 30 Nov 2011 20:36:06 +0000]
DAFS: Do not transition to ERROR on trivial errors

attach2 can result in many different errors; some indicate that the
volume is in an inconsistent state, but many others just indicate that
the volume cannot be attached for benign reasons (such as VNOVOL if
the volume doesn't exist, or VOFFLINE if the volume is being used by a
volume utility). Currently, for DAFS, attach2 transitions the relevant
volume to the VOL_STATE_ERROR state for almost all errors encountered,
even the benign ones. Instead, skip the error state transition for
error handling paths that do not reflect a "broken" volume.

Change-Id: I07754f715920c4ee30fb156fb2412d1e1a7e2597
Reviewed-on: http://gerrit.openafs.org/6164
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>

10 years agoWindows: GetInfoTip really set return to NULL
Jeffrey Altman [Fri, 2 Dec 2011 23:49:23 +0000]
Windows: GetInfoTip really set return to NULL

When we are not returning an info-tip string from the shell
extension the string output parameter must be set to NULL.

Change-Id: I63cd9bbe078edd01e62d4b0c810a513dfbf205ae
Reviewed-on: http://gerrit.openafs.org/6183
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>

10 years agoWindows: memset in RDR_RequestFileExtentsAsync
Jeffrey Altman [Fri, 2 Dec 2011 18:41:38 +0000]
Windows: memset in RDR_RequestFileExtentsAsync

The logic in RDR_RequestFileExtentsAsync() made it possible
for memset() to be called multiple times on a buffer that
is already known to be up to date.  Restructure the code to
make things faster.

Change-Id: Iea09b01f126a6d8915e6bf3dd3978ad4b482eb03
Reviewed-on: http://gerrit.openafs.org/6178
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>

10 years agoWindows: cm_MergeStatus redirector invalidation
Jeffrey Altman [Fri, 2 Dec 2011 18:36:01 +0000]
Windows: cm_MergeStatus redirector invalidation

The redirector maintains its own cached status information which
must be updated when a DV change occurs that is not the result
of a redirector initiated data change.

If the current old DV is BAD, send a DV change notification.

If the DV has changed and request was not initiated by the
redirector, send a DV change notification.

If the request was initiated by the redirector, send a notification
for store and directory operations that result in a DV change greater
than the number of active RPCs or any other operation that results
in an unexpected DV change such as FetchStatus.

Change-Id: I6dd4c9d450901e4b5d4c8d67841e3b833cebbe1f
Reviewed-on: http://gerrit.openafs.org/6177
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>

10 years agoWindows: cm_MergeStatus use new DV to purge buffers
Jeffrey Altman [Fri, 2 Dec 2011 18:31:15 +0000]
Windows: cm_MergeStatus use new DV to purge buffers

When deciding whether or not to purge buffers on a DV change
it is the new DV that matters not the old DV.  If the new DV
is 0, there should be no purging because there are no buffers
to purge.

Change-Id: Ie505348dbbf8173e477645e5022410ddd3028240
Reviewed-on: http://gerrit.openafs.org/6176
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>

10 years agoWindows: use interlocked increment on cm_buf_t refcnt
Jeffrey Altman [Fri, 2 Dec 2011 18:21:24 +0000]
Windows: use interlocked increment on cm_buf_t refcnt

For consistency use interlocked increment when setting the
cm_buf_t refCnt to 1 even though it is protected by a lock.

Change-Id: I91fbb1469715ee6b7d6f94f416c59ebcd1645336
Reviewed-on: http://gerrit.openafs.org/6175
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>

10 years agoWindows: buf_GetNewLocked should use cleaned cm_buf
Jeffrey Altman [Fri, 2 Dec 2011 16:21:46 +0000]
Windows: buf_GetNewLocked should use cleaned cm_buf

buf_GetNewLocked() searches the free buffer list for a buffer
that has a 0 refcnt, is not in the chunk that is being populated,
is not actively having I/O performed on it and is not dirty.
If it comes across a dirty buffer, it calls buf_Clean() with
the assumption that buf_CleanAsync() (as it was previously called)
was in fact asynchronous and would return immediately.  Instead
buf_Clean() is synchronous and when it completes the buffer will
in most cases be clean.  buf_GetNewLocked() should use the newly
cleaned buffer if it is still available and not continue the
search from the next entry in the free buffer list.

Change-Id: Iae629df57b9d27a813f7f4c6740be23bd33fe039
Reviewed-on: http://gerrit.openafs.org/6174
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>

10 years agoWindows: fix buf_Recycle() comment
Jeffrey Altman [Fri, 2 Dec 2011 16:19:13 +0000]
Windows: fix buf_Recycle() comment

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

Change-Id: Ic6acde3178afe59181436d9c10d4ddfb05340372
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>

10 years agoWindows: buf_CleanAsync is not async; rename it
Jeffrey Altman [Fri, 2 Dec 2011 16:14:11 +0000]
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.

Change-Id: I4c6d08d2a81b36f3cc43ada96acfa0ff9db23845
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>

10 years agoWindows: convert buf_IncrSyncer to pthreads
Jeffrey Altman [Fri, 2 Dec 2011 16:11:59 +0000]
Windows: convert buf_IncrSyncer to pthreads

buf_IncrSyncer() calls rx therefore it should be a pthread
thread so as not to count against the 63 native thread count
limit.

Change-Id: If00eeb7d26bfbf7d0f35addb05290f3704d11a89
Reviewed-on: http://gerrit.openafs.org/6171
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>

10 years agoWindows: invalidate rdr for CM_SCACHE_VERSION_BAD
Jeffrey Altman [Thu, 1 Dec 2011 04:29:56 +0000]
Windows: invalidate rdr for CM_SCACHE_VERSION_BAD

If the cm_scache_t.dataVersion is set to CM_SCACHE_VERSION_BAD,
invalidate the redirector notion of status so that we do not
leak info to users that do not have permission.

If the dataVersion is CM_SCACHE_VERSION_BAD and is updated
with real status info, invalidate the redirector so it attempts
to read the directory contents.

Change-Id: Iaa15b37f7f1863169ffe93ae9bc3d24086a3b734
Reviewed-on: http://gerrit.openafs.org/6159
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>

10 years agoWindows: do not set CM_SCACHEFLAG_EACCES twice
Jeffrey Altman [Thu, 1 Dec 2011 04:28:46 +0000]
Windows: do not set CM_SCACHEFLAG_EACCES twice

correct a merge error.

Change-Id: Iaf57703403a5c7555da730be0907bd31c9dfb34f
Reviewed-on: http://gerrit.openafs.org/6158
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>

10 years agoSOLARIS: Define BSD_COMP for non-UKERNEL on 5.11
Andrew Deason [Thu, 1 Dec 2011 17:20:41 +0000]
SOLARIS: Define BSD_COMP for non-UKERNEL on 5.11

We were defining BSD_COMP twice for UKERNEL. Move one of the #define's
up to the !UKERNEL section.

Change-Id: I91b90d666ab83a2037549c3f66ea038234a42e11
Reviewed-on: http://gerrit.openafs.org/6162
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Tested-by: Derrick Brashear <shadow@dementix.org>

10 years agoafsd.fuse: link libopr
Derrick Brashear [Thu, 1 Dec 2011 17:34:38 +0000]
afsd.fuse: link libopr

needed for rbtrees. linktest does so; we also need to

Change-Id: Ic5c8aaa0727a979212ed4f089d915b106c00fac8
Reviewed-on: http://gerrit.openafs.org/6163
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Tested-by: Derrick Brashear <shadow@dementix.org>

10 years agoremove CopyOnWrite2 and unused vars
Derrick Brashear [Wed, 30 Nov 2011 21:20:23 +0000]
remove CopyOnWrite2 and unused vars

unused static functions make grumpy compilers grumpy.

Change-Id: I2a48e2993193a615bffe331f19948bfc46fba16b
Reviewed-on: http://gerrit.openafs.org/6157
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>

10 years agoviced: disable accelerated copyonwrite
Derrick Brashear [Sun, 27 Nov 2011 16:23:29 +0000]
viced: disable accelerated copyonwrite

don't do multistage CoW

FIXES 130295
Change-Id: Iec35619b970d87a72ed497d4bbec0b9415c9ddf7
Reviewed-on: http://gerrit.openafs.org/6135
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Tested-by: Derrick Brashear <shadow@dementix.org>

10 years agoWindows: AFSRDFSProvider log to file
Jeffrey Altman [Tue, 29 Nov 2011 20:02:12 +0000]
Windows: AFSRDFSProvider log to file

For when logging via OutputDebugString() is insufficient, add
a cheap method of logging to a fixed file: c:\temp\AFSRDFSProvider.log.
Set AFSRedirector\NetworkProvider "Debug" to 0x2.

Change-Id: I419bfbe251b8ef58d7c1b7921badde19d72c34e6
Reviewed-on: http://gerrit.openafs.org/6142
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>

10 years agoWindows: NPEnumResources no Printer support
Jeffrey Altman [Tue, 29 Nov 2011 20:01:00 +0000]
Windows: NPEnumResources no Printer support

The AFS Redirector does not support printer shares.  If the
query is for printers only (or any other query that does not
permit disk shares as a response) return no more entries.

Change-Id: Ide9fc58489bed7f4a9cf50da24a98a9b2477b72d
Reviewed-on: http://gerrit.openafs.org/6141
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>

10 years agoWindows: NPGetConnectionCommon buffer too small
Jeffrey Altman [Tue, 29 Nov 2011 19:59:24 +0000]
Windows: NPGetConnectionCommon buffer too small

If the specified buffer size is too small, say so.  Do not
attempt to copy data in that won't fit.  Do not walk beyond
the end of the allocated memory.

Change-Id: Id4a75273d8ec9e9cc8471a963bc32f6cad59163e
Reviewed-on: http://gerrit.openafs.org/6140
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>

10 years agoWindows: no drive subst for NPCancelConnection
Jeffrey Altman [Tue, 29 Nov 2011 19:55:55 +0000]
Windows: no drive subst for NPCancelConnection

NPCancelConnection() must use the results of a Get Connection
ioctl to the afs redirector and not the result of Drive Letter
Substitution queries via DosQueryDevice().  Rename NPGetConnection()
to NPGetConnectionCommon() and add a new parameter to indicate
whether drive substitution is ok.

Change-Id: I42cd4488038f128ae90356a41bc538966d9cebed
Reviewed-on: http://gerrit.openafs.org/6139
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>

10 years agoWindows: refactor NPCancelConnection
Jeffrey Altman [Tue, 29 Nov 2011 19:54:24 +0000]
Windows: refactor NPCancelConnection

refactor NPCancelConnection to consolidate some conditional
blocks to improve readability.

Change-Id: Ic3aaaac10809caeaab10fdb6c759be8d55d1f75c
Reviewed-on: http://gerrit.openafs.org/6138
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>

10 years agoWindows: Mount Point and Symlink Overlay Icons
Chris Orsi [Sat, 26 Nov 2011 22:26:10 +0000]
Windows: Mount Point and Symlink Overlay Icons

Change-Id: I34b8166664f54878eb58a0dcc3e1241cb977aa5f
Reviewed-on: http://gerrit.openafs.org/6137
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>

10 years agoWindows: Wix disable integrated logon by default
Jeffrey Altman [Mon, 28 Nov 2011 23:42:21 +0000]
Windows: Wix disable integrated logon by default

One of the significant differences between the NSIS and Wix
installer packages is that NSIS does not activate integrated
logon by default whereas the Wix installer does.  Enabling
integrated logon without configuring the cell, CellServDB,
installing Kerberos v5 and configuring krb5.conf can result
in a very long wait at logon.  Now that NSIS is no longer
being supported and cannot be supported as a native 64-bit
installer mechanism we must disable integrated logon by
default to prevent more bad end user experiences like
@Lotterleben described on Twitter.

Change-Id: I10be4185177f94e53295a7641dd387feb295eaa5
Reviewed-on: http://gerrit.openafs.org/6132
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>

10 years agorx: Use a red black tree for the event stack
Simon Wilkinson [Sun, 23 Oct 2011 20:21:39 +0000]
rx: Use a red black tree for the event stack

Instead of the current event stack, which uses a sorted linked
list, use a red/black tree to maintain the timer stack. This
dramatically improves event insertion times, at the expense of
some additional implementation complexity.

This change also adds reference counting to the rxevent
structure. We've always had a race between an event being
fired, and that event being simultaneously cancelled by
the user thread. Reference counting avoids that race resulting
in the structure appearing twice in the free list.

Change-Id: Icbef6e04e01f3eef5b888bc3cb77b7a3d1be26ae
Reviewed-on: http://gerrit.openafs.org/5841
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>

10 years agoUnix CM: Build rbtrees in kernel
Simon Wilkinson [Fri, 11 Nov 2011 09:33:31 +0000]
Unix CM: Build rbtrees in kernel

Build the new opr rbtree code in the Unix kernel module

Change-Id: I8271b209c8c17c4c651f2499cd8f60e44818a828
Reviewed-on: http://gerrit.openafs.org/5842
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>

10 years agoudebug: Fix endianness when fudging lastYesHost
Andrew Deason [Tue, 29 Nov 2011 18:07:49 +0000]
udebug: Fix endianness when fudging lastYesHost

hostAddr is in NBO, lastYesHost is in HBO.

Change-Id: Id11046426512c79b8e760841e1e13cf91deb0b4c
Reviewed-on: http://gerrit.openafs.org/6136
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>

10 years agoWindows: FSync not CleanVnode during Cleanup
Jeffrey Altman [Tue, 29 Nov 2011 00:15:33 +0000]
Windows: FSync not CleanVnode during Cleanup

cm_FSync() is buf_CleanVnode() plus a sync of metadata which
is required during last handle close.

FIXES 130351

Change-Id: I25635e3c9768dbf7d9501178b99cdd64a5be7789
Reviewed-on: http://gerrit.openafs.org/6134
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>

10 years agoWindows: Wix cell names can be greater than 120 chars
Jeffrey Altman [Mon, 28 Nov 2011 23:45:55 +0000]
Windows: Wix cell names can be greater than 120 chars

Increase the permitted length in the UI to 255 characters.

Change-Id: I33d3f546da8b38f89bb88352abcb908879728771
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>

10 years agoWindows: cache format version change
Jeffrey Altman [Mon, 28 Nov 2011 20:13:43 +0000]
Windows: cache format version change

With the change to the size of the osi_mutex_t and osi_rwlock_t
structures the CM_CONFIG_DATA_VERSION must change to force a
reconstruction of the cache file.

Change-Id: I0aadd2f7c699a5daaa87acf749957ff65d51fe6e
Reviewed-on: http://gerrit.openafs.org/6131
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>

10 years agoWindows: osi_mutex / osi_rwlock changes
Jeffrey Altman [Sat, 26 Nov 2011 22:26:50 +0000]
Windows: osi_mutex / osi_rwlock changes

Reorganize the osi_mutex and osi_rwlock structure so
that all counters are 32-bit and pointers are
aligned.  This requires adding padding fields.

Move lock validation checks within the critical section.

Include additional assertions checking the ownership
state and protecting against under/overflows.

Increase the size of the rwlock tid array to support
a larger number of simultaneous readers.

Change-Id: Ia46684c601a1a589a210a36862ae6ad6448a435e
Reviewed-on: http://gerrit.openafs.org/6130
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>

10 years agoWindows: convert daemons threads to pthreads
Jeffrey Altman [Sat, 26 Nov 2011 15:55:27 +0000]
Windows: convert daemons threads to pthreads

The daemon threads make calls to Rx and therefore need to
be created with the pthread package to prevent the threads
from being tracked as 'native' threads by the pthread_thread_shutdown
thread which can only track up to 63 native threads.

Change-Id: I8d096be9398a0a541bb59eb245cd7b3fe6f3843c
Reviewed-on: http://gerrit.openafs.org/6119
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>

10 years agoFBSD: cleanup dvp locking for ISDOTDOT
Ben Kaduk [Sun, 13 Nov 2011 18:12:50 +0000]
FBSD: cleanup dvp locking for ISDOTDOT

This is a more correct version of
c2ed2577f9c16df3088158fb593d7aab6e8690d0, which was reverted since
it caused build issues on some versions and kernel panics on others.

We do want to always unlock dvp before calling over the network
in the ISDOTDOT case, but be sure to use the proper spelling
for this operation (as the syntax has changed between FreeBSD versions).
This requires not unlocking dvp right after the afs_lookup() call if
it succeeds, letting us just lock the "child" vp (which is actually
the parent starting from '/') first, and then re-lock dvp.

The error case of afs_lookup() was already handled correctly in
this logic, which is to say that it was incorrect before this change,
attempting to recursively lock dvp which causes a panic.

Change-Id: Ide29e47991413dadc3a2b5948f0f6c5bfa2911c4
Reviewed-on: http://gerrit.openafs.org/6127
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>

10 years agonamei: force-close fd on read or write error
Derrick Brashear [Sun, 27 Nov 2011 15:42:59 +0000]
namei: force-close fd on read or write error

if we errored, just reallyclose so we'll get a new fd

Change-Id: I55de45a96dc7fab481a49c10c68f2ebc0d4ea27c
Reviewed-on: http://gerrit.openafs.org/6126
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>

10 years agoLinux: 3: Update specfile to know about 3.* kernels.
Edward Z. Yang [Sun, 27 Nov 2011 00:32:51 +0000]
Linux: 3: Update specfile to know about 3.* kernels.

Update spec file to be consistent with acinclude.m4 with regards to
sysnames.  We don't bother updating the code inside the legacy kernel
build section, as it doesn't get triggered for 3.* kernels (it should
probably get cleaned up at some point.)

Also, fix a bug in error message printing of unrecognized kernel.

Signed-off-by: Edward Z. Yang <ezyang@mit.edu>

Change-Id: Ife6046db0bec981be59aa053f63ae71458da7167
Reviewed-on: http://gerrit.openafs.org/6120
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Reviewed-by: Derrick Brashear <shadow@dementix.org>

10 years agoUnix CM: Fix PutVolume in afs_BlackListOnce
Simon Wilkinson [Wed, 23 Nov 2011 16:30:55 +0000]
Unix CM: Fix PutVolume in afs_BlackListOnce

It isn't safe to keep accessing a structure once we have Put our
reference to it.

Change-Id: I6f23a054c3ccde21aa17e07d06dd3c6e7761c098
Reviewed-on: http://gerrit.openafs.org/6117
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>

10 years agoWindows: add trace logging to Pioctl File Info Query
Jeffrey Altman [Tue, 22 Nov 2011 14:31:45 +0000]
Windows: add trace logging to Pioctl File Info Query

Change-Id: I357518a341dd97aa94c30ae9c0defa56a97eb920
Reviewed-on: http://gerrit.openafs.org/6110
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>

10 years agoWindows: _._AFS_IOCTL_._ size is zero
Jeffrey Altman [Tue, 22 Nov 2011 21:36:18 +0000]
Windows: _._AFS_IOCTL_._ size is zero

When replying to a FileStandardInformation query on the pioctl
special file, the size of the file is 0.  Failure to return 0
can result in an anti-virus program attempting to read the file
via a paging request which will fail.

Change-Id: I83f2f40cca99c04a5fe06546f19bdf96dfbb4951
Reviewed-on: http://gerrit.openafs.org/6109
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>

10 years agoWindows: RDR_InvalidateObject do not hold locks
Jeffrey Altman [Tue, 22 Nov 2011 02:47:38 +0000]
Windows: RDR_InvalidateObject do not hold locks

Do not hold any locks when calling the afs redirector.  Holding
a lock can cause a deadlock.

Change-Id: I5fb493d68e3cf3a8e58024b3b9f54349928f84c3
Reviewed-on: http://gerrit.openafs.org/6105
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>