Claudio Bisegni [Mon, 3 Aug 2009 17:05:46 +0000 (19:05 +0200)]
Removed user perspectivev3 file in xcode project and update the gitconfig
gitconfig in src/platform/DARWIN/AFSPreference has been modified to ignore the perspectivev3 that is created by xcode for window layout.Has been also delete the file created for the user
Claudio Bisegni [Mon, 3 Aug 2009 14:40:05 +0000 (16:40 +0200)]
Cleaned most warning OSX OpenAFS preference and completed the AFSBackgrounder implementation
At startup the preference pane check for the presence in ~/Library/LaunchAgents of the file it.infn.lnf.network.AFSBackgrounder.plist that. The agent could be started in OpenAFS preference pane view.
AFSBackgrounder has replaced the NSMenuExtra, when it doesn't quit well launchd restart it. AFSBackgrounder can be used also for other work, for now, at login it check the user preference for get token.
Has been made some refactoring in code for remove most warning.
The unused think are been delete from project.
Start coding OSX Backgrounder Application, for OpenAFS Preference Pane, that user NSStatusItem
To prevent future compatibility with osx we must use NSStatusItem instead NSMenuExtra that is not documented api.
For this has been created a background only application that will manage all function managed by current NSMenuExtra
Adam Megacz [Mon, 27 Jul 2009 03:32:07 +0000 (20:32 -0700)]
In rxi_SendPacket[List], down hosts if ENETUNREACH or equivalent
This patch causes rxi_SendPacket[List] to "down" a host if
rxi_Sendmsg() returns -ENETUNREACH (or equivalent). Previous behavior
only did this check if defined(KERNEL) becauase non-defined(KERNEL)
implementations did not return meaningful error codes from
rxi_Sendmsg().
Jeff Altman <jaltman@openafs.org> supplied the logic for the
AFS_NT40_ENV case; I was not able to test this (I do not own a
Windows license) and took him on his word.
Reviewed-on: http://gerrit.openafs.org/59 Reviewed-by: Adam Megacz <megacz@gmail.com> Tested-by: Adam Megacz <megacz@gmail.com> Reviewed-by: Derrick Brashear <shadow@dementia.org> Tested-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit 1ddc7fa920213f9b5455e632bbddf05b866af647)
Change-Id: I1c5bdf8f3216f82f32fcf22f1c47a3a43130e071
Reviewed-on: http://gerrit.openafs.org/945
Adam Megacz [Sun, 19 Jul 2009 18:00:41 +0000 (11:00 -0700)]
Use -errno or WSAGetLastError() as return value from rxi_Sendmsg()
This patch causes the pthread and lwp implementations of rxi_Sendmsg()
to use -errno or WSAGetLastError() as the return value if it is
positive. This is required in order to communicate more meaningful
error conditions to rxi_SendPacket[List], which should "down" a host
immediately when it observes ENETUNREACH.
Jeff Altman <jaltman@openafs.org> supplied the logic for the
AFS_NT40_ENV case; I was not able to test this (I do not own a
Windows license) and took him on his word.
Reviewed-on: http://gerrit.openafs.org/58 Tested-by: Derrick Brashear <shadow@dementia.org> Reviewed-by: Adam Megacz <megacz@gmail.com> Tested-by: Adam Megacz <megacz@gmail.com> Reviewed-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit 119c756d96c4a7f9e01e4ff6bb20156f1abf761b)
Change-Id: I31f97e4cef4b32abb69c783d19b1adfd897889fa
Reviewed-on: http://gerrit.openafs.org/943
Running bos -noauth should not require client CellServDB configuration
When setting up a new cell, the admin is instructed to use "bos -noauth"
to configure the servers and only afterwards create the client configuration.
This leads to a catch-22 since currently bos -noauth fails if there is no
client configuration even though it is not required.
This change avoids the call to afsconf_Open() which is only required
if tokens are being acquired.
This patch completes the implementation of an install time prompeter
for information about the local AFS cell, which is then used to populate
the ThisCell file. It removes the need for manual editing of
configuration files as part of the installation.
(Build system modified by Simon Wilkinson from Toby's original patch)
the function rx_ReadProc32 (src/rx/rx_rdwr.c) checks the pointer
call->currentPacket before the function rxi_FreePacket is called. This
test was missing in the function rx_ReadProc.
Michael Meffie [Wed, 15 Jul 2009 16:46:56 +0000 (12:46 -0400)]
Fix assert message to avoid printing garbage
Fix an off by one error in assert() to avoid printing garbage
characters to the log. Remove the newline character generated by
ctime() to match the format generated by the other logging functions.
Search for the Linux version in the correct header
src/config/linux-version already had support for handling either versioned
or unversioned kernel source directories, but the grep for UTS_RELEASE
was unconditionally done against the versioned source tree, ignoring the
previous determination of where the header file was.
Instead, check instead the header file location that we'd previously
determined.
This patch has been tested in the Debian OpenAFS 1.4.11~pre3+dfsg-1
package.
if the socket buffer size specified by the configuration is too large
to be applied, do not drop down immediately to 32766 bytes. Instead
try increasingly smaller values trying to find the largest one that
works. use the same value for the send buf size as well.
(cherry picked from commit 5b0e23567e1ed64f448bb3253ad90d39cad31271)
not ready for release, but, add a tool which installer can run to ask for a cell
name
AUTHOR
LICENSE IPL10
====================
This delta was composed from multiple commits as part of the CVS->Git migration.
The checkin message with each commit was inconsistent.
The following are the additional commit messages.
====================
LICENSE IPL10
Jeffrey Altman [Thu, 19 Nov 2009 23:11:06 +0000 (18:11 -0500)]
viced: set volume sync data in bulk status rpcs
The bulkstatus and inlinebulkstatus rpcs have a bug
that prevents the volume sync data from being set.
Currently the data is being set within the for loop
only when i == nfiles. The conditional of the loop
is i < nfiles so the SetVolumeSync call is never
performed. This patch changes the test for performing
SetVolumeSync to i == 0.
lightly modified from what Bren Mills submitted; the second unlock call after mfail may be entirely useless.
(cherry picked from commit b87935a4c5f26357e29f1db46eff8b1cf9185f3b)
Andrew Deason [Mon, 26 Oct 2009 19:09:41 +0000 (14:09 -0500)]
Correct duplicate special inodes while salvaging
Right now when the salvager encounters duplicate special inodes for a
volume, it refuses to salvage the volume, presumably because it does not
know which inodes to use when recreating the volume header.
However, this can cause the confusing state where the fileserver and
various volume utilities have no problem with a volume, but the salvager
refuses to salvage it and marks the volume as needing salvage. When
salvaging, if we already have a volume header, and we encounter
duplicate special inodes, it is likely that the special inode referenced
by the volume header is the correct one.
So, instead of erroring out, keep track of which inodes are referenced
in the volume header, and if there are any duplicates, either ignore or
delete the unreferenced ones, depending on the -orphans setting. Also be
a little more verbose when logging errors in this area.
Reviewed-on: http://gerrit.openafs.org/736 Tested-by: Andrew Deason <adeason@sinenomine.net> Reviewed-by: Alistair Ferguson <alistair.ferguson@mac.com> Reviewed-by: Steve Simmons <scs@umich.edu> Reviewed-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit d393aabca577917b107afdd42efb40cc2fdac50c)
This patch changes the common error reporting type from CE_PANIC
to CE_WARN and adds appropriate cleanup processing so that we do not
leak resources if an error occurs.
Rainer Toebbicke [Fri, 27 Nov 2009 14:03:25 +0000 (15:03 +0100)]
Avoid IHandle leak when failing to attach volume
When a volume fails to attach, ensure it's volume handles
get released before all traces of it are erased. Failure to do so
might cause problems once the volume is salvaged and re-attached.
VReleaseVolumeHandles_r is moved to FreeVolume and no longer called separately.
Jeffrey Altman [Fri, 23 Oct 2009 14:54:35 +0000 (09:54 -0500)]
Check for (hostFlags & HOSTDELETED) after h_Lock_r
Many callers of h_Lock_r do not check if the HOSTDELETED flag is set,
even though it could have been set while waiting for the host lock. Add
checks for it everywhere we call h_Lock_r and we care if the host has
been deleted.
Dan Hyde [Thu, 29 Oct 2009 16:07:47 +0000 (12:07 -0400)]
Add array bounds checking in h_Enumerate
When hostList is not properly NULL-terminated, the current code does
not protect from buffer overflow. The following patch prevents buffer
overflow, prints a message, and asserts.
On our Linux hosts, we never reached the original assert, as there is
a problem handling the segfault the buffer overflow causes.
FIXES 125506
Reviewed-on: http://gerrit.openafs.org/757 Reviewed-by: Dan Hyde <drh@umich.edu> Reviewed-by: Derrick Brashear <shadow@dementia.org> Tested-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit 93d48b1735b88b3051357307bdbebf5da9872d69)
Michael Meffie [Wed, 18 Nov 2009 15:07:14 +0000 (10:07 -0500)]
volser transaction object race conditions
Fix the transaction object races between VolMonitor and the
volume operation procedures which can cause the volume
server to crash.
Add a per transaction object mutex to safely set the
transaction call pointer and name. Fix VolMonitor to safely
traverse the transaction list and to access the call pointer
and last proc name while copying info to send to the vos
client. Fix the sleep thread to safely access the last proc
name.
FIXES 125479
Change-Id: I6dffa31a84d98249712dd17aad353f99151b4fd5
Reviewed-on: http://gerrit.openafs.org/619 Reviewed-by: Alistair Ferguson <alistair.ferguson@mac.com> Reviewed-by: Tom Keiser <tkeiser@sinenomine.net> Reviewed-by: Andrew Deason <adeason@sinenomine.net> Tested-by: Andrew Deason <adeason@sinenomine.net> Reviewed-by: Derrick Brashear <shadow@dementia.org>
Andrew Deason [Wed, 11 Nov 2009 17:23:49 +0000 (11:23 -0600)]
Make ktc_curpag also detect ONEGROUP PAG gids
ktc_curpag falls back to looking at the group list if the VIOC_GETPAG
pioctl fails. If we're in AFS_LINUX26_ONEGROUP_ENV in the kernel,
though, ktc_curpag still looks for two groups, instead of the one
combined group. Add a check for the big one group in the fallback if
we're on LINUX26.
Reviewed-on: http://gerrit.openafs.org/815 Tested-by: Andrew Deason <adeason@sinenomine.net> Reviewed-by: Marc Dionne <marc.c.dionne@gmail.com> Reviewed-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit c53abbb3e8d14643f3f82999cbe24fb12d358ce0)
Andrew Deason [Wed, 11 Nov 2009 16:51:19 +0000 (10:51 -0600)]
Do not check *aoutSize in PGetPAG
*aoutSize is always zero in pioctls, since afs_HandlePioctl handles
checking the output buffer size, and sets outSize to 0 before calling
the pioctl. So, PGetPAG was always returning E2BIG; remove the check to
make it work.
Marc Dionne [Sat, 31 Oct 2009 12:54:52 +0000 (08:54 -0400)]
Fix memory allocation warnings at shutdown
At shutdown we check for unfreed memory allocated with AllocSmallSpace
and AllocLargeSpace and complain in the syslog if there are dangling
pieces. This patch takes care of a few cases that always showed up
as warnings, even after a simple start-stop of the client.
- The cacheInode file needs to be closed before the checks, since it
uses a large piece for its struct file.
- The ICL logging code allocates 6 small pieces that are never freed.
Add a shutdown_icl() function that releases everything. While we're
at it, correct one place where we allocated with afs_osi_Alloc but
freed with osi_FreeSmallSpace, confusing our accounting.
Marc Dionne [Sat, 31 Oct 2009 17:27:18 +0000 (13:27 -0400)]
Linux: Fix write_begin configure test for recent RHEL kernels
Recent RHEL kernels now define simple_write_begin, which was used as
a test for the write_begin address_space op. This makes the test
succeed when it shouldn't, and breaks the build.
Rewrite the test to actually check the address_space operation.
Always use kbuild for all Linux kernel configure probes
Some Linux kernel probes for the existence of header files were done
with file existence checks (test -f). This breaks if the kernel build
system is stacking multiple directories of headers together with
compile-time -I include path options, as is the case for the current
Debian Linux header packages. Instead, always use kbuild to check
whether a kernel header is available.
Similarly, use AC_TRY_KBUILD instead of AC_TRY_COMPILE when checking
for an SELinux kernel, since AC_TRY_COMPILE doesn't call into kbuild
and won't get the correct kernel header paths.
This is part of the fix for Debian Bug#521745 and has been included in
the Debian package since 1.4.10+dfsg1-1.
Marc Dionne [Wed, 28 Oct 2009 21:54:32 +0000 (17:54 -0400)]
Linux - Fix disk cache access for selinux/AppArmor constrained processes
Preserve the credentials used for cache initialisation and use then
whenever disk cache files are opened. This takes advantage of the
credentials separation work from David Howells available in kernels
2.6.29 and above.
Access to cache files was done under the security context of the
user process, causing processes constrained by selinux or AppArmor to
fail to access AFS cache files and causing the cache manager to panic.
Besides the RT tickets, should also fix the following Ubuntu bugs:
415766 429260 457779 459299
The current kernel module build infrastructure relies on the ability to
create symlinks from known directory names used in the AFS code to the
actual locations of the kernel header files. This breaks if there is no
single kernel header tree and instead multiple trees are layered together
by kbuild using compile-time -I include paths.
Attempt to detect this case by seeing if linux/types.h is in the kernel
header directory where we expect it. If not, rather than creating
symlinks for h, sys, and netinet, create directories and populate them
with single-line headers that just include the corresponding linux/*.h
header. The list of headers for which to do this is generated dynamically
by analyzing the AFS kernel source code and looking for relevant #include
directives.
This patch has been part of the Debian OpenAFS package since
1.4.10+dfsg1-1. The check for whether we have layered kernel header trees
may be specific to Debian and may require modification later if other
Linux distributions do something similar.
Simon Wilkinson [Wed, 28 Oct 2009 11:12:18 +0000 (11:12 +0000)]
Make afsd.pod reflect reality
9d396c4916fdac64fcface30e6637ca6e2911203 (from 2005) introduced
autotuning for afsd, and changed some of the defaults which aren't
autotuned. Update the afsd man page to reflect the autotuning, and
the new defaults.
Andrew Deason [Wed, 28 Oct 2009 16:06:47 +0000 (11:06 -0500)]
Avoid using released hosts
Since h_Release_r has the possibility of freeing a host, we should not
be using a host after it has been released. A few places can still use a
released host, potentially causing heap corruption, double frees, and
generally weird behavior.
So either move calls of h_Release_r until after we finish using a host,
or make sure to set the pointer to NULL after it has been released.
Reviewed-on: http://gerrit.openafs.org/747 Tested-by: Andrew Deason <adeason@sinenomine.net> Reviewed-by: Dan Hyde <drh@umich.edu> Reviewed-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit 416e2f11c35f5d55f91090b30b4db1a9bf6d6e07)
Andrew Deason [Mon, 26 Oct 2009 19:04:48 +0000 (14:04 -0500)]
Dec old special inodes in inode convertROtoRW
The convertROtoRW code for the inode fileserver makes copies of the
volume's special inodes, but leaves the old (RO) inodes around. If the
RO is created again, this will result in duplicate special inodes for
the same volume, which freaks out the salvager (and possibly other
things).
So IH_DEC the old RO special inodes after converting, so they go away.
Reviewed-on: http://gerrit.openafs.org/735 Tested-by: Andrew Deason <adeason@sinenomine.net> Tested-by: Derrick Brashear <shadow@dementia.org> Reviewed-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit dbe3b7b8eeb4a010f82248befc6167b3b5ed9606)
Marc Dionne [Sun, 1 Nov 2009 21:03:17 +0000 (16:03 -0500)]
Linux: Avoid deadlock in readdir - release GLOCK for filldir
The GLOCK is held while calling the filldir function in afs_linux_readdir().
If this function causes a page fault, and in particular if this fault
involves AFS, we're in trouble as we'll eventually deadlock in the
readpage code.
A simple test case for this is to call the getdents syscall on an
AFS directory with a buffer that is part of an mmaped AFS file.
This is already the case in the master branch; the change was part of
the merge of the NFS translator code.
FIXES 125555
Change-Id: I829838e45f94921d22335154587216f7842e3955
Reviewed-on: http://gerrit.openafs.org/760 Tested-by: Marc Dionne <marc.c.dionne@gmail.com> Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk> Reviewed-by: Derrick Brashear <shadow@dementia.org>
Marc Dionne [Thu, 17 Sep 2009 20:57:52 +0000 (16:57 -0400)]
Linux: 2.6.32 - Adapt to writeback changes
Adapt to the writeback changes in kernel 2.6.32
- Since we define our own backing_dev, it needs to be registered with
the writeback code and attached to the super_block. Otherwise it
might get ignored when writeback is needed.
- Each backing_dev now gets its own kernel thread. The name of the
thread is based on the registered name - the openafs one will appear
as "flush-afs".
Andrew Deason [Thu, 22 Oct 2009 16:12:30 +0000 (11:12 -0500)]
Avoid prematurely destroying callback_rxcon
Currently, h_GetHost_r and removeAddress_r can destroy the
callback_rxcon of a host. Having a NULL callback_rxcon can cause
segfaults in code that does not properly check if a host has been
HOSTDELETED before trying to use it.
Although such code is incorrect and should be fixed, we can still avoid
a segfault in those situations by not destroying callback_rxcon until we
destroy the host itself. This just prevents destroying callback_rxcon in
h_GetHost_r and removeAddress_r, leaving it to h_TossStuff_r to destroy
when it destroys the host.
Andrew Deason [Tue, 20 Oct 2009 17:43:42 +0000 (12:43 -0500)]
HPUX: Do not sigwait on critical signals
On HPUX, it is possible for 'critical' signals such as SEGV, ABRT, etc
to be delivered to the softsig thread when we sigwait(). The current
code marks these as 'fatal' and just exit(0)s when they are received,
preventing us from getting cores in the case of a SEGV, ABRT, etc.
To work around this and keep behavior on other platforms the same, just
do not wait on 'critical' signals on HPUX in the softsig thread.
Reviewed-on: http://gerrit.openafs.org/693 Tested-by: Andrew Deason <adeason@sinenomine.net> Reviewed-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit bf9c51a4e13b3e621b99866e9be53c8fe35a39fe)
Reviewed-on: http://gerrit.openafs.org/702
Andrew Deason [Thu, 24 Sep 2009 17:02:55 +0000 (12:02 -0500)]
Use f_bsize for ZFS afs_fsfragsize
On ZFS, the disk space files can use up can be rounded up to the next
recordsize boundary if they've been truncated. This can cause the Unix CM
to mis-estimate cache usage, since it truncates files fairly often, and
assumes the disk space used is the file length rounded up to the next
f_frsize.
Since the ZFS recordsize is available via the statvfs f_bsize, just
round up to that instead. There is still some additional file metadata
that takes up some additional space on disk, but according to ZFS people
I've spoken to about this, it cannot be known in advance. In practice,
the additional metadata storage doesn't appear to exceed about 10% of
the data storage, which should be acceptable.
Andrew Deason [Tue, 13 Oct 2009 16:20:51 +0000 (11:20 -0500)]
Remove extra arguments to afs_syscall_call
Someone appears to have mistaken afs_syscall_call for
afs_syscall_pioctl, and passed rvp and CRED to afs_syscall_call on
solaris (afs_syscall_call always takes 6 arguments; afs_syscall_pioctl
takes various arguments depending on the platform). After b1ff4a0b1115f5739c0365cc963189b1f931971f, this breaks the client build
on AFS_SUN5_ENV, but only because it added prototypes for
afs_syscall_call; it looks like it's always been wrong, but it was never
noticed.
Andrew Deason [Wed, 7 Oct 2009 17:14:11 +0000 (12:14 -0500)]
Make namei convertROtoRW'd volumes usable
Right now, if you convertROtoRW a volume on namei, the converted volume
appears to need a salvage before it is usable, and the header of the old
(now empty) RO volume is kept around. Fix this:
-- Set inUse = 0 on the converted volume, so the fileserver will be
able to attach the volume when we give it back
-- Unlink the RO header file, instead of trying to unlink the
VI_VOLINFO file twice
-- Log the actual error code (errno) in the error message for the last
unlink
Andrew Deason [Mon, 21 Sep 2009 21:57:01 +0000 (16:57 -0500)]
Implement _PC_FILESIZEBITS for solaris pathconf
Using recent NFS clients and servers with the translator under Solaris
causes AFS to be queried for the _PC_FILESIZEBITS pathconf value. Right
now we don't implement it and return EINVAL, causing at least some
modern NFS clients to be unable to mount AFS via the translator on at
least some modern NFS servers.
So, return _PC_FILESIZEBITS as either 32 or 64, depending on whether we
are a 64-bit client or not.
Russ Allbery [Sat, 22 Aug 2009 01:37:41 +0000 (18:37 -0700)]
Add automatic sysname detection for ARM Linux
Add arm*-linux* to the case statement that attempts to automatically
determine the AFS sysname, similar to the other Linux sysname
determination cases.
afs_InitReq fails to initialize the "flags" field of the vrequest structure.
Consequently the logic involving (flags & O_NONBLOCK) in afs_Analyze leads to
unpredictable results. afs_InitReq should initialize the complete vrequest
structure.
Andrew Deason [Thu, 3 Sep 2009 19:43:28 +0000 (14:43 -0500)]
Update accessDate on volume access
Right now accessDate is simply never updated, so the last access time
for a volume is never reported. Simply update the field in
VBumpVolumeUsage_r, so we track the last time the volume was accessed.
Note that this does not increase disk writes to the volume header; the
performance impact is effectively nil.
Andrew Deason [Mon, 20 Jul 2009 17:31:44 +0000 (12:31 -0500)]
Add additional vlprocs safety checks
This adds additional safety checks to the vlserver's implementation of
the VL_CreateEntry, VL_ReplaceEntry, and VL_UpdateEntry RPCs. Now in all
three of these, any new volume ID that would be added to the VLDB or
that would be newly referenced in a VLDB entry is checked against
duplication in other entries. Additionally, any new volume names added
to the VLDB (either by creation, or modifying an existing volume) are
checked against duplication. This should make it impossible for clients
to make a volume ID or volume name correspond to multiple volume groups
(either conceptually or literally in the vldb).
This also alters the vlserver's implementation of the VL_GetNewVolumeId
RPC such that the vlserver increments maxvolid until the range of volume
IDs [*newvolumeid, *newvolumeid+bumpcount) is unused. 'vos' is modified
to only allocate one new volume id at a time, so we don't skip over
potentially-usable vol ids.
Andrew Deason [Mon, 6 Jul 2009 15:29:20 +0000 (10:29 -0500)]
Allow specifying vos create/addsite volume IDs
This adds the -id option to 'vos create', and the -roid option to 'vos
create' and 'vos addsite'. This allows the user to manually specify the
volume IDs that a new RW or RO volume will get (or explicitly specify
that an RO volume ID should be unset), instead of always relying on the
volume IDs retrieved from the vlserver.
Andrew Deason [Tue, 14 Jul 2009 16:29:01 +0000 (11:29 -0500)]
Ignore SIGSYS when issuing pioctl syscall
Ignore SIGSYS when we issue the pioctl syscall, so we don't dump core
when the kernel module hasn't yet been installed on several platforms.
Also, restore the old SIGSYS signal handler afterwards, so we don't
cause any side-effects.
Reviewed-on: http://gerrit.openafs.org/81 Verified-by: Andrew Deason <adeason@sinenomine.net> Verified-by: Derrick Brashear <shadow@dementia.org> Reviewed-by: Russ Allbery <rra@stanford.edu>
(cherry picked from commit 4f36dd089a9c7187f94f77516a486245c057f7f4)
Reviewed-on: http://gerrit.openafs.org/274 Tested-by: Andrew Deason <adeason@sinenomine.net>
ktc_curpag isn't specific to a Kerberos v4 environment, so move it outside
the AFS_KERBEROS_ENV #ifdef. Add it to the auth.h header and to the
exports from the shared libafsauthent.