Modify the cm_ResetACLCache interface to accept an optional cm_cell_t *.
At the moment every time a token is set or cleared all of the acl info
for all cm_scache_t objects regardless of cell is reset. This is both
a performance hit and unnecessary. If we know the cell, only reset
the acl info for cm_scache_t objects in that cell.
use cm_HaveCallback() to check for a call back instead of explicit
checks on cbExpires and cbServerp. cm_HaveCallback takes into account
Freelance mode and offline status.
Change cm_BPlusDirEnumerate interface to include a 'FetchStatus'
parameter. When set to 0, we do not fetch status for fids for
which we do not already have status info. This avoids unnecessary
recycling of cm_scache_t objects.
instead of potentially blocking waiting for a call lock, assume if the call is
locked, the conn is still busy. also, don't even try to get the conn data lock
if we don't need to
Unlike the unix cache manager, on Windows the server uuid was not
recorded as part of the cm_server object. This commit adds the uuid
and a flag to indicate if it is set or not.
A check is made in cm_UpdateVolumeLocation it confirm that the uuid
known to the CM is the same as the one being reported by the vl server.
If they differ, this is logged but no action is taken.
The contents of the cm_allServers list is now dumped in response to
"fs memdump" or a crash. This includes the uuid, addr, type, flags,
downtime, caps, etc.
The server uuid is not useful at the moment because there is nothing
that the CM can use it for. However, it might be useful for debugging
and it will be needed for extended callback support.
Change how BPlusDir enumerations behave with regards to bulk stat
operations. If the number of entries in the enumeration is larger
than the number of cm_scache objects, then using the previous model
of cm_BPlusDirEnumBulkStat being called for the entire enumeration
list results in the early objects being recycled and the status
info discarded before the caller of cm_BPlusDirNextEnumEntry()
receives the name.
The revised model triggers bulk stat operations from within
NextEnumEntry() as objects requiring status fetching are about
to be returned to the caller. This reduces the thrashing of the
stat cache.
We should consider adding a flag field to cm_BPlusDirEnumerate()
or cm_BPlusDirNextEnumEntry() to permit enumeration without
status fetching.
Fix another set of edge cases where adding a mountpoint or symlink
to the Freelance volume would result in the wrong fid being returned
to the request that made the addition.
When the Freelance directory is updated, invalidate the cm_scache_t object.
that is associated with it.
Actually use the data version when checking callback status.
The return value from Add Mount/Symlink is not negative on failure.
Its an actual error code. Treat it that way.
Fix smb_FindFIDByScache() to avoid obtaining the smb_fid_t.mx and
smb_rctLock out of order. Doing so requires obtaining references
on each smb_fid_t belonging to the smb_vc_t in order to prevent them
from being removed from the list while the list is being walked.
Reorder tests for CM_SCACHEFLAG_DELETED and smb_fid_t.scp to make
them more efficient and consistent.
When processing Tran2SetPathInfo do not fail because an smb_fid_t
cannot be found for the path object. The PathInfo function is
being used because we do not have a file descriptor. Most importantly
do not fail by returning success.
* when a rename occurs across directories, the file server allocates
a new vnode which in turn alters the FID. Since the new FID and
potentially version number is unknown to the client, it is not
possible to update the target directory with the new name and
FID thereby avoiding reading the directory from the file server.
* when the old vnode is removed, the callback is broken but the
client did not discard the cm_scache_t object
In order to optimize the client cache AFS requires a RXAFS_RenameEx
rpc that is equivalent to the current RPC but returns the new FID
and status. This would permit the cache manager to relabel the
data buffers and cm_scache_t that are known to contain valid data.
When processing SMB_SESSION_SETUP_ANDX in smb_ReceiveV3SessionSetupX
it is possible that the smb client might indicate that it requires an
Mpx Count greater than we are configured to support. If so, log it
to the Windows Event Log as a warning.
It is also possible that the client might specify that its maximum
receive buffer is smaller than the SMB_PACKETSIZE. If so, log it
to the Windows Event Log as a warning.
Finally, if the client specifies a virtual circuit number of zero,
the client thinks this is its first time communicating with us.
In which case we should invalidate all prior virtual circuits.
We also log this request to the Windows Event Log as informational.
Russ Allbery [Wed, 18 Feb 2009 22:20:52 +0000 (14:20 -0800)]
Make openafs-modules-source arch: all
* Make openafs-modules-source architecture-specific (arch: any instead
of arch: all). The new method for generating the kernel source tree
only generates correct build machinery for the architecture on which
it was built, making the package architecture-specific. The generated
tree is so much smaller that this still only uses about 1MB of archive
space more than the old method and makes each openafs-modules-source
package much smaller. This is a workaround until we can fix
libafs_tree to include enough build machinery to handle all Linux
architectures from one source tree. (Closes: #516023)
Russ Allbery [Fri, 13 Feb 2009 03:40:45 +0000 (19:40 -0800)]
Fix creation of the openafs-modules-* packages
Also remove server documentation from openafs-modules-source and add
the README to openafs-modules-dkms, and remove DH_OPTIONS from
debian/rules since it's no longer needed.
Russ Allbery [Fri, 13 Feb 2009 02:02:30 +0000 (18:02 -0800)]
General improvements to debconf configuration handling
* General improvements to debconf configuration handling.
- Do not abort the config script if we have no default realm and
dnsdomainname fails. (LP: #274886, #318132)
- Do not abort postinst if we can't resolve any host name for the
cell. Just continue in that case, omitting any configuration for
the local cell. (LP: #322054)
- Correctly set the default for AFS_CRYPT from the existing config.
- The cache size is high, not critical, since we have a default.
- Don't create the client ThisCell if no local cell was specified.
- Improve the leading comment in afs.conf.client. Users can edit it,
but any changes other than the setting values will be lost.
- Remove the openafs-fileserver/bosconfig_moved template, which would
only be shown on upgrades from pre-1.2.0 versions.
- Standardize coding style and always quote strings.
Russ Allbery [Fri, 13 Feb 2009 01:27:03 +0000 (17:27 -0800)]
Don't exit successfully if sourcing the debconf module fails
* Abort the config script rather than exiting successfully if the
debconf shell module is not available. The config script should never
be run in the absence of debconf, so if this fails, something deeper
is wrong and we shouldn't blindly continue.
Russ Allbery [Fri, 13 Feb 2009 01:24:57 +0000 (17:24 -0800)]
Add initial DKMS support and compress module source with bzip2
* Add initial DKMS support via an openafs-modules-dkms package, based on
work by Robert Gerlach. (LP: #288743)
* Compress the source in openafs-modules-source with bzip2 instead of
gzip to reduce the package size.
As evident in a crash dump, there is a race surrounding access to the
scp field of the smb_fid_t object. Not all access was protected by
the smb_fid_t mx and the cm_scache_t object was not always being
reference counted within the accessing function.
This patch ensures that all initial references to the scp object
are performed under the smb_fid_t mx mutex and that the cm_scache_t
is prevented from being recycled by obtaining a local reference.
Finally, CM_ERROR_BADFD is returned as an error if a request begins
after the smb_fid_t scp field has already been cleared by a smb_CloseFID()
call as part of a concurrent request.
A readonly volume with multiple instances was being marked alldown
when one of the instances resulted in VNOVOL because the vldb and
the indicated file server were out of sync. The cache manager would
then attempt to re-obtain the volume location info from the vldb
for the entire timeout period.
This patch:
adds trace logging to cm_Analyze indicating which server references
are being deleted and which remain in response to a VNOVOL/VMOVED error.
adds trace logging to cm_UpdateVolumeStatusInt showing how the
new volume status value is determined.
corrects cm_Analyze() so that it doesn't corrupt the server reference
list during cm_FreeServerList() calls; doesn't orphan the server reference
list by setting *serverpp to NULL; and only re-obtains the volume info
list once per request.
Russ Allbery [Thu, 12 Feb 2009 21:23:20 +0000 (13:23 -0800)]
First cut at debhelper 7 support
* Update to debhelper compatibility level V7.
- Use dh where possible in debian/rules.
- Use dh_lintian to install Lintian overrides.
- Eliminate the configure target and do all the work in build.
- Do more in the install target and less in binary, matching the
default command stacks in dh.
- Use a debian/clean configuration file to let dh clean do more of the
work rather than using rm commands in debian/rules.