Andrew Deason [Tue, 29 Jun 2010 18:19:11 +0000 (13:19 -0500)]
DAFS: Salvage VG on volume creation error
When trying to create a volume (either an entirely new volume or a
clone), request a demand-salvage on that volume group if we hit an
unexpected error. This can allow some situations to automatically
rectify themselves if, for example, a volume is missing its .vol
header, but still otherwise exists and causes an error during a clone.
Andrew Deason [Tue, 29 Jun 2010 19:44:31 +0000 (14:44 -0500)]
DAFS: Allow FSSYNC salvages on unknown volumes
Allow salvage requests over FSSYNC (FORCE_ERROR with the FSYNC_SALVAGE
reason code) that are requested on volumes that we do not know to
exist. This can be helpful if a salvage is requested on a volume that
someone attempted to create but failed, indicating that a
partially-created volume may be in the way.
Log an additional message when we do this, as it should not be a
normal occurrence.
Change-Id: I6e1bbe35111a41c489fe85cad36e6a8a6f323a5a
Reviewed-on: http://gerrit.openafs.org/2285 Reviewed-by: Tom Keiser <tkeiser@sinenomine.net> Reviewed-by: Derrick Brashear <shadow@dementia.org> Tested-by: Derrick Brashear <shadow@dementia.org>
cache-bypass explicitly reference pages involved in background i/o
Formerly, we assumed that any page eligible for background i/o could
be effectively pinned by lock_page. Persuant to concern expressed by
Simon that such pages might be eligible to be released by the kernel
after readpages returns, call get_page to increment the refcount on
each page before dispatching a background read (and matching put_page
when the i/o is completed).
Simon Wilkinson [Tue, 29 Jun 2010 20:45:36 +0000 (21:45 +0100)]
Build: Rework git version detection
Rework the git version detection script to handle some issues that
have been pointed out.
1/ Make it work properly with objdir builds
2/ Don't try to work out if the tree is dirty if git describe failed
3/ Use the configured VERSION as a fallback if we can't obtain proper
version information during a make
Change-Id: I39494e1c18cf4eacbb55386334da7128fbe96310
Reviewed-on: http://gerrit.openafs.org/2283 Reviewed-by: Andrew Deason <adeason@sinenomine.net> Tested-by: Andrew Deason <adeason@sinenomine.net> Reviewed-by: Derrick Brashear <shadow@dementia.org> Tested-by: Derrick Brashear <shadow@dementia.org>
Rainer Toebbicke [Wed, 23 Jun 2010 11:08:47 +0000 (13:08 +0200)]
Do not call afs_FlushVCBs with afs_xvcache held
In afs_AllocCBR, use dynamically created afs_cbr structures
when running out of preformatted ones, rather than calling
afs_FlushVCBs under, potentially, the afs_xvcache lock
(which would be held across the RPC, difficult to drop and
re-acquire under the current hierarchy).
Modest modernization of the number preformatted afs_cbr structures,
rule-of-thumb, not pretending any research.
Marc Dionne [Fri, 2 Jul 2010 13:28:05 +0000 (09:28 -0400)]
Linux: cache bypass: remove warning print before panic
This warning printf has some issues - it prints out pointers as
ints with %d (which causes warnings), and if the intention was
to print the referenced values, they wouldn't be set yet at that
point in the function.
Since the purpose is not clear and it has issues, just remove it.
Change-Id: Ied69c390818f9dff235bdaa31af42996aaa39af3
Reviewed-on: http://gerrit.openafs.org/2325 Reviewed-by: Matt Benjamin <matt@linuxbox.com> Reviewed-by: Derrick Brashear <shadow@dementia.org> Tested-by: Derrick Brashear <shadow@dementia.org>
Marc Dionne [Thu, 1 Jul 2010 20:07:40 +0000 (16:07 -0400)]
Linux: cache bypass: deal with the afs_serverHasNo64Bit case
Deal correctly with the case of a server with no 64-bit fetch
support. In that case, the code needs to fallback to the standard
FetchData call, similar to what happens in afs_fetchstore.c.
Move existing check out of 64-bit-only branch so servers
already known to be non-64-bit and not merely those newly
discovered so execute the non-64-bit FetchData.
Change-Id: I505ce6d88072bc3ee5208863717395a78f8562fa
Reviewed-on: http://gerrit.openafs.org/2319 Reviewed-by: Matt Benjamin <matt@linuxbox.com> Tested-by: Marc Dionne <marc.c.dionne@gmail.com> Reviewed-by: Marc Dionne <marc.c.dionne@gmail.com> Reviewed-by: Derrick Brashear <shadow@dementia.org>
Some variables are only used for AFS_64BIT_CLIENT code, so make
their declaration conditional as well.
Also, initialize 'code' while we're at it. The compiler has a
legitimate complaint that it could be used before it's set,
for instance if we have AFS_64BIT_CLIENT but afs_serverHasNo64Bit
is true.
Simon Wilkinson [Wed, 30 Jun 2010 07:29:28 +0000 (08:29 +0100)]
Linux: Fix pagevec use in cache-bypass
Cache-bypass was still using the old style pagevec manipulation
functions, and so won't build on newer kernels. Update it to use the
same pagevec functions as the generic readpages code.
FIXES 127505
Change-Id: I9d8acaf3165bbdf24068bd9145a2369cd0c87e4d
Reviewed-on: http://gerrit.openafs.org/2298 Reviewed-by: Matt Benjamin <matt@linuxbox.com> Tested-by: Marc Dionne <marc.c.dionne@gmail.com> Reviewed-by: Marc Dionne <marc.c.dionne@gmail.com> Reviewed-by: Derrick Brashear <shadow@dementia.org>
Ben Kaduk [Thu, 1 Jul 2010 16:47:55 +0000 (12:47 -0400)]
FBSD: do not recurse on the afs_xvcache write lock
afs_ShakeLooseVcaches grabs the write lock before calling
osi_TryEvictVCache. The latter calls vgone(l), which sometimes
calls into VOP_CLOSE, which again trys to acquire the write lock,
leading to deadlock. Drop the write lock and reaquire it in
TryEvictVCache as a fix.
While here, set *slept to 1 since we drop the glock.
This churn was enough that the gcc no longer cached the value of
AFSTOV(avc), which gets set to 0 in VOP_RECLAIM, so the subsequent
VOP_UNLOCK dereferenced a null pointer. Cache the vnode pointer
in a local variable for the entire function instead of using
AFSTOV() everywhere.
Andrew Deason [Thu, 1 Jul 2010 16:22:13 +0000 (11:22 -0500)]
fs: Correct human-readable output alignment
'fs lq' output separates its space values by whitespace, but 'fs df'
does not, which was causing the human-readable output for 'fs' to not
be properly aligned with the output headers. Modify HumanPrintSpace to
take up exactly 10 characters (9 for the value, 1 for the exponent),
and have the callers print out an extra space if appropriate.
Derrick Brashear [Wed, 30 Jun 2010 19:35:38 +0000 (15:35 -0400)]
update ticket5 from heimdal
includes updated instructions for updating.
note that gen_glue.c in lib/asn1 has a bug which omits
a needed newline in the "const struct units * asn1_%s_units(void);",
line.
Tom Keiser [Wed, 30 Jun 2010 22:40:20 +0000 (18:40 -0400)]
DAFS: fix VOL_HDR_IN_LRU state bit tracking
For the case where the cached vp->header can be re-used by
GetVolumeHeader(), we have not been re-setting the VOL_HDR_IN_LRU
state bit. Although this has not affected correctness (this
bit is merely used to aid in debugging), we should be resetting
it in all relevant cases...
Ben Kaduk [Wed, 30 Jun 2010 04:40:09 +0000 (00:40 -0400)]
Disable red zones for amd64 FBSD kernel code
The kernel has been compiled with -mno-red-zone since at least
FreeBSD 5.0; when we compile libafs.ko with red zones enabled
and interact with the red-zone-less kernel, we get occasional
stack corruption, which manifests itself in a variety of
unpleasant ways.
The flags we pass to gcc for our module build currently differ
substantially from those used during a kernel build (or modules
built with the kernel); I hope to transition to a module build
process involving bsd.kmod.mk in the relatively near future.
Evan Broder [Wed, 30 Jun 2010 08:52:15 +0000 (09:52 +0100)]
Add human-readable printout to fs df
This patch adds a -human option to fs df, which causes it to printout
all of its values in "human-readable" form (i.e. rounded to roughly
the nearest power of 1024).
Ben Kaduk [Wed, 30 Jun 2010 04:29:41 +0000 (00:29 -0400)]
FBSD: in reclaim, print the failed vnode
If we fail to flush a vnode, in addition to printing a diagnostic
message, also print information about the vnode; fs getfid can
frequently confirm which vnode(s) are problematic, which may be
useful in debugging the failure.
Ben Kaduk [Wed, 30 Jun 2010 04:27:11 +0000 (00:27 -0400)]
Actually invalidate the buffer in FBSD's FlushPages
Chaskiel added a commented-out call to vinvalbuf() in
revision bd707fb7e6 back in 2002; adding in what the
current call should be does not seem to cause any problems
for me.
Ben Kaduk [Wed, 30 Jun 2010 04:21:10 +0000 (00:21 -0400)]
FBSD TryToSmush locking fixup
We need to hold the interlock when we check v_flags, so do so.
TryToSmush is sometimes called with the vnode already locked,
as the current code appears to hold the vnode lock for the
current working directory (which is probably a bug). Check if
the lock is already held (panic if someone else has it!), and
unlock as appropriate when we're done.
Simon Wilkinson [Sat, 26 Jun 2010 18:35:18 +0000 (19:35 +0100)]
Use git describe to determine build version
This patch makes the configure and build system use the output
from 'git describe' to determine the version of the software being
built. This means that all that is necessary to create a new release
is to tag the repository - removing the double sources of version
information.
There are a couple of fallbacks for systems which do not have git
available for builds. Firstly, if a file called '.version' exists
in the top level of the repository, then the version information is
pulled from this file. The intention is that those packaging up
git checkouts for onwards distribution will use
'git describe > .version' before producing their tarballs.
Secondly, if we cannot find any version information then the version
will default to 'UNKNOWN'
This all mirrors the way that many others have integrated git with
automake and friends - although the implementation is independent.
Andrew Deason [Mon, 28 Jun 2010 15:43:55 +0000 (10:43 -0500)]
LINUX24: remove pagecopy and other 2.6-only code
The client background readahead code and 'readpages' implementation
were only written for 2.6 kernels and used 2.6-specific constructs.
Remove them, along with references to the 'pagecopy' code, and some
other 2.6-only cruft in osi_vnodeops.c.
Andrew Deason [Mon, 28 Jun 2010 16:17:50 +0000 (11:17 -0500)]
LINUX24: Remove BDI references
afs_backing_dev_info was still referenced in a couple of places in the
LINUX24 code. Although they are properly ifdef-guarded, these lines
were never getting built, so remove them.
Andrew Deason [Mon, 28 Jun 2010 15:33:38 +0000 (10:33 -0500)]
LINUX24: Remove group_info macros/functions
The LINUX24 code has a macro and a function abstracting
'struct group_info' access. But 'struct group_info' does not exist in
2.4, and nothing calls these, so get rid of them.
Rod Widdowson [Wed, 26 May 2010 15:18:26 +0000 (16:18 +0100)]
Make file offsets in vldb layout unsigned ints
vlserver.h has a few cases where links through the vldb are being
stored as afs_int32s. These are file offsets and should be unsigned.
This commit fixes just these declarations. The code still compiles
(because they are silently cast all over the shop), but it starts
the tidy effort.
Andrew Deason [Fri, 25 Jun 2010 18:52:16 +0000 (13:52 -0500)]
Use unsigned IP addresses in bu*
Use unsigned IP addresss in bubasics, bucoord, and butc code. This
alters the public tcdata.p.h, but stays away from wire RPCs or
variables used directly with those RPCs.
Marc Dionne [Fri, 25 Jun 2010 23:33:51 +0000 (19:33 -0400)]
Linux: remove some 2.6 specific code from 2.4
Remove some code that will never be compiled or used in the
afs/LINUX24 directory.
This includes code depending on AFS_LINUX26_ENV, and on
LINUX_USE_FH which is never set in 2.4 and is going away
soon anyway.
Simon Wilkinson [Sat, 26 Jun 2010 14:55:29 +0000 (15:55 +0100)]
RPM Packaging: All debug kernels are bad
We can't build against any of the recent Fedora debug kernels, because
they have options enabled that make criticial symbols GPL-only. Just
skip all debug kernel variants, rather than having to explicitly list
each new Fedora release as it comes out.
Andrew Deason [Fri, 25 Jun 2010 16:38:37 +0000 (11:38 -0500)]
ptserver: Remove IP_WILDCARDS symbol
ptserver defined the symbol IP_WILDCARDS to enable the use of
wildcarding in machine entries. It is always enabled, so just remove
the symbol and always use the wildcard code.
Andrew Deason [Fri, 25 Jun 2010 14:48:38 +0000 (09:48 -0500)]
rx: Use unsigned addresses
RX sometimes uses afs_int32 to represent IP addresses; make it use
afs_uint32. This alters some structures in rx.h and some prototypes in
rx_prototypes.h.
Andrew Deason [Thu, 24 Jun 2010 15:19:21 +0000 (10:19 -0500)]
volser: Use unsigned addresses and volume IDs
Fix code and header files in src/volser that use afs_int32 for server
IP addresses instead of afs_uint32 (the worst offenders being UV_*
functions). Also fix an instance of afs_int32 being used for a volume
ID, and remove 'struct volser_dest' instead of fixing it, since it is
completely unused.
Simon Wilkinson [Thu, 24 Jun 2010 15:00:22 +0000 (16:00 +0100)]
Linux: Check return code from VerifyVCache in mmap
afs_linux_mmap wasn't doing anything with the return code
from afs_linux_VerifyVCache. Change the code so that it matches
the other callers of afs_linux_VerifyVCache
Andrew Deason [Wed, 23 Jun 2010 22:42:30 +0000 (17:42 -0500)]
Remove stale warning suppressions
butc/dump.c and ubik/beacon.c have had their warnings fixed and their
suppressions removed. Remove the warning suppression for tbutc/dump.c
and tubik/beacon.c, as well.
Jeffrey Altman [Wed, 23 Jun 2010 16:56:17 +0000 (12:56 -0400)]
Windows: Cleanup of src/config/NTMakefile
src/config/NTMakefile had the following issues:
* duplicate entries for headers in $(INCFILES)
* no clean: rule for $(INCFILES)
* no clean: rule for $(DESTDIR)\util_cr.exe
* $(INCTOOLS) dependent upon $(INCFILES) but the order is reversed
in the install: rule
Change-Id: I2707009d60b303ab897ed25d9245d893fa342a8e
Reviewed-on: http://gerrit.openafs.org/2238 Reviewed-by: Jeffrey Altman <jaltman@openafs.org> Tested-by: Jeffrey Altman <jaltman@openafs.org> Reviewed-by: Matt Benjamin <matt@linuxbox.com> Tested-by: Matt Benjamin <matt@linuxbox.com>
Matt Benjamin [Wed, 23 Jun 2010 14:26:12 +0000 (10:26 -0400)]
windows don't include assert.h (and afs support headers) in util_cr.c
Don't include afsconfig.h and afs/param.h in util_cr.c, nor
assert.h. The assert was included but was in fact not used in
the file, and can be ommitted, per jaltman. The OpenAFS
includes are then not needed. An incorrect cast is also changed,
due to jaltman.
Ben Kaduk [Fri, 18 Jun 2010 04:05:14 +0000 (00:05 -0400)]
Try to flush vnodes in FBSD's unmount, bailing if necessary
vflush() actually returns something! Check if we get EBUSY,
and don't continue if so. Also, actually call vflush on FBSD80_ENV.
Note that we currently leak refs on our root vnode, so this means
umount will fail unless it uses -f, for now.
Rainer Toebbicke [Mon, 21 Jun 2010 10:02:46 +0000 (12:02 +0200)]
Don't hold on to the afs_xvcache lock while creating a symlink
Holding the afs_xvcache lock over the RPC while creating a symlink is a
severe blow to performance as look-ups from other tasks likely
require the lock. Drop the lock and rely solely on the fileserver
to detect a clash with a same entry created simultaneously.
Andrew Deason [Wed, 23 Jun 2010 15:13:39 +0000 (10:13 -0500)]
vldb_check: Interpret VLOP_* vlentry flags
The flags for each vldb entry can have various VLOP_* bits set to show
that the entry is locked, and for what reason. In vldb_check, output
these bits symbolically instead of mentioning them in "errorflags".
Do not corrupt volume linktable when special file already exists
Upon volume creation, when a special file unexpectedly exists, e.g. due
to a failed cleanup, do not blindly assume that it is the link table.
Otherwise the latter's magic will get silently overwritten.
Andrew Deason [Fri, 27 Nov 2009 22:56:19 +0000 (17:56 -0500)]
Make ubik use unsigned addresses
The ubik code currently treats IPv4 addresses as both signed and
unsigned 32-bit ints. Make some instances use unsigned ints to make ubik
more consistent and squash a couple of warnings.
Note that this slightly alters the signatures of the public ubik
functions ubeacon_InitServerListByInfo, ubeacon_InitServerList,
ubik_ServerInitByInfo, ubik_ServerInit, ubik_ParseClientList, and
ubik_ParseServerList, to use unsigned addresses.
Andrew Deason [Mon, 17 May 2010 20:44:50 +0000 (15:44 -0500)]
Mention that -fakestat fakes local cellular mounts
The afsd man page says that -fakestat only fakes stat information for
cross-cell mount points. Technically it fakes stat information for all
cellular mount points, local or foreign. Most people shouldn't care,
but note the difference, since some places do have local cellular
mount points.
Davor Ocelic [Sun, 20 Jun 2010 13:38:14 +0000 (15:38 +0200)]
Provide manpage for fssync-debug and most subcmds
This is another patch in the series to provide manpages for
dafs-related commands.
Most (if not all) documentation is coming from source
documentation and DAFS articles/presentations.
The primary motivation behind this is to comply with Debian
guidelines requiring all binaries to have respective manpages.
This patch has been sitting here for months, so it's good time
to finally submit it.
Note that fssync-debug also supports some vcg* commands, for
which I was not able to find any documentation I could use.
So, they are still left to be documented.
Andrew Deason [Fri, 11 Jun 2010 22:40:18 +0000 (17:40 -0500)]
vol: break callbacks when needsCallback is set
The needsCallback vol header field indicates that a volume has been
altered by a non-fileserver program somehow, and that callbacks for
the volume should be broken. So, when we attach a volume that has this
flag set, break callbacks if we can. If we are not the fileserver,
tell the fileserver over FSSYNC to break callbacks if we can.
Derrick Brashear [Sat, 19 Jun 2010 15:26:49 +0000 (11:26 -0400)]
afsd -dynroot-sparse mode for hushed cells
if an admin specifies -dynroot-sparse (instead of dynroot) come up
with just local cell and cell aliases showing. cell list
is configured as normal. fs newcell works as normal.
Andrew Deason [Fri, 11 Jun 2010 22:39:32 +0000 (17:39 -0500)]
salvaged: Break volume callbacks on vol change
The salvager code can change a volume in many ways as it fixes errors.
We should break callbacks on the volume whenever we change it, as
clients may have callbacks on whatever we changed. So, for the
salvageserver, send an FSSYNC command to the fileserver to tell it to
break callbacks for that volume.
Ben Kaduk [Sun, 20 Jun 2010 22:54:26 +0000 (18:54 -0400)]
Simplify preprocessor logic in afs_pioctl
We had identical code in two branches of an if/elif/else path.
Merge them together.
This allows two DARWIN80_ENV blocks to be coalesced; reindent
them correctly while we're here.
Andrew Deason [Mon, 21 Jun 2010 22:28:10 +0000 (17:28 -0500)]
vldb_check: ntohs ubik header size
The 'size' field in the ubik header is only 16-bits wide. So, we must
use ntohs to convert it, not ntohl. Without this, vldb_check would
emit false-positive "Ubik header size is 0" warnings.
Andrew Deason [Mon, 21 Jun 2010 20:47:06 +0000 (15:47 -0500)]
ubik: Do not hide ReplayLog errors
For some reason, the ReplayLog code was printing encountered errors in
the replay log as debug messages. Print them out as regular log
messages instead, since these are errors that at least warrant
visibility, if not more action.
Andrew Deason [Fri, 18 Jun 2010 22:20:22 +0000 (17:20 -0500)]
ubik: ntohl on reading the replay log
When attempting to read the replay log, ubik was not ntohl'ing all
integers that were read in from the log, causing the log to appear
invalid on little-endian systems. Fix it.
This problem manifests as apparent corruption in the database on top
of ubik when a commit is occurring when we are shut down, or a disk
error is encountered during a commit.