Russ Allbery [Mon, 8 Mar 2010 22:18:05 +0000 (14:18 -0800)]
Initial changelog for 1.4.12~pre4
Add upstream change list since the deltas that I pulled up. Switch
the download area over to the candidate releases. (1.4.12 will
probably be released before this package is uploaded, but we'll pull
1.4.12~pre4 first to get the packaging updated.)
Russ Allbery [Tue, 9 Mar 2010 02:25:30 +0000 (18:25 -0800)]
Prepare to rebase the changelog on 1.4.12+dfsg-1
Add the older changelog from 1.4.11+dfsg-7 in preparation for pulling
up subsequent changes from 1.4.12+dfsg-1. We're going to base the
first 1.5 experimental release on that version.
Russ Allbery [Wed, 20 Jan 2010 04:31:39 +0000 (20:31 -0800)]
Try to start the client after syslog
* List $syslog in Should-Start for the openafs-client init script, since
otherwise if loading the module causes a kernel panic, it won't be
logged to disk.
Russ Allbery [Wed, 20 Jan 2010 01:59:26 +0000 (17:59 -0800)]
Require $remote_fs be started before us
* Update init script to require $remote_fs be started first. This won't
be the case in the long run, but for now some important boot-time
options need /usr/bin/fs to set them.
Russ Allbery [Wed, 20 Jan 2010 01:24:31 +0000 (17:24 -0800)]
Add libkopenafs1 and install other new upstream files
Install new man pages added upstream, install the *.so link for
libkopenafs into libopenafs-dev, and create a new libkopenafs1 package
for the runtime libkopenafs library.
Russ Allbery [Wed, 20 Jan 2010 00:32:56 +0000 (16:32 -0800)]
Restore build modifications from stripping non-DFSG material
The merge with the new upstream release undid the build modifications
to permit building with non-DFSG material. Also add some new instances
from the demand-attach binaries.
Russ Allbery [Wed, 20 Jan 2010 00:21:25 +0000 (16:21 -0800)]
Properly install afszcm.cat
* Upstream now installs afszcm.cat and finds it in /usr/share/openafs/C,
so use the version installed via make install and install it in the
same location.
Asanka Herath [Mon, 18 Jan 2010 21:47:31 +0000 (16:47 -0500)]
Windows: Add a context menu for the AFS icon
The OpenAFS plug-in for Network Identity Manager displays an icon
in the notification area that displays status information about
the AFS service and tokens. Add a context menu to the icon so
that users can open the NIM application and get help for the
plug-in from the notification icon.
Derrick Brashear [Sun, 17 Jan 2010 06:10:28 +0000 (01:10 -0500)]
create debugging kext package for MacOS
this creates and installs a debugging kext package for macos. it also
always installs the decode-panic script (which can be used even without
the debug kext)
Marc Dionne [Sat, 16 Jan 2010 22:40:52 +0000 (17:40 -0500)]
More pam warning cleanups - test_pam.c
Clear up a few more warnings in the pam code. The changes here
are very similar to the ones in the previous patch and use
the same configure test:
- use PAM_CONST to conditionally declare pam_message as const
- cast a few arguments to putenv, which expects a non-const pointer
Marc Dionne [Sat, 16 Jan 2010 21:29:10 +0000 (16:29 -0500)]
up.c: remove unused variable pageSize
Variable pageSize is declared and set to the system page size
using getpagesize(), but the value is not used anywhere.
getpagesize() doesn't necessarily have a prototype declared in
unistd.h with recent glibc, which can generate a new warning and
trip up an enabled-checking build.
Instead of trying to put in a workaround, just remove the unused variable.
Marc Dionne [Sat, 16 Jan 2010 23:57:24 +0000 (18:57 -0500)]
uss: Fix IP address parsing and cleanup warnings
In uss_vol_GetServer(), the IP address octets are scanned into "char"
variables, and later cast to afs_int32 to build the address.
sscanf gives warnings because it's expecting an int pointer, and
testing shows that this code doesn't work as expected - the first
3 octets are always parsed as 0.
Use afs_int32 variables instead, which works, eliminates warnings and
simplifies the code.
Note that this code does not seem to be reachable currently.
It was probably meant to be used by planned additional uss commands.
Asanka Herath [Fri, 15 Jan 2010 20:39:12 +0000 (15:39 -0500)]
Windows: Query the MTU value from the registry
The syscfg_GetIFInfo() call uses the interface info returned by
GetAdaptersAddresses(). Also manually query the MTU value in the
registry for any interfaces bound to the same adapter and use the
smallest such MTU as the value returned by syscfg_GetIFInfo().
Simon Wilkinson [Sat, 16 Jan 2010 15:35:34 +0000 (15:35 +0000)]
Don't double free call structure
If the rx_Read() of the number of bytes in the FetchData64 response
fails, then it sets code, and disposes of the call structure. However,
the length safety check that was added in c7b92a3018044f7aca4d9a77644e5c06ef64d1e9 executes regardless of whether
code is set, and the call has already been freed. So we end up calling
rx_Error with a NULL call structure, and panic.
Simon Wilkinson [Sat, 16 Jan 2010 02:15:36 +0000 (02:15 +0000)]
Linux: Add missing prototype
6e65ffbb6c520bf1c28356206410363d8eb36d78 added osi_get_group_pag.
On most platforms this is static, but on Linux it's provided by
the OSI layer. Add a prototype so the compiler doesn't go boom.
Simon Wilkinson [Sat, 16 Jan 2010 02:09:34 +0000 (02:09 +0000)]
Unix CM: Fix negative file length case, again
As originally noted in f6f9ee5402f1718f330a00ec89fb34b05c3cd360
some fileservers return a negative length, typically when a client
is attempting to fetch data that is past the extents of the file,
the CM needs to retain this negative length, and handle it correctly.
c7b92a3018044f7aca4d9a77644e5c06ef64d1e9 added safety checks for
the fileserver returning a length larger than that asked for by
the client. Sadly, this check does a comparison between a
signed, and an unsigned, variable. This leads to it incorrectly
classifying negative responses as being too large.
Jeffrey Altman [Fri, 15 Jan 2010 14:06:05 +0000 (09:06 -0500)]
Rx: Correct AFS_NT40_ENV rx_GetIFInfo max MTU assignments
On UNIX, the rx library values for rx_maxReceiveSize and
rx_MyMaxSendSize are sent by the cache manager directly.
In Windows, they are set by rx_GetIFInfo() which had two
errors.
(1) The comparison of rx_maxReceiveSize and maxsize were
reversed which prevented rx_maxReceiveSize from ever
being set to the interface MTU.
(2) rx_MyMaxSendSize was never assigned a value.
As a result, two problems occurred.
(1) The remote peer was never told about the local MTU.
(2) The local peer ignores the MTU.
From 1.3.60 to 1.5.33, OpenAFS for Windows installers
provided a registry default RxMaxMTU of 1260. This caused
the cache manager to call rx_SetMaxMTU() which in turn set
both rx_maxReceiveSize and rx_MyMaxSendSize in effect
masking these errors.
Jeffrey Altman [Fri, 15 Jan 2010 14:18:50 +0000 (09:18 -0500)]
Rx: Do not drop call lock in rx_WriteProc* and rx_ReadProc*
rx_WriteProc and rx_ReadProc has special fast logic that
handles the most frequent case. This code was called
without obtaining the call lock. However, each of these functions
must obtain the call lock for the queue_IsNotEmpty() test and
must re-obtain the call lock if the rxi_XXX variant is required.
Dropping the lock and re-obtaining it is more expensive than
holding it across the memcpy. Therefore, we shouldn't drop the
lock until we are done.
Marc Dionne [Thu, 14 Jan 2010 23:56:49 +0000 (18:56 -0500)]
src/pam warning fixes
The second parameter to pam_conv() should be a const pointer on
recent systems. Make it so to eliminate a couple of warnings.
A configure test is added to deal with some systems where pam_conv()
might not be const.
Cast a few assignments to cell_ptr in afs_auth.c and afs_setcred.c
since the argv parameter is const.
Dan Hyde [Wed, 13 Jan 2010 19:38:47 +0000 (14:38 -0500)]
volmonitor keep vtrans lock
VolMonitor must maintain the VTRANS lock the whole time it is walking
the allTrans list. Failure to do so can cause core dumps trying to
access memory that has already been free'd.
Two versions of this change were coded and tested. The other version
used the VTRANS lock only around a THOLD, but needed a TRELE, too.
Timing tests were run counting the number of vos status, vos listvol,
and vos backupsys operations that could be performed during a fixed
number of vos status operations. The THOLD/TRELE version caused other
vos operations to run about 5% slower.
Simon Wilkinson [Tue, 17 Nov 2009 20:46:17 +0000 (20:46 +0000)]
Kernel is always defined
When we build the kernel module, either in the real or the ukernel
case, KERNEL is defined. So, remove the #ifdefs around our locking
primitives, so that things are a little bit clearer.
afsd: decprecate -mem_alloc_sleep flag (and related code)
On most platforms, afs_osi_Alloc_NoSleep() is already afs_osi_Alloc().
I have tested this on Solaris (the major exception) and haven't seen
any problems.
Andrew Deason [Mon, 11 Jan 2010 19:36:32 +0000 (13:36 -0600)]
Always check VInitVolumePackage2 return code
Some programs were not checking the return code of VInitVolumePackage2.
Although some programs do not care so much if we fail to properly init
the volume package (SYNC debug tools), at the very least log/print an
error, so it doesn't silently fail.
Other programs are changed to exit when VInitVolumePackage2 fail, so
e.g. salvages don't accidentally cause corruption on 'logging'-mounted
UFS partitions.
In any case, ensure the return code is always checked anywhere it is
called.
Simon Wilkinson [Sat, 19 Dec 2009 23:58:54 +0000 (23:58 +0000)]
Linux: Rework PAG to group conversions
The change to using a single group for PAGs on Linux led to a load
of special cases throughout the code. This patch moves the OS
dependent parts of this into the LINUX/ platform directory, and
rearranges that file so that there is a clear distinction between
the one and two group sections of the code.
Jeffrey Altman [Mon, 11 Jan 2010 19:21:11 +0000 (14:21 -0500)]
Windows: Protect buffers in smb_WriteData from simultaneous writes
smb_WriteData does not properly use CM_SCACHESYNC_WRITE to
protect buffers from simultaneous writes. Instead of simply
testing CM_SCACHESYNC_WRITE at the top of the while loop,
the flag must remain set until the entire write completes.
cm_SyncOp is now called once and cm_SyncOpDone is only called
upon final success or error.
In addition, as 'count' is unsigned, the test for count < 0
is replaced with count != 0.
Jeffrey Altman [Mon, 11 Jan 2010 18:51:42 +0000 (13:51 -0500)]
Windows: buf_Recycle should clean up flags and reset version
The CM_BUF_EOF and CM_BUF_ERROR buffer flags and the
buffer dataVersion should be reset within buf_Recycle()
instead of by the caller of buf_Recycle().
Jeffrey Altman [Sat, 9 Jan 2010 05:26:37 +0000 (00:26 -0500)]
Windows: do not leak scp->dirlock if cm_BPlusDirBuildTree fails
In cm_BeginDirOp, the scp->dirlock would be leaked if
cm_BPlusDirBuildTree() failed. This would either result in
a panic later on if lock order validation is active; or as
an inability to process subsequent requests on the directory.
Simon Wilkinson [Sun, 22 Nov 2009 23:31:00 +0000 (23:31 +0000)]
Use dget_parent to handle getting inode of parent
We can't safely do dp->d_parent->d_inode to access the parent inode
of a given dentry. Instead, use dget_parent() to get safely get a
reference on the parent dcache, and access the inode using that
reference. Dispose of this reference with dput() as appropriate.
Matt Benjamin [Tue, 5 Jan 2010 02:31:27 +0000 (21:31 -0500)]
freebsd: CM changes targeting RELENG_8
Force all vnodes onto the fs mount queue when allocated. This fixes
a long-standing vnode recycling problem. Don't call vgone() on a vnode
whose refcount is 0. Always destroy vnodes in VOP_RECLAIM. This is work
in progress towards fixing old reclaim bug mentioned in Rees comment.
Hold vnode returned from gop_lookupname_user in afs_pioctl_syscall,
to avoid it going inactive before we're finished. Also unlock it if
necessary. Don't use custom vop_lock impl when AFS_FBSD80_ENV. Remove
duplicate conditional code in vnode pretty-print (old cruft). Also don't
format fid members as hex. Revert vn_lock exclusve in osi_VM_StoreAllSegments
(fixes deadlock introduced by me in a 2009 changeset). Remove unused
variables in osi_VM_StoreAllSegments.
Andrew Deason [Thu, 17 Dec 2009 19:59:57 +0000 (13:59 -0600)]
DAFS: avoid saving fileserver state when panicing
When ShutDownAndCore is called with dopanic=1, avoid trying to save
fileserver state. When we are panic'ing it is very possible that the
thread that called ShutDownAndCore is one of the background threads we
are waiting for, or that the calling thread is holding H_LOCK. Since we
are panicing, the fileserver state is probably not consistent anyway, so
just avoid trying to save state altogether, and avoid a possible
deadlock.
Andrew Deason [Fri, 6 Nov 2009 20:05:16 +0000 (14:05 -0600)]
DAFS: Allow non-fileserver to schedule salvages
Allow non-fileserver programs to schedule salvages through the fileserver
via FSSYNC (VOL_FORCE_ERROR with the FSYNC_SALVAGE reason code). Also
make the volserver schedule salvages this way when it encounters the
appropriate errors.
FIXES 124484
Change-Id: I03ecf6302436c35fec705cd6c84a40b7cdbf6f97
Reviewed-on: http://gerrit.openafs.org/787 Reviewed-by: Andrew Deason <adeason@sinenomine.net> Tested-by: Andrew Deason <adeason@sinenomine.net> Reviewed-by: Derrick Brashear <shadow@dementia.org>
Remove the conditionals in the linux 2.6 tree for GFP_NOFS. This feature
has existed since the beginning of the 2.6 tree. This makes the code
easier to read.
tidy up the osi_module and osi_misc prototyping, and the error checking
and returns at module load time. side effect: also use the afs3_syscall
prototype for the BSDs.
Dan Hyde [Wed, 6 Jan 2010 15:49:39 +0000 (10:49 -0500)]
volmonitor copy link before calling free
Copy tt->next before TRELE(tt) calls free(tt).
We have a core file from a VTRANS_OBJ_LOCK(tt) assert failure, with tt
pointing into glibc's malloc data structures.
Change-Id: Id52b774520c59c224b58f5d507cc490dafea5ca1
Reviewed-on: http://gerrit.openafs.org/1069 Reviewed-by: Andrew Deason <adeason@sinenomine.net> Tested-by: Andrew Deason <adeason@sinenomine.net> Reviewed-by: Thomas L. Kula <tkula@umich.edu> Reviewed-by: Michael Meffie <mmeffie@sinenomine.net> Reviewed-by: Dan Hyde <drh@umich.edu> Reviewed-by: Derrick Brashear <shadow@dementia.org>
Simon Wilkinson [Wed, 6 Jan 2010 15:12:32 +0000 (15:12 +0000)]
Linux: Use the correct ATIME flag
Since Linux kernel 2.4.0, MS_NOATIME has been a super block flag,
and S_NOATIME has been the corresponding inode flag. Use the
correct flag when we're opening cache files.
Russ Allbery [Wed, 6 Jan 2010 01:03:32 +0000 (17:03 -0800)]
Add README.source and a script to do a Git-aware merge of upstream
* Add README.source explaining maintenance procedures and a
debian/import-upstream script to do a Git-aware merge of a new
upstream release that will allow us to cherry-pick upstream patches
and do proper merges.
Note that I'm not planning on re-importing the upstream 1.4.11 release
using this new method, so this technique will not be effective in the
master branch until upstream releases 1.4.12.
Russ Allbery [Tue, 1 Dec 2009 00:32:37 +0000 (16:32 -0800)]
Correctly state what symbols openafs-dbg contains
* Fix the openafs-dbg dependencies and package description to reflect
its inclusion of debugging symbols for all server binaries in
openafs-fileserver and openafs-dbserver, but not the legacy PAM
modules.
(cherry picked from commit 10ae3a2d4915ddcd1aa6e0082df578bba64ea31b)
Russ Allbery [Tue, 1 Dec 2009 00:14:28 +0000 (16:14 -0800)]
Force source package format 1.0
* In anticipation of a change in dpkg-source's defaults, force source
package format 1.0. The package is maintained using Git and
generating a proper quilt series is complex and relatively pointless
work, so the additional complexity of the 3.0 format is currently not
that useful.
Russ Allbery [Tue, 1 Dec 2009 00:06:36 +0000 (16:06 -0800)]
Fix configure flags used for debugging and optimization
* Fix configure flags used for enabling or disabling LWP and kernel
debugging flags and always pass --disable-strip-binaries. Hopefully
fixes the empty debugging symbols on Ubuntu. (LP: #370612)
Russ Allbery [Mon, 30 Nov 2009 23:15:59 +0000 (15:15 -0800)]
Do not attempt a DKMS build if the headers aren't available
* Do not attempt to build the kernel module with DKMS if the appropriate
Linux headers aren't installed. Based on code from the common DKMS
postinst script (which we'll just use once it's reliably available).
Thanks, Anders Kaseorg. (LP: #487535)
Russ Allbery [Wed, 4 Nov 2009 05:44:55 +0000 (21:44 -0800)]
Remove the openafs module from DKMS if necessary before adding
* In the postinst of openafs-modules-dkms, if the openafs module is
already added in DKMS, try to remove it first before adding it. This
should more correctly handle the case of a user installing this
package without the correct kernel headers, having it fail in
postinst, and then installing the correct headers and having dpkg
attempt to configure the package again. Thanks, Philipp Kaluza.
(Closes: #553542)
(cherry picked from commit c07b0b751d7e768a50f3594e13c8221a304bb455)
Russ Allbery [Thu, 1 Oct 2009 01:05:09 +0000 (18:05 -0700)]
Also change the source package name in the module changelog file
* When changing the name of the source package built by
openafs-modules-source, we need to change the package name in the
changelog as well or dpkg-gencontrol explodes. Thanks, Aaron M.
Ucko. (Closes: #549140)
this is a dodge; we should sign with a real certificate and distribute
signed binaries. until we more formally exist, this allows application
firewall to at least cope better with us.
Andrew Deason [Fri, 18 Dec 2009 18:17:41 +0000 (12:17 -0600)]
Refuse to attach inode partitions with UFS logging
Partitions with the 'logging' UFS mount option are known to cause
corruption when using the inode fileserver backend. So, if we detect
that we are attempting to attach a 'logging' partition, refuse to attach
it.
Marc Dionne [Tue, 5 Jan 2010 00:37:40 +0000 (19:37 -0500)]
Linux: don't oops on writeback if vcache has no stashed credentials
When doing writeback, use current credentials if we can't find
stashed credentials in the vcache entry.
This is normally stashed in afs_open, so it's not clear how we
get to that point, but that's not a reason to trigger an oops.
Michael Meffie [Tue, 29 Dec 2009 18:40:15 +0000 (13:40 -0500)]
viced: allow alternate addresses on the same hash chain again
Revert the logic meant to prevent duplicate entries in the
host address hash table so hosts with multiple addresses can
be stored in the same hash bucket again.
Add a new log message to show when the host cannot be stored
in the hash table because of an address-port pair collision
with a host already in the hash table.
Jeffrey Altman [Wed, 30 Dec 2009 11:32:58 +0000 (11:32 +0000)]
Unix CM: Use xdr_free to free memory allocated by XDR
In src/afs/afs_volume.c VL_GetAddrsU() returns memory allocated by the
xdr package. In 1.4 there was no method of freeing this safely. On the
head there is using the xdr_free() function.
Marc Dionne [Thu, 31 Dec 2009 16:08:32 +0000 (11:08 -0500)]
Build fix: restore centry in ptutils.c
The declaration of centry is needed when supergroups are not
enabled. Restore it within the ifdef so that we don't get
an unused variable warning if supergroups are enabled.
Russ Allbery [Thu, 31 Dec 2009 00:22:37 +0000 (16:22 -0800)]
Remove warnings from supergroups code on x86
Prototype functions where necessary, remove unused variables, fix
mismatches of data types (char * != void *), initialize variables the
compiler can't tell are initialized, compare integers against 0 and
not NULL, and wrap assignments used as conditions in an explicit
comparison.
This removes all warnings that fail --enable-checking on x86 with
--enable-supergroups. 64-bit will still have warnings.
Matt Benjamin [Wed, 23 Dec 2009 00:48:02 +0000 (19:48 -0500)]
freebsd: track RELENG_8
Fixes to re-enable build and load of kernel module on FreeBSD's
RELENG_8. Includes the following changes:
Remove cred pointer argument to vop_getattr and vop_setattr.
Restore VSUID and VGUID defines, but move to osi_machdep.h.
Fixup calls to vinvalbuf, create a macro to avoid too many ifdefs.
Revert incorrect definition of gop_lookupname_user. Avoid
uninitialized use of 'code' variable in vop_access, and track
new a_accmode member name. Remove cred pointer in VFS_STATFS.
Avoid including sys/ioctl.h in kernel mode (formerly had no
effect, it's now an error). Avoid using an empty file as an
object file in shlibafsrpc link. Replace suser() calls with calls
to priv_check, using defined OpenAFS privileges (thanks due to
Ben Kaduk).
Simon Wilkinson [Sun, 27 Dec 2009 11:06:01 +0000 (11:06 +0000)]
Abstract out Linux sillyrename function
In order to keep the dcache happy, the Linux client has its own
sillyrename function. Abstract this out from afs_linux_unlink into a
function of its own (afs_linux_sillyrename) so we can make use of it
from other vnodeops.
Simon Wilkinson [Thu, 24 Dec 2009 18:19:01 +0000 (18:19 +0000)]
Remove HAVE_STRUCT_BUF test
Ever since b1edf891d717ee8e08c0d93738a204cff09cf68f was committed,
we've not needed to test to see if the OS provides struct buf - we
can just declare it as a structure without providing a definition
in all circumstances.
Simon Wilkinson [Thu, 24 Dec 2009 15:14:46 +0000 (15:14 +0000)]
Remove --disable-afsdb
Remove the --disable-afsdb option from configure, and the
corresponding AFS_AFSDB_ENV #ifdefs from the code. This means that
the AFSDB code will always be built, but whether it used or not
can still be controlled by runtime options in the cache manager.
Andrew Deason [Wed, 30 Dec 2009 16:44:39 +0000 (11:44 -0500)]
Make DAFS 'bos salvage' work in restricted mode
bosserver currently has code to specifically allow 'bos
salvage'-initiated salvages to run when in restricted mode. This only
specifically tests for running salvager, though, and so fails when 'bos
salvage' is run against a DAFS fileserver and tries to run
'salvageserver -client' instead.
Test for 'salvageserver -client' as well, so we can run 'bos salvage'
for DAFS fileservers in restricted mode.