Commit Graph

9838 Commits

Author SHA1 Message Date
Michael Meffie
752daf71cd 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>
2011-12-14 06:06:34 -08:00
Michael Meffie
0d0a8288c1 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>
2011-12-14 06:01:17 -08:00
Lukas Volf
2df43a5cb6 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>
2011-12-14 05:58:50 -08:00
Derrick Brashear
4d76b19b60 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>
2011-12-14 05:56:51 -08:00
Derrick Brashear
78885611ac 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>
2011-12-14 05:56:30 -08:00
Jeffrey Altman
f30d70ba55 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>
2011-12-10 11:13:34 -08:00
Jeffrey Altman
41d145b303 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>
2011-12-10 06:44:32 -08:00
Karl Ramm
6d6d52e18f 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>
2011-12-08 20:30:22 -08:00
Jeffrey Altman
f238d4854d 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>
2011-12-08 07:39:22 -08:00
Peter Scott
f2c0c51f78 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>
2011-12-07 20:57:36 -08:00
Jeffrey Altman
7a93c827f3 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>
2011-12-05 08:18:10 -08:00
Jeffrey Altman
942dae0dd0 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>
2011-12-04 11:28:07 -08:00
Simon Wilkinson
57316878e0 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>
2011-12-04 08:13:15 -08:00
Ben Kaduk
1ef8dc3dfb 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>
2011-12-04 07:01:07 -08:00
Simon Wilkinson
aefb109207 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>
2011-12-04 06:58:12 -08:00
Simon Wilkinson
64b00c3a1a 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>
2011-12-03 20:45:09 -08:00
Jeffrey Altman
a57f6434e8 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>
2011-12-03 20:44:55 -08:00
Simon Wilkinson
d3eaa39da3 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>
2011-12-03 20:44:39 -08:00
Simon Wilkinson
aa76c8f670 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>
2011-12-03 20:44:20 -08:00
Jeffrey Altman
01f55bbf14 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>
2011-12-03 18:12:07 -08:00
Jeffrey Altman
2495d02951 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>
2011-12-03 18:11:50 -08:00
Jeffrey Altman
f37df60763 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>
2011-12-03 18:11:22 -08:00
Simon Wilkinson
5c6640bf0b 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>
2011-12-03 15:18:29 -08:00
Jeffrey Altman
0fb7d85284 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>
2011-12-03 07:45:32 -08:00
Simon Wilkinson
b34a2df4c7 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>
2011-12-03 06:17:39 -08:00
Edward Z. Yang
3328770612 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>
2011-12-03 06:17:13 -08:00
Ben Kaduk
c22aa6c121 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>
2011-12-03 06:16:53 -08:00
Simon Wilkinson
1c4cd44660 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>
2011-12-03 06:15:59 -08:00
Andrew Deason
ae227049fc 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>
2011-12-03 06:15:08 -08:00
Andrew Deason
53230846a2 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>
2011-12-03 06:14:46 -08:00
Andrew Deason
d5d2d00a47 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>
2011-12-03 06:14:32 -08:00
Andrew Deason
4fd8347e84 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>
2011-12-03 06:14:22 -08:00
Andrew Deason
f59312c0ae 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>
2011-12-03 06:14:09 -08:00
Andrew Deason
5fc2365f5d 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>
2011-12-03 06:13:57 -08:00
Jeffrey Altman
9de84a1e67 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>
2011-12-02 15:54:48 -08:00
Jeffrey Altman
3fce5b3541 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>
2011-12-02 15:54:33 -08:00
Jeffrey Altman
a60594ef54 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>
2011-12-02 15:54:20 -08:00
Jeffrey Altman
2a2ae16511 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>
2011-12-02 15:54:05 -08:00
Jeffrey Altman
6ee14eef36 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>
2011-12-02 15:53:51 -08:00
Jeffrey Altman
500ffccfd6 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>
2011-12-02 15:53:39 -08:00
Jeffrey Altman
7dccf17840 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>
2011-12-02 15:53:14 -08:00
Jeffrey Altman
c712403f19 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>
2011-12-02 15:52:32 -08:00
Jeffrey Altman
b26161284f 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>
2011-12-02 15:52:13 -08:00
Jeffrey Altman
2aeb041bb0 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>
2011-12-01 11:51:04 -08:00
Jeffrey Altman
79833cbc64 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>
2011-12-01 11:50:50 -08:00
Andrew Deason
0ee7fcc0a4 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>
2011-12-01 09:57:57 -08:00
Derrick Brashear
a9007cf81c 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>
2011-12-01 09:57:03 -08:00
Derrick Brashear
25672ad8cd 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>
2011-12-01 06:31:15 -08:00
Derrick Brashear
cdc26d92ed 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>
2011-11-30 13:14:52 -08:00
Jeffrey Altman
0c01c36245 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>
2011-11-29 15:36:21 -08:00