Move the afs/DOC files to the top-leve doc/txt directory, since this has
become the home for developer oriented documentation.
Change-Id: I128d338c69534b4ee6043105a7cfd390b280afe3
Reviewed-on: https://gerrit.openafs.org/12662
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Cleanup the doc/txt directory by incorporating the old release
notes into the NEWS file.
Change-Id: I63911fc5cb0b476e201148c6d3fa3441f4746ab7
Reviewed-on: https://gerrit.openafs.org/12661
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Remove dozens of trailing spaces and make consistent use of tabs
for indentation throughout the file.
Change-Id: Ibbd17d2b9828590ffd84b76aac70646e9fe9cb2c
Reviewed-on: https://gerrit.openafs.org/12665
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Before Linux kernel commit 4919c5e45a91b5db5a41695fe0357fbdff0d5767,
d_splice_alias in some cases can d_rehash the given dentry without
attaching it to the given inode, right before the dentry is unhashed
again. This means that for a few moments, that negative dentry is
visible to __d_lookup, and thus is visible to path lookup and can be
given to afs_linux_dentry_revalidate.
Currently, afs_linux_dentry_revalidate will say that the dentry is
valid, because d_time and other fields are set; it's just not attached
to an inode. This causes an ENOENT error on lookup, even though the
file is there (and no OpenAFS code said otherwise).
Normally this race is rare, but it can be frequently exercised if
we access the same directory via different names at the same time.
This can happen with multiple mountpoints to the same volume, or by
accessing an @sys directory via its abbreviated and expanded forms.
To get around this, make afs_linux_dentry_revalidate check negative
'dentry's to see if they are unhashed. We also lock the parent inode,
in order to guarantee that a problematic d_splice_alias call isn't
running at the same time (and thus, we know the dentry will not be
unhashed immediately afterwards). This slows down
afs_linux_dentry_revalidate for valid negative 'dentry's a little, but
it allows us to use negative dentry's at all.
Linux kernel commit 4919c5e45a91b5db5a41695fe0357fbdff0d5767 fixes
this issue, which was included in 2.6.34, so don't do this workaround
for 2.6.34 and on.
Change-Id: I8e58ebed4441151832054b1ef3f1aa5af1c4a9b5
Reviewed-on: https://gerrit.openafs.org/12638
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
struct path is declared with the "designated_init" attribute,
and module builds now use -Werror=designated-init. Cope.
And as pointed out by Michael Meffie, struct ctl_table has
the same requirement now, so use a designated initializer
for the final element of the sysctl table too.
Change-Id: I0ec45aac961dcefa0856a15ee218085626a357c7
Reviewed-on: https://gerrit.openafs.org/12663
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: Benjamin Kaduk <kaduk@mit.edu>
When setting up a new volume, the cache manager calls afs_GetServer() to
setup the server object for each fileserver associated with the volume.
The afs_GetServer() function locks afs_xserver and then, among other
things, calls afs_GetCell() to lookup the cell info by cell number.
When the cache manager is running in afsdb mode, afs_GetCell() will
attempt to refresh the cell info if the time-to-live has been exceeded
since the last call to afs_GetCell(). During this refresh the AFSDB
calls afs_GetServer() to update the vlserver information. The afsdb
handler thread and the thread processing the volume setup become
deadlocked since the afs_xserver lock is already held at this point.
This bug will manifest when the DNS SRV record TTL is smaller than the
time the fileservers respond to the GetCapabilities RPC within
afs_GetServer() and there are multiple read-only servers for a volume.
Avoid the deadlock by using the afs_GetCellStale() variant within
afs_GetServer(). This variant returns the memory resident cell info
without the afsdb upcall and the subsequent afs_GetServer() call.
Change-Id: Iad57870f84c5e542a5ee20f00ea03b3fc87683a1
Reviewed-on: https://gerrit.openafs.org/12652
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Commit cb9e029255 removed the
force_if_down check in afs_ConnBySA, which effictively turned on
force_if_down flag for every call to afs_ConnBySA. This caused
afs_ConnBySA to always return connections, even for server addresses
marked down and force_if_down set to 0.
One serious consequence of this bug is the cache manager will retry the
preferred vlserver indefinitely when it is unreachable. This is because
the loop in afs_ConnMHosts always tries hosts in preferred order and
expects afs_ConnBySA to return a NULL if the server address has no
connections because it is marked down.
Restore the check for server addresses marked down to honor the
force_if_down flag again so we do not get connections for down servers
unless requested.
Change-Id: Ia117354929a62b0cedc218040649e9e0b8d8ed23
Reviewed-on: https://gerrit.openafs.org/12653
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Fix the handling of default values for the various rpmbuild options
which can be given. These have been broken as code was shuffled around
over the years.
Remove obsolete comments about detecting what to build based on the
architecture.
Provide the '--without authlibs' option to disable the openafs-authlibs
package.
Change-Id: I6c8db1f3163ee241f9a4d1282345a0ddeabd284c
Reviewed-on: https://gerrit.openafs.org/12596
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: Benjamin Kaduk <kaduk@mit.edu>
The space allocated for outputFileBuf is only 2 bytes larger than
sizeof(VERS_FILE). But we add potentially 4 extra bytes like
".txt" or ".xml". Just allocate enough space for all file suffices.
Change-Id: Ic0f97590be208deaf9c4a5c25e21056ea9d2cd6f
Reviewed-on: https://gerrit.openafs.org/12657
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Currently, afs_linux_lookup looks roughly like this pseudocode:
{
code = afs_lookup(&vcp);
if (!code) {
ip = AFSTOV(vcp);
error = process_ip(ip);
if (error) {
goto done;
}
}
process_dp(dp);
newdp = d_splice_alias(ip, dp);
done:
cleanup();
}
Note that if there is an error while processing the looked-up inode
(ip), we jump over d_splice_alias. But if we encounter an error from
afs_lookup itself, we do not jump over d_splice_alias. This means that
if afs_lookup encounters any error, we initialize the given dentry
(dp) as a negative entry, effectively telling the Linux kernel that
the requested name does not exist.
This is correct for ENOENT errors, of course, but is incorrect for any
other error. For non-ENOENT errors we later return an error from the
function, but this does not invalidate the generated dentry. The
result is that when afs_lookup encounters an error, that error will be
propagated to userspace, but subsequent lookups for the same name will
yield an ENOENT error (until the dentry is invalidated). This can
easily cause a file to seem to mysteriously disappear, if a transient
error like network problems caused the afs_lookup call to fail.
To fix this, treat ENOENT as a non-error, like the comments already
suggest. In our case, ENOENT is not really an error; it just means we
populate the given dentry differently. So if we get ENOENT from
afs_lookup, set our vcache to NULL and clear the error, and continue.
This also has the side effect of not treating ENOENT errors from
afs_CreateAttr identically to ENOENT errors from afs_lookup. That
shouldn't happen, but there have been abuses of the ENOENT error code
in the past, so it is probably better to be cautious.
Many thanks to Gaja Sophie Peters for assistance in tracking down and
testing fixes for this issue, including providing access to test systems
experiencing the buggy behavior.
FIXES 133654
Change-Id: Ia9aab289d5c041557ab6b00f1d41de2edfc97a89
Reviewed-on: https://gerrit.openafs.org/12637
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Joe Gorse <jhgorse@gmail.com>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Tested-by: Michael Meffie <mmeffie@sinenomine.net>
Currently, the cleanup and error handling in afs_linux_lookup is
structured similar to this pseudocode:
if (!code) {
if (!IS_ERR(newdp)) {
return no_error;
} else {
return newdp_error;
}
} else {
return code_error;
}
The multiple different nested error cases make this a little complex.
To make this easier to follow for subsequent changes, alter this
structure to be more like this:
if (IS_ERR(newdp)) {
return newdp_error;
}
if (code) {
return code_error;
}
return no_error;
There should be no functional change in this commit; it is just code
reorganization.
Technically the ordering of these checks is changed, but there is no
combination of conditions that actually results in different code
being hit. That is, if 'code' is nonzero and IS_ERR(newdp) is true,
then we would go through a different path. But that cannot happen,
since if 'code' is nonzero, we have no inode and so IS_ERR(newdp)
cannot be true (d_splice_alias cannot return an error for a NULL
inode). So there is no functional change.
Change-Id: I94a3aef5239358c3d13fe5314044dcc85914d0a4
Reviewed-on: https://gerrit.openafs.org/12636
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Joe Gorse <jhgorse@gmail.com>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Tested-by: Michael Meffie <mmeffie@sinenomine.net>
Credit where it's due. And the remainder of the introduction may
provide some useful context too.
Change-Id: I99c7e599363126c581ae1ac00da67c33acc3687f
Reviewed-on: https://gerrit.openafs.org/12644
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
A file in the source tree is much easier to locate than an old
mailing list post; it's quite handy to have this at hand as a
reference.
Change-Id: I5267a2f86b36e92b05249364085bdd33aeb28d1b
Reviewed-on: https://gerrit.openafs.org/12642
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
This warning is a bit confusing to see, since it doesn't say anything
about AFS (making it unclear where it's coming from), and it lacks a
trailing newline (making it ugly). Fix both of these.
Change-Id: I92a3d07fd193bf99b545aef9b21f52d23c356a2d
Reviewed-on: https://gerrit.openafs.org/12641
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
If the salvager changed the volume, set the VolumeDiskData.updateDate
field so that
1. the change is visible via "vos examine"
2. backup services will backup the corrected volume
Teradactyl pointed out the problem which forces cell administrators
to manually trigger a backup for each volume that has been salvaged.
Change-Id: I9a35b92e8abbe3b54b08e64ac13de44442736c72
Reviewed-on: https://gerrit.openafs.org/12629
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Instead of failing silently when the bosserver is started with an
unknown option, print an error message and exit with a non-zero value.
Continue to exit with 0 when the -help option is given to request the
usage message.
This change should help make bosserver startup failures more obvious
when an unsupported option is specified. Example systemd status message:
systemd[1]: Starting OpenAFS Server Service...
bosserver[32308]: Unrecognized option: -bogus
bosserver[32308]: Usage: bosserver [-noauth] ....
systemd[1]: openafs-server.service: main process exited,
code=exited, status=1/FAILURE
Change-Id: I8717fb4a788fbcc3d1e2d271dd03511c5b504f10
Reviewed-on: https://gerrit.openafs.org/12630
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Beginning in AFS 3.4 and 3.5 the ack trailer includes the size of the
peer's receive window. This value is used to update the sender's
transmit window (twind). When the twind is increased the application
thread is signaled to indicate that more packets can be sent.
This change wakes the application thread after twind is updated by
the peer's receive window instead of beforehand. Failure to do so
can result in 100ms transmit delays when the receive window transitions
from closed to open.
Change-Id: Id129ea93e94612a4b8cce9f8cbddde9c779ff26b
Reviewed-on: https://gerrit.openafs.org/12625
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
super_setup_bdi() dynamically allocates backing_dev_info structures
for filesystems and cleans them up on superblock destruction.
Appears with Linux commit fca39346a55bb7196888ffc77d9e3557340d1d0b
Author: Jan Kara <jack@suse.cz>
Date: Wed Apr 12 12:24:28 2017 +0200
Change-Id: I67eed0fcb8c96733390579847db57fb8a4f0df3e
Reviewed-on: https://gerrit.openafs.org/12614
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Check if the macro exists, define it if it does not.
Change-Id: I9990579f94bfba0804e60fa6ddcc077984cc46c3
Reviewed-on: https://gerrit.openafs.org/12611
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Update the spec file to keep up with accumulated changes.
* Correct installation location of db check programs.
* Install afsd to the legacy location to avoid breaking
init scrips and systemd configs.
* Exclude yet another duplicated copy of kpwvalid.
* libubik_pthread.a is gone.
* Install the kpwvalid man page.
* Continue to remove the obsolete kdb program.
* Update the names of the pam_afs symlinks.
* Add libkopenafs to authlibs.
* Package dafssync-debug man pages.
* Package opr/queue.h in devel.
* Package akeyconvert and man page.
* Do not package fuse version of afsd. A separate sub-package
for afsd.fuse is warrented, since it adds new libfuse
dependencies.
* Package new server man pages, including dafsssync-* pages.
* Package libafsrfc3961.a as a devel lib.
* Continue to package kauth programs.
Change-Id: I875c3b8dee53abbc67b0f05f8b291bb58abf41a5
Reviewed-on: https://gerrit.openafs.org/12595
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: Benjamin Kaduk <kaduk@mit.edu>
r285819 eliminated b_saveaddr from struct buf, while r292373 changed the
arguments to VOP_GETPAGES. The approach used by this patch to address
these changes was inspired by FreeBSD's nfs and samba clients.
Change-Id: Ibcf6b6fde6c86f96aa814af2bca08f1a8b286740
Reviewed-on: https://gerrit.openafs.org/12575
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Convert the build and install from the deprecated 'make dest' to the
modern 'make install' method.
* Clarify the install section by unrolling the shell scripts,
reorganizing, and improving the comments.
* Remove the gzip glob of the man pages; rpmbuild automatically
compresses the man pages and will handle symlinks correctly.
* Remove the generated temporary list file and specify files directly.
* Remove the extra tar commands to install the man pages out of the doc
directory; 'make install..' installs the man pagess.
* Remove code in the install section which determines the sysname. This is
no longer needed during the install.
* Update the kernel module install commands to accommodate the
conversion from 'make dest'.
Change-Id: I97ec80185a2b11704b27ea74941b50ff4a5aca8c
Reviewed-on: https://gerrit.openafs.org/12594
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: Benjamin Kaduk <kaduk@mit.edu>
Remove trailing whitespace characters that have crept into
the rpm spec file over the years.
Change-Id: I08c7ad926ddb524d6938b26513963c28c70b4195
Reviewed-on: https://gerrit.openafs.org/12606
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: Benjamin Kaduk <kaduk@mit.edu>
Commit c89fd17df1 introduced an explicit
include of linux/cred.h since the latest kernel no longer includes it
implicitly in sched.h. Alas, older kernels (like 2.6.18) don't have this
file. Add a configure test for the existence of cred.h and only include
it if actually present.
Change-Id: Ia7e38160492b1e03cdb257e4b2bef4d18c4a28fb
Reviewed-on: https://gerrit.openafs.org/12593
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
With Linux commit e26512fea5bcd6602dbf02a551ed073cd4529449, cred.h is no
longer included in sched.h.
Several components of libafs which require cred.h were picking it by
including sched.h.
Instead, explicitly add an include for cred.h. cred.h begins with a
customary one-shot to prevent multiple loads:
#ifndef _LINUX_CRED_H
#define _LINUX_CRED_H
Therefore we don't need a new autoconf test or preprocessor conditional
to prevent redundant includes on older Linux releases.
Change-Id: Ifc496c83141d2cfbd417133feb6d87c1146e5014
Reviewed-on: https://gerrit.openafs.org/12574
Tested-by: Mark Vitale <mvitale@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Joe Gorse <jhgorse@gmail.com>
Tested-by: Joe Gorse <jhgorse@gmail.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
In Linux commit c3edc4010e9d102eb7b8f17d15c2ebc425fed63c, signal_struct
and other signal handling declarations were moved from sched.h to
sched/signal.h.
This breaks existing OpenAFS autoconf tests for recalc_sigpending() and
task_struct.signal->rlim, so that the OpenAFS kernel module can no
longer build.
Modify OpenAFS autoconfig tests to cope.
Change-Id: Ic9f174b92704eabcbd374feffe5fbeb92c8987ce
Reviewed-on: https://gerrit.openafs.org/12573
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Joe Gorse <jhgorse@gmail.com>
Tested-by: Joe Gorse <jhgorse@gmail.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
With Linux commit a528d35e8bfcc521d7cb70aaf03e1bd296c8493f
statx: Add a system call to make enhanced file info available
The Linux getattr inode operation is altered to take two additional
arguments: a u32 request_mask and an unsigned int flags that indicate
the synchronisation mode. This change is propagated to the
vfs_getattr*() function.
- int (*getattr) (struct vfsmount *, struct dentry *, struct kstat *);
+ int (*getattr) (const struct path *, struct kstat *,
+ u32 request_mask, unsigned int sync_mode);
The first argument, request_mask, indicates which fields of the statx
structure are of interest to the userland call. The second argument,
flags, currently may take the values defined in
include/uapi/linux/fcntl.h and are optionally used for cache coherence:
(1) AT_STATX_SYNC_AS_STAT tells statx() to behave as stat() does.
(2) AT_STATX_FORCE_SYNC will require a network filesystem to
synchronise its attributes with the server - which might require
data writeback to occur to get the timestamps correct.
(3) AT_STATX_DONT_SYNC will suppress synchronisation with the server in
a network filesystem. The resulting values should be considered
approximate.
This patch provides a new autoconf test and conditional compilation to
cope with the changes in our getattr implementation.
Change-Id: Ie4206140ae249c00a8906331c57da359c4a372c4
Reviewed-on: https://gerrit.openafs.org/12572
Reviewed-by: Joe Gorse <jhgorse@gmail.com>
Tested-by: Joe Gorse <jhgorse@gmail.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
On RHEL7 if the AFS client is stopped with 'service openafs-client
stop', but that fails for some reason (most commonly because some
process has a file or directory in AFS open) systemd will decide that
the openafs-client is in a failed state when it is actually running.
If one then runs 'service openafs-client start' systemd will start a
new AFS client. At this point AFS access will continue to work until
the functional AFS client is (successfully) stopped, at which point a
reboot is required to recover.
Have systemd check the status of 'fs sysname' before starting the
AFS client, so we avoid getting into a state that requires a reboot.
Change-Id: I28a5cca746823d69183ea5ce65c10e1725009c5c
Reviewed-on: https://gerrit.openafs.org/12443
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
The AFS_VM_RDWR_ENV configuration parameter (defined or not defined
in each platform's param.h) is undocumented, but appears to be an
indication of a property of the platform OS's VFS layer, or perhaps just
of the complexity of the read/write vnops that we implement for it.
That is, AFS_VM_RDWR_ENV is defined when the read/write vnops implement
partial write logic (and presumably when they interact with the OS VM
layer in ways not expressed by the afs_write() abstraction); systems
that do not define AFS_VM_RDWR_ENV can use the afs_write() function
fairly directly as the vnode operation. Use of AFS_VM_RDWR_ENV
evolved over time, with the original (AFS 3.2/3.3-era) code using a
simple scheme that handled partial writes directly in afs_write()
and avoided complexity in callers. In AFS 3.4, sunos and solaris
gained a more complicated read/write vnop that incorporated the
afs_DoPartialWrite() call itself, and eventually in 3.6 we see the
behavior established at the original IBM import, with all the (Unix)
OSes supported at that time defining AFS_VM_RDWR_ENV.
When DARWIN support was brought in in commit
a41175cfbb, its param.h properly did
not define AFS_VM_RDWR_ENV, as OS X uses a VFS interface that shares
some level of abstraction with the traditional BSD VFS and its
read/write/getpages/putpages operations, so the afs_write() behavior
was natural and no extra complications needed for integration with the
VM layer or other optimizations.
However, when the initial FreeBSD support came in a few months later,
it seems to have taken inspiration from the OSes that were supported
in the initial IBM import, and kept the AFS_VM_RDWR_ENV definition.
This was then propagated to all the later BSDs as they were added.
Perhaps the most noticeable consequence of this definition is that
the calls to afs_DoPartialWrite() from afs_write() are bypassed, with
a comment that "[i]f write is implemented via VM, afs_DoPartialWrite()
is called from the high-level write op" (and calls to afs_FakeOpen()
and afs_FakeClose() are similarly skipped). This means that attempting
to write a file larger than the local cache will hang waiting for
more space to be freed, which will never happen as the vcache remains
locked and will not be written out in the background.
In the absence of a documented meaning for AFS_VM_RDWR_ENV, this
also gives us a proxy that can be used to indicate whether a given
OS's support intended to claim the AFS_VM_RDWR_ENV -- such platforms
will actually contain the call to afs_DoPartialWrite() in the
appropriate vnode operation. This can be used to sanity-check the
places where AFS_VM_RDWR_ENV is removed by this commit. Interestingly,
HP-UX does not call afs_DoPartialWrite() but also is clearly in a VFS
that uses a rdwr()-based approach, as the corresponding vnode operation
is implemented by mp_afs_rdwr(), so leave it unchanged for now.
Tim Creech is responsible for noting the lack of calls to
afs_DoPartialWrite() on FreeBSD, and Chaskiel Grundman for the
historical research into pre-OpenAFS AFS behavior.
Designing and implementing more complicated BSD read/write vnops that
incorporate afs_DoPartialWrite() and other improvements is left for
future work.
Change-Id: I8e89855ac31303934f97d0753b64899fb7e3867c
Reviewed-on: https://gerrit.openafs.org/12520
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Antoine Verheijen <apv@ualberta.ca>
Reviewed-by: Tim Creech <tcreech@tcreech.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Taking a volume offline always clears the inService bit. Taking a
volume out of service also takes it offline. Therefore, if the
inService flag is false, the volume in question should be offline.
On dafs, an offline volume should be unattached.
The attach2() function does not change the state of the volume received
as an argument to unattached when the inService flag is false. Instead,
this function changes the state of the volume in question to
pre-attached and returns VNOVOL to the client. As result, subsequent
accesses to this volume will make the server try and fail to attach
this offline volume over and over again, writing to the FileLog each
time.
To fix this problem, detach the volume received as an argument if the
inService flag is false. Since the new state of this volume will be
unattached, subsequent accesses will not hit attach2().
This situation where a volume is not offline but is also not in service
can occur if a volume is taken offline with vos offline and some time
later the DAFS fileserver is shutdown and restarted; the volume is
placed into the preattach state by default when the server restarts.
Each access to the volume by clients then causes the fileserver to
attempt to attach the volume, which fails, since the in-service flag in
the volume header is false from the previous vos offline. The
fileserver will log a warning to the FileLog on each attempt to attach
the volume, and this will fill the FileLog with duplicate messages
corresponding to the number of attempted accesses.
Change-Id: Ifce07c83c1e8dbf250b88b847d331234bdaa9df5
Reviewed-on: https://gerrit.openafs.org/12515
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Starting with Solaris Studio 12.3, it is documented that Solaris kernel
modules (such as libafs) must not use any floating point, vector, or
SIMD/SSE instructions on x86 hardware. However, each new Studio
compiler release (12.4 and especially 12.5) is more likely to use these
types of instructions by default.
If the libafs kernel module includes any forbidden kernel instructions,
Solaris will panic the system with:
BAD TRAP: type=7 (#nm Device not available)
Provide a new autoconfig test to specify the required compiler options
(-xvector=%none -xregs=no%float) when building the OpenAFS kernel module
for Solaris, so that no invalid x86 instructions are used.
In addition, reinstate default kernel module optimization for Solaris.
It had been disabled in commit 80592c53cb
to address this same issue in Studio 12.3 and 12.4. However, Studio
12.5 started using some SSE instructions even with no optimization.
This commit has been tested with OpenAFS master and Studio 12.5 at all
optimization levels (none, -xO1 through -xO5) and verified to contain no
XMM register instructions via the following command:
$ gobjdump -dlr libafs64.o | grep xmm | wc -l
Change-Id: Ic3c7860f7d524162fd9178a1dab5dd223722ee43
Reviewed-on: https://gerrit.openafs.org/12558
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
If a fileserver is shutdown while one or more PR_GetHostCPS calls
are in progress, this state is saved in the fsstate.dat file as
hostFlags HCPS_WAITING, HCPS_INPROGRESS. Other hosts that are
merely waiting will have HCPS_WAITING recorded.
However, it makes no sense to restore host structs in this state,
because the GetCPS calls will no longer be in progress. Once these
hosts become active, they will block server threads and quickly cause
all server threads to be exhausted as other CPS requests are blocked
behind them.
Instead, exclude these states from both save and restore.
Change-Id: I3fad67b70c96dc967d6f8e3a7b393cfda076c91d
Reviewed-on: https://gerrit.openafs.org/12561
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
What's displayed by fs wscell is not necessarily the current content
of ThisCell, but that at the time of starting the client. Say so.
FIXES 133339
Change-Id: Id3351f1236e5061340eb07041d4ce3e4de69a1a1
Reviewed-on: https://gerrit.openafs.org/12537
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
The InstallerPlugins framework provided by the MacOSX10.12.sdk does not
define symbols for architecture i386. As a result, the OpenAFS code
cannot be built on OS X 10.12.
To fix this problem, build the afscell xcode project only for active
architecture.
Change-Id: I2a2bd5694826b668fceb7402567fba1d0f128479
Reviewed-on: https://gerrit.openafs.org/12531
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
The unix cache manager caches VLDB information for read-only volumes as
long as a volume callback is held for a read-only volume. The volume
callback may be held as long as files in the read-only volume are being
accessed. The cache manager caches VLDB information for read/write
volumes as long as volume level errors (such as VMOVED) are not returned
by a fileserver while accessing files within the volume.
Add a new option to set the maximum amount of time VLDB information will
be cached, even if a callback is still held for a read-only volume, or
no volume errors have been encounted while accessing files in read/write
volumes.
This avoids situations where the vldb information is cached indefinitely
for read-only and read/write volumes. Instead, the VL servers will be
periodically probed for volume information.
Change-Id: I5f2a57cdaf5cbe7b1bc0440ed6408226cc988fed
Reviewed-on: https://gerrit.openafs.org/11898
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Commit 37db7985fd modernized how we
declare module dependencies on Solaris 10 and newer.
Instead of explicitly specifying recent Solaris version numbers, specify
old versions for the old method. This should be more future proof.
Thanks to Ben Kaduk for the suggestion.
Change-Id: I7b3c90803825e2c0736548b56deb354183e81b15
Reviewed-on: https://gerrit.openafs.org/12529
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Move the macros to search for the solaris cc to a separate macro and
update the search paths to keep up with released versions.
Change-Id: Iaba816f1acf5f45d4e147ae517e73949eb8fe949
Reviewed-on: https://gerrit.openafs.org/12528
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Now that kernel 4.9 has hit jessie-backports, it becomes desirable to
also backport the associated openafs patches.
Unfortunately, Linux-4.9-inode_change_ok-becomes-setattr_prepare.patch
causes a build failure against jessie's current default kernel,
3.16.39-1, due to the fact that setattr_prepare() is available (it was
cherrypicked to address CVE-2015-1350) but file_dentry() is not (it was
introduced in kernel 4.6).
This makes it difficult to have a version of openafs for jessie that
supports both kernels.
To deal with this, follow the implementation of file_dentry() in 4.6,
and simplify it to account for the lack of d_real() support in older
kernels.
Note that inode_change_ok() has been added back to 3.16.39-1 to avoid
ABI changes. That means the current openafs packages in jessie continue
to work with kernel 3.16.39-1 since they do not include
Linux-4.9-inode_change_ok-becomes-setattr_prepare.patch.
Originally reported at
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=855366
FIXES RT134158
Change-Id: I157aa2ff25945c1c6e3b8e4a600557125711a681
Reviewed-on: https://gerrit.openafs.org/12523
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Linux commit f74e7b33c37e vfs: remove unused have_submounts() function
(v4.10-rc2) removes have_submounts from the tree after providing a
replacement (path_has_submounts) for its last in-tree caller, autofs.
However, it turns out that OpenAFS is better off not using the new
path_has_submounts. Instead, OpenAFS could/should have stopped using
have_submounts() much earlier, back in Linux v3.18 when d_invalidate
became void. At that time, most in-tree callers of have_submounts had
already been converted to use check_submounts_and_drop back in v3.12.
At v3.18, a series of commits modified check_submounts_and_drop to
automatically remove child submounts (instead of returning -EBUSY if a
submount was detected), then subsumed it into d_invalidate. The end
result was that VFS now implicitly handles much of the housekeeping
previously called explicitly by the various filesystem d_revalidate
routines:
- shrink_dcache_parent
- check_submounts_and_drop
- d_drop
- d_invalidate
All in-tree filesystem d_revalidate routines were updated to take
advantage of this new VFS support.
Modify afs_linux_dentry_revalidate to no longer perform any special
handling for invalid dentries when D_INVALIDATE_IS_VOID. Instead, allow
our VFS caller to properly clean up any invalid dentry when we return 0.
Change-Id: I0c4d777e6d445857c395a7b5f9a43c9024b098e9
Reviewed-on: https://gerrit.openafs.org/12506
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Starting with 4.8 Linux kernels our existing build script
generator, make_kbuild_makefile.pl, does not pass the debugging
symbols CFLAGS that were present when building for previous kernels.
This fix appends the $(KERN_DBG) variable which will only be defined
when the configuration includes the --enable-debug-kernel option.
Change-Id: I9a85dc0311a3a706239bc9e471b2d7197ebe1946
Reviewed-on: https://gerrit.openafs.org/12519
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: Benjamin Kaduk <kaduk@mit.edu>
Add the --without-swig option to disable the automatic swig detection
and disable the optional features which depend on swig. This allows
builders to avoid swig even if present on the build system.
Also, add the --with-swig option to force the check and fail if not
detected. This allows builders to declare the swig features are
mandatory.
The default continues to be to check for swig, and if present, build the
optional features which require swig.
To disable the automatic check for swig and disable the features which
depend on swig:
./configure --without-swig # or --with-swig=no
To force the check and fail if swig is not present on the system:
./configure --with-swig # or --with-swig=yes
If --with-swig is given and swig is not detected, then configure will
fail with the message:
configure: error: swig requested but not found
The Perl 5 bindings for libuafs is the only feature which requires swig
at this time.
Change-Id: I0726658a9cc7b1b2a9d5e5d306adb6e36ad3c0f6
Reviewed-on: https://gerrit.openafs.org/12518
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Currently, our swig bindings for PERLUAFS define a couple of typemaps
like so:
%typemap(in, numinputs=1, perl5) (char *READBUF, int LENGTH) {
[...]
}
Embedding the target language name in the typemap arguments is a very
old way of specifying what language the typemap is for; they were
removed after swig 1.1. With swig 3.0.x releases (and possibly
others), the specific combination of this deprecated syntax and some
other features we're using causes a segfault. That's clearly a bug in
swig, but we shouldn't be using the deprecated syntax anyway.
Update this to instead use preprocessor symbols to specify
language-specific typemaps (#ifdef SWIGPERL). We only actually define
these for perl right now, so make sure to throw an error if we're not
running for perl.
FIXES 134103
Change-Id: I14264a2dfada53d99413808ed5d60b79b1ee44f3
Reviewed-on: https://gerrit.openafs.org/12517
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
To improve build reproducibility, if the SOURCE_DATE_EPOCH environment
variable is set, use it to deterministically replace the embedded build
date, and do not include the username or hostname in this case.
https://wiki.debian.org/ReproducibleBuilds/TimestampsProposal
Change-Id: I9ba951f1836385ffd14aad95f071bf8c672a01bb
Reviewed-on: https://gerrit.openafs.org/12471
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Move the klog.krb5 man page to the openafs-krb5 package, which
distributes the klog.krb5 binary, instead of the general openafs
package.
Change-Id: I6dc3896f330bb0c639cc75155f611ddaf11b9b75
Reviewed-on: https://gerrit.openafs.org/12509
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Fix a bug introduced in commit aab1e71628
in which a pointer was incorrectly checked for a NULL value.
Fixes a crash when a PAG is set on Solaris.
# mdb unix.1 vmcore.1
> ::status
...
panic message:
BAD TRAP: type=e (#pf Page fault) rp=fffffffc802ba8f0 addr=0 occurred in
module "afs" due to a NULL pointer dereference
> ::stack
pag_to_gidset+0x145()
setpag+0xcc()
AddPag+0x3a()
afs_setpag+0x58()
Afs_syscall+0x115()
The crash occurs since gidslot is NULL during the assignment:
*gidslot = pagvalue;
Change-Id: Ic4d50c6b046d10faa49cd4363692e0302707583d
Reviewed-on: https://gerrit.openafs.org/12508
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Starting from OS X 10.11, the OpenAFS binaries were moved to the
following directories: /opt/openafs/bin and /opt/openafs/sbin. However,
the OpenAFS prefpane is not aware of the change mentioned above. As a
result, some functionalities provided by the OpenAFS prefpane are not
working properly.
To fix this problem, add the new paths to the proper environment
variable.
Change-Id: Idaa2f0329af2092cf9ad1d63f1a01300b150227a
Reviewed-on: https://gerrit.openafs.org/12507
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Commit c3bbf0b444 added routine
osi_TryEvictDentries and included new logic for D_INVALIDATE_IS_VOID.
Unfortunately, this new code path no longer uses dentry; it also should
have been made conditional at that time.
Wrap the declaration of dentry in #ifndef D_INVALIDATE_IS_VOID to
eliminate the unused variable warning.
Change-Id: I89c1430ba984539ca775da2540ea966030de0701
Reviewed-on: https://gerrit.openafs.org/12505
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Collect the syscall op code (AFSOP_) defines in one section and cleanup
the use of whitespace and tabs.
This should be a non-functional change.
Change-Id: I1ba763a445b938fcb3677a388a703e1405ee166e
Reviewed-on: https://gerrit.openafs.org/12501
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>