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>
Add some parentheses around the tests for FCSBypass.
Without them, the test will not always give the intended result.
Change-Id: I94cb2b2c95c702981fce9cff066b620bce652ee1
Reviewed-on: http://gerrit.openafs.org/2324
Reviewed-by: Matt Benjamin <matt@linuxbox.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
Cast the printf argument to int to match the format specifier.
Change-Id: I4300c8a407c99c40e116a6e166a76112fb92d254
Reviewed-on: http://gerrit.openafs.org/2323
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
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).
Change-Id: Ib3a63e56e6b902b4eb5deb769847e7f17ce2c9ff
Reviewed-on: http://gerrit.openafs.org/2215
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
Log in FileLog (or VolserLog, or the log of any program that requests
salvages) when we request a demand-salvage to occur.
Change-Id: I2444480287a1647c2d3e25039467167e28e17f38
Reviewed-on: http://gerrit.openafs.org/2284
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Tom Keiser <tkeiser@sinenomine.net>
Tested-by: Derrick Brashear <shadow@dementia.org>
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>
The destroyMe conditional does not depend on the result of
VShouldCheckInUse(), so move it outside of that block.
Change-Id: Ieb4c97ae9f76b4369680629f18eecd1dfc06682f
Reviewed-on: http://gerrit.openafs.org/2276
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Tom Keiser <tkeiser@sinenomine.net>
Tested-by: Derrick Brashear <shadow@dementia.org>
avoid growing a volume index too large. handle errors other than just by
dropping a core
Change-Id: Id1bf7a1a40672b6b960cc0d7a1cd54f48ab0b50a
Reviewed-on: http://gerrit.openafs.org/2291
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
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.
Change-Id: I9427427d5dab7d4639822c370bdded0418f67d9e
Reviewed-on: http://gerrit.openafs.org/2243
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
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>
Fix two minor warnings in afs_pioctl.c:
- gcc complains that threshold may get used uninitialized. the
warning looks bogus, but initialize it to keep gcc happy.
- PSetCachingBlkSize is declared but never defined.
Change-Id: I3ac84d665f60ba51fef2d52f2bd8d90e0a7bc3b3
Reviewed-on: http://gerrit.openafs.org/2322
Reviewed-by: Matt Benjamin <matt@linuxbox.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
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>
truncate_inode_pages requires the mapping to be protected using
i_mutex / i_sem, which is not held whereever osi_FlushPages is called.
Change-Id: I2ca59cf75633368efb7f6a17fd01c7c517a8f609
Reviewed-on: http://gerrit.openafs.org/2244
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-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.
Change-Id: Ic04b07fffa9668123a9029bb42415a7c701c2339
Reviewed-on: http://gerrit.openafs.org/2317
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
Remove unnecessary warning for the UKERNEL case. This file will
always get compiled with UKERNEL.
Remove an "if 1" ifdef that was probably used while debugging to
make the function non static.
Change-Id: I5ba5bbb4bd2b782c605699028cf3ad2c7e8cd41f
Reviewed-on: http://gerrit.openafs.org/2318
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
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>
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.
Change-Id: Ic826e7888cb400c19857c58cb6ed88b9bdd0dddc
Reviewed-on: http://gerrit.openafs.org/2315
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
Correct the fs manpage to show that 'fs diskfree' shows a header
called 'total' to represent the total disk space, not 'kbytes'.
Change-Id: Id827ec81dcfd79ab28eed3bc392524a378f0069d
Reviewed-on: http://gerrit.openafs.org/2313
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
'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.
Change-Id: Ied81e73e1e84df34e63fdf0c80ad86341bea0cd4
Reviewed-on: http://gerrit.openafs.org/2311
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
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.
FIXES 127554
Change-Id: Ibc880bf51419d51de40b33d8c43122e592971b0b
Reviewed-on: http://gerrit.openafs.org/2306
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
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...
Change-Id: I2ad2b8c5070470beb067efdcda6f76f6b72c006c
Reviewed-on: http://gerrit.openafs.org/2308
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
Commit e59a0ff993 generated a warning
since we try to assign NULL into a character. Just remove this code,
since removing trailing whitespace was already handled by commit
df18c9e895.
Change-Id: I915c0678a2f6893e09cf049bf71c519be554369f
Reviewed-on: http://gerrit.openafs.org/2303
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
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.
Change-Id: I406e264c1f96e1d893b9d12b561f48a3cbfdf57c
Reviewed-on: http://gerrit.openafs.org/2297
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
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).
FIXES 124529
Change-Id: I98e4c872abec5784c6ec600d5d977c36f4a8b0ac
Reviewed-on: http://gerrit.openafs.org/2301
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
Corrects an EOL bug in vlclient and adds a more user-friendly
handling of request for help (i.e., '-help' now works)
FIXES 125036
Change-Id: I70f6523d538e34a02536e482f99916293a195df5
Reviewed-on: http://gerrit.openafs.org/2300
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
Fix VLog() so that it actually uses the loglevels and does not set
all log messages to level 5.
FIXES 125035
Change-Id: Ia9f42a814be182215cedadb6a4837347ace32f41
Reviewed-on: http://gerrit.openafs.org/2299
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
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.
Change-Id: Ia6e93f436f9dcd2d634c46856ede5effbf79e9cb
Reviewed-on: http://gerrit.openafs.org/2296
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
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.
Change-Id: I2450fbaaa51b5baf2781e8a6572065e5f69b44ed
Reviewed-on: http://gerrit.openafs.org/2295
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
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.
Change-Id: Id09ef1e10632c7f63b590271a6339a069176deac
Reviewed-on: http://gerrit.openafs.org/2294
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
I'm about to touch this, and the whitespace was bothering me.
Change the six-space indentations to match the rest of the code.
Change-Id: I35a12c82f8b2b4644e58cf1f19f021282e43dc77
Reviewed-on: http://gerrit.openafs.org/2293
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
The locking around some interfaces has changed with time.
Make our preprocessor checks match the reality of when
the changes were made.
Change-Id: If933dd636bb908af27852897e9c77ed600759674
Reviewed-on: http://gerrit.openafs.org/2292
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
Checkin http://gerrit.openafs.org/#change,2027 appears to have caused
issues with the checked build for vldb_check.
This fixed is by reflecting the structure change into vldb_check
Change-Id: I12343be8a3a31cb2f6474115a8d9137dadd4ae2d
Reviewed-on: http://gerrit.openafs.org/2280
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
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.
Change-Id: I7fa4605e52181d60657ad794ca8efdb5a9fb1449
Reviewed-on: http://gerrit.openafs.org/1824
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Russ Allbery <rra@stanford.edu>
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.
Change-Id: I2e939e98bd72cd7b275b0f7a389607ee5dc94efa
Reviewed-on: http://gerrit.openafs.org/2271
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
afs_osi_proc2cred contained a 2.4 implementation; remove it, since we
can assume at least 2.6.
Change-Id: I605856e920508cf49a975e5375ade87e00598763
Reviewed-on: http://gerrit.openafs.org/2274
Reviewed-by: Marc Dionne <marc.c.dionne@gmail.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
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.
Change-Id: I55ffca5dad99124b9d451925c9fcf15b7060bb9b
Reviewed-on: http://gerrit.openafs.org/2273
Tested-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
The NEED_IOCTL32 symbol needs to protect the entire if block, not just
the conditionals.
Change-Id: Ie33860b1d5677cec19ed19aa1ccc1ce0a26824ff
Reviewed-on: http://gerrit.openafs.org/2270
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
cr_ref is a regular integer, not an atomic_t, so we need to just
assign '1' to it directly.
Change-Id: I3533c79a67f7be35724cc81553d24bfecb7b81d3
Reviewed-on: http://gerrit.openafs.org/2269
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
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.
Change-Id: Ic38f5be27d55da9fdf6ce7889d4df6afd1464c0f
Reviewed-on: http://gerrit.openafs.org/2268
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
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.
Change-Id: Iba14bd28cb43a6ca6401be4252bb45135d8b3a55
Reviewed-on: http://gerrit.openafs.org/2027
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
Turn on the perl use strict and use warnings options in the
make_libafs_tree script to better catch programming bugs.
Change-Id: Ide358d40eda3cde9dd0261af11993560da71143a
Reviewed-on: http://gerrit.openafs.org/2266
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>