410 Commits

Author SHA1 Message Date
Andrew Deason
3daf18a3cb viced: VNOVOL on deleted volumes
When the volserver deletes a volume, the fileserver should respond to
future access to that volume with VNOVOL and not VOFFLINE, since the
volume doesn't exist anymore. Do this in DAFS via a new state,
VOL_STATE_DELETED, and in non-DAFS by just setting specialStatus to
VNOVOL.

In the future we should also make sure the vp's for deleted volumes
get freed after a couple of hours, but not yet.

Change-Id: I6dec3e0a5e9e54f6ad09fad9f2355b513cce3bf6
Reviewed-on: http://gerrit.openafs.org/2533
Tested-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2010-08-11 21:26:59 -07:00
Andrew Deason
219ab91243 salvage: update inodes array after CopyAndSalvage
CopyAndSalvage makes a copy of the directory to salvage it. So, the
new directory will have a new inode. Update the array of directory
inodes to reflect this. Without this, we can fail to alter the
copied/salvaged directory later on, since we will try to read/write to
the wrong inode.

Change-Id: I2466981e8ee54c5aecf1a166a37d8146b126de24
Reviewed-on: http://gerrit.openafs.org/2530
Tested-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2010-08-10 21:32:58 -07:00
Andrew Deason
9903f4805e salvage: Remove redundant 'code' declaration
'code' is declared at the top of SalvageVolume; no need to declare it
again in a lower block.

Change-Id: I9b48830c17e5043e6abcda4dd4dd3cc040031d9a
Reviewed-on: http://gerrit.openafs.org/2529
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2010-08-10 21:32:19 -07:00
Andrew Deason
56218cab39 salvage: Do not look at not-found root dir
If we have not found any root directory, don't even look at
'oldrootdir' or 'rootdir', since they will be uninitialized at this
point.

Change-Id: Ia1a7037e06a223a7e1fbc48c0bfadd3b7aaa0e4b
Reviewed-on: http://gerrit.openafs.org/2528
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2010-08-10 21:20:15 -07:00
Andrew Deason
1c002a5b5d salvage: Zero corrupted header
In the salvager, if we read in a corrupt header (either we get a short
read or the magic is mismatched), make sure we zero out the contents,
so we don't read garbage further on.

Change-Id: Ifb4b9fc1b25d5eab470f0950a1d3bb240f75b0d3
Reviewed-on: http://gerrit.openafs.org/2527
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2010-08-10 21:19:33 -07:00
Andrew Deason
cdbf7827ef Eliminate $< outside of pattern rules
The $< variable in makefiles is not portable when used outside of
pattern rules. Replace each usage with the actual name of the file we
want.

Change-Id: Idc9309e7d7bd3b1bd93e8225507b8b53c9433d69
Reviewed-on: http://gerrit.openafs.org/2523
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2010-08-05 21:15:06 -07:00
Andrew Deason
16bad29f03 Fix objdir install/dest targets
Many 'install' and 'dest' targets were referring to source files
without a srcdir prefix. Fix them so we can 'make install' / 'make
dest' with objdir.

Change-Id: Id76c5e326309baf8ec3f1213ecb2e40b19aea7d4
Reviewed-on: http://gerrit.openafs.org/2522
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2010-08-05 21:14:50 -07:00
Derrick Brashear
a4267ef140 namei decodevolume allow low volume ids
the smallest thing which can be encoded is a single character;
also allow it to be decoded, such that low numbered volumes
are treated as valid.

Change-Id: Ia5e694f7f73e1035af741bd23c7f50805910d0c4
Reviewed-on: http://gerrit.openafs.org/2470
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2010-08-05 13:29:35 -07:00
Andrew Deason
56cf5a9f5f Install DAFS and non-DAFS fssync-debug
Install the non-DAFS fssync-debug along with the DAFS dafssync-debug,
since fssync-debug uses some structures that are specific to DAFS or
non-DAFS.

Change-Id: Ib7420857cd32f33fc3cc04f67baa1fcc90abc936
Reviewed-on: http://gerrit.openafs.org/2479
Tested-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2010-07-29 10:38:43 -07:00
Andrew Deason
3a0efeebf6 viced: Correct unblessed attach2 errors
Don't set the vp to NULL; instead just go to the general error
handling code. When a volume is not blessed, we just want it to go
offline, not go into an error state. Furthermore, we must free the
volume header when nUsers is set to 0, so manually do so when we do
not call VRequestSalvage_r.

Change-Id: I3ccd61ac219e092a5c9ee52cd563d007bc20a1a1
Reviewed-on: http://gerrit.openafs.org/2476
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2010-07-29 08:50:02 -07:00
Andrew Deason
ec5f7f0e02 vol-bless: Detach, not put, volumes on completion
vol-bless was just calling VPutVolume when it was done blessing or
unblessing a volume. Instead call VDetachVolume, so we actually give
the volume back to the fileserver when we are done if !nofssync.

Change-Id: Idc1e0c32cf5c1c9d2c130fee4b2f1a5f61ab1c3a
Reviewed-on: http://gerrit.openafs.org/2477
Tested-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2010-07-29 07:31:47 -07:00
Andrew Deason
91eec4d850 salvage: Zero root/readme vnodes before writing
Previously we were writing out the root and readme vnodes with
uninitialized 'lock' structures, when we create a new root dir for
attaching orphans. Just use calloc so we ensure that everything is
zeroed before writing it out.

Change-Id: I3c7712254aaef8731be95ea63530af05438d96a6
Reviewed-on: http://gerrit.openafs.org/2469
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2010-07-22 11:54:12 -07:00
Andrew Deason
a68abf7a4e AFS_INT64_FMT takes a afs_int64, not int64_t
Cast to afs_int64, as int64_t can reduce to a different type than
AFS_INT64_FMT's.

Change-Id: I77ffe8813fbef284e6e91db25804d95d73898b54
Reviewed-on: http://gerrit.openafs.org/2466
Tested-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2010-07-22 10:36:20 -07:00
Andrew Deason
e80bc73142 Remove an outdated inode comment block
This comment is no longer true, and its existence now is just
confusing.

Change-Id: I3954bd82f11c5f48e3e9491a885087067b3d9d34
Reviewed-on: http://gerrit.openafs.org/2458
Tested-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2010-07-21 11:30:59 -07:00
Jeffrey Altman
901423b1e5 Windows: Build Demand Attach File Service
This patchset permits the building of demand attach file server
and volume server.

Change-Id: I7ee81c69924cde5e8aec2067d73b51cba7e4423e
Reviewed-on: http://gerrit.openafs.org/2450
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2010-07-20 09:07:37 -07:00
Derrick Brashear
939382c5c1 vol AttachByName should mimic other volpkg errors
if later callers will deem a volume offline, note it at attach time.
additionally, log the cause.

Change-Id: I4870e8f3bfd8d7e69e448d3a445be81435407f0f
Reviewed-on: http://gerrit.openafs.org/2448
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2010-07-19 22:13:40 -07:00
Simon Wilkinson
52c91be7ca vol: Fix logging functions
Fix the Log, Abort and Quit functions used by the vol package so
that they are all defined in a common header file, rather than
prototyped in each file which uses them.

Use the appropriate macros to flag those functions which never
return, and mark them all as taking printf style input.

Fix all of the callers which had mismatched format strings and
arguments.

Change-Id: I78194f623360e13f055f8f37b3558c08a70acd1f
Reviewed-on: http://gerrit.openafs.org/2444
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2010-07-18 08:12:18 -07:00
Jeffrey Hutzelman
a8b64dba01 Don't overflow a buffer on the server's stack at startup
The servers like to log the command line it was invoked with.
It does this by concatenating its arguments, separated by spaces,
into a 150-character buffer on the stack of main(). That's just
wrong. Use a dynamically-allocated buffer instead.

Change-Id: Ibe398e5f449eec176f11f301090a1b68ef13e94b
Reviewed-on: http://gerrit.openafs.org/2275
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2010-07-14 08:58:28 -07:00
Andrew Deason
eae0fe48b9 Add -unsafe-nosalvage fileserver option
Provide a runtime flag to the DAFS fileserver to allow for
fast-restart-like behavior for DAFS. Call the flag -unsafe-nosalvage, and
document it, warning against its use.

Change-Id: I342c58745b7e2e1d1a2066b4fb08941b02c660f9
Reviewed-on: http://gerrit.openafs.org/2277
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2010-07-13 21:46:10 -07:00
Derrick Brashear
3610ba191f demand attach build always
always build demand attach. includes doubtless-broken
windows support. installs dafileserver, dasalvager, davolserver.
salvageserver keeps its (unique) name.

Change-Id: Ia272dd2b0f72789b9e0f2a7712f9c206bb922095
Reviewed-on: http://gerrit.openafs.org/2403
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2010-07-13 21:22:30 -07:00
Jeffrey Altman
191dbb439d DAFS: variable declarations in C must be a top of block
Two instances of variable declarations not being present
at the top of a code block in src/vol/volume.c when building
with AFS_DEMAND_ATTACH_FS.  Fix them.

Change-Id: Ic6b9c5a6bbbd8355a144fea38a6ca1dd2a2c747d
Reviewed-on: http://gerrit.openafs.org/2388
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
2010-07-13 06:44:42 -07:00
Andrew Deason
2e66c828b1 GetInodeSummary: free inode info
In the salvager, GetInodeSummary stores some information about the
relevant inodes into a file. Free the memory for that information
after it's been written out, since we don't reference that memory
again.

Change-Id: I9578f941d2ea13240dd22d9b6e7a1f32217263c9
Reviewed-on: http://gerrit.openafs.org/2370
Tested-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2010-07-12 11:27:49 -07:00
Andrew Deason
c62466ecab Use afs_sfsize_t for *_SIZE results
Callers of FDH_SIZE and OS_SIZE should be storing the results in an
afs_sfsize_t. Some were using regular 'int's and other things, which
can screw up if the file is sufficiently large.

Change-Id: Ibbc2067ed3b90edcbdd46cfa43da559fd6419f0b
Reviewed-on: http://gerrit.openafs.org/2357
Tested-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2010-07-09 10:08:53 -07:00
Andrew Deason
c72cd42364 Fix VPrintDiskStats_r logging
VPrintDiskStats_r tried to log some information using separate Log()
statements on the same line. This looks very odd when logged, since we
add a timestamp to every Log() call these days. Fix it to print the
line as one call to Log().

Change-Id: I19a5365c24208229201ba54ff04e793b5e50eee5
Reviewed-on: http://gerrit.openafs.org/2359
Tested-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2010-07-07 20:39:56 -07:00
Andrew Deason
4a022e9e59 Fix stray static inline
'static inline' should be 'static_inline'; keep the hp-ux compiler
happy.

Change-Id: Ibfb819571c608b9ca7c1437fde6898b405bccc4c
Reviewed-on: http://gerrit.openafs.org/2340
Tested-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2010-07-06 13:54:44 -07:00
Derrick Brashear
d8cde43ed0 update VAllocVnode logging
move the log message i added to the correct place and put one where
it came from. oops

Change-Id: Ieb78d8cc076dbc2279922b0909546878b9ee005e
Reviewed-on: http://gerrit.openafs.org/2327
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2010-07-02 14:44:21 -07:00
Andrew Deason
6b041b7cb0 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>
2010-07-02 10:33:50 -07:00
Andrew Deason
63304d6b2b DAFS: Log attempted salvage requests
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>
2010-07-02 09:55:15 -07:00
Andrew Deason
a155d71914 vol: Move destroyMe check outside of inUse check
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>
2010-07-02 09:48:00 -07:00
Derrick Brashear
d730f7ceb5 VAllocVnode error handling
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>
2010-07-02 09:44:02 -07:00
Tom Keiser
3330b9d17b 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...

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>
2010-07-01 08:30:49 -07:00
Rainer Toebbicke
e489c44328 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.

Change-Id: Iba05ae771e04272a3dab5534fcfc24cda5ee7df5
Reviewed-on: http://gerrit.openafs.org/1903
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2010-06-23 14:53:02 -07:00
Andrew Deason
52ac633da7 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.

Change-Id: I1b1a4042f0381e8291a407b54ce9478877dacdca
Reviewed-on: http://gerrit.openafs.org/2211
Tested-by: Andrew Deason <adeason@sinenomine.net>
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2010-06-23 10:47:29 -07:00
Andrew Deason
9bb0274398 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.

FIXES 127030

Change-Id: I1cd869371167df7d4e55ac14400865fb0a9c5154
Reviewed-on: http://gerrit.openafs.org/2210
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2010-06-22 08:28:46 -07:00
Andrew Deason
df38462c64 Set VolumeChanged when we create a new root dir
Set the VolumeChanged flag when we create a new root directory in a
volume when salvaging, since doing so changes the volume.

Change-Id: Ic6cd0b0d6f9b52f2006a114269321a38d312ab9b
Reviewed-on: http://gerrit.openafs.org/2212
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2010-06-22 06:46:37 -07:00
Davor Ocelic
5f66bed5eb Update manpage links, fix doc typo in fssync-debug
Change-Id: I93a4fc4c998e489c6bdc736f0f4172c752d9f030
Reviewed-on: http://gerrit.openafs.org/2219
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2010-06-21 06:34:18 -07:00
Andrew Deason
581aafaa69 GetVolume: do not wait for offlining volumes
In non-DAFS GetVolume, previously we waited for a volume with
vp->goingOffline set to go offline before we return. However, the
fileserver afsfileprocs.c case can treat the "going offline" case and
the "is offline" case identically, so there is no reason to wait. So
make the fileserver call a new GetVolume variant that does not wait.

Without this, all of the threads in the fileserver can potentially be
tied up by waiting for a volume to go offline, if the volume is taking
a long time to go offline due to an offline request following a client
slowly accessing the volume.

Change-Id: I58ae11e585852130154389d8df0567432cd0c2df
Reviewed-on: http://gerrit.openafs.org/2124
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Tom Keiser <tkeiser@sinenomine.net>
Tested-by: Derrick Brashear <shadow@dementia.org>
2010-06-15 14:35:54 -07:00
Andrew Deason
7620e48414 Cleanup and doxygen-ify the comments for GetVolume
Change-Id: I54788acd83779b986e78575bde11347952293be6
Reviewed-on: http://gerrit.openafs.org/2123
Reviewed-by: Tom Keiser <tkeiser@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2010-06-14 18:07:22 -07:00
Derrick Brashear
b8177960d4 arm darwin port
make things buildable on arm darwin

Change-Id: I88af2b82e9ed356fd57aa8f05dfee71d7fa6cd8a
Reviewed-on: http://gerrit.openafs.org/2153
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2010-06-13 20:27:48 -07:00
Simon Wilkinson
e35e0b732d vol: open() needs mode if called with O_CREAT
If open() is called with a the O_CREAT flag, then it requires a
3rd argument, containing the mode with which to create the file.
On DARWIN (when we always use O_CREAT), and on other platforms
where the first call to open returned E_NOENT, we weren't doing this,
and so were presumably getting a random mode of whatever garbage was
on the stack.

Caught by clang-analyzer

Change-Id: Ic173e582e0d46f6d4cf8801dc7a6b4b393db5063
Reviewed-on: http://gerrit.openafs.org/2139
Reviewed-by: Russ Allbery <rra@stanford.edu>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2010-06-12 22:40:13 -07:00
Simon Wilkinson
8faceb4ba4 Add AFS_NORETURN macro and use it
Add the AFS_NORETURN macro which can be used with gcc compatible
compilers to indicate that a particular funciton prototype will
not return control to the caller. This both improves code quality,
and helps with static analysis.

Use this to flag afsmon_Exit, db_panic, osi_Panic, Abort, Exit
and the error handlers for osi_Assert and our local assert fn
all as being noreturn.

Change-Id: Ic6c4ae319af3d6f7665c9ee5072b556c01850982
Reviewed-on: http://gerrit.openafs.org/2134
Reviewed-by: Russ Allbery <rra@stanford.edu>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2010-06-12 22:33:34 -07:00
Andrew Deason
dcd3e1fa11 Do not set inUse for non-fileserver non-DAFS
Setting inUse in a volume header to anything besides 1 is a
DAFS-specific change. For non-DAFS, non-fileserver programs do not
touch inUse. Since inUse is not cleared for non-fileserver non-DAFS,
make sure not to set it for non-fileserver non-DAFS.

Change-Id: I4d50299d4dc4fd8757906ba493d182b386dd9b1b
Reviewed-on: http://gerrit.openafs.org/2122
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2010-06-12 12:16:39 -07:00
Andrew Deason
13dba17d5a vol, volser, and viced type fixes
Correct many uses of incorrect types for file offsets, sizes, etc. in
the volume server, fileserver, and the volume package.

Thanks to Tom Keiser who pointed out the incorrect types and suggested
solutions.

Change-Id: If4aedfe0cc06d05b3775069ae1285d4c330976cd
Reviewed-on: http://gerrit.openafs.org/1920
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Russ Allbery <rra@stanford.edu>
2010-05-24 20:56:05 -07:00
Simon Wilkinson
a48a6c2a62 More warnings cleanup
Remove uneccessary warning inhibition in vol/
Update README.WARNINGS to match the current state of the tree

Change-Id: Ic1e5c74e0e7c2ccce0519b1572034f3666aa75e9
Reviewed-on: http://gerrit.openafs.org/1392
Reviewed-by: Marc Dionne <marc.c.dionne@gmail.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2010-05-19 11:22:24 -07:00
Simon Wilkinson
5ea24a7c55 Fileserver: Don't sync every 10 seconds
The patch which moved our calls to fsync into the background, added
a sync prior to each batch of fsync calls. This is an incredibly bad
idea.

POSIX says that sync "shall cause all information in memory that
updates file systems to be scheduled for writing out to all file
systems". On Linux this means that we in effect perform an fsync()
on every open filehandle on the entire system, and in addition flush
all superblocks and journals out to disk. This makes the following
fsync() calls superfluous - sync() will have already written out
all of the data.

Add to this the fact that the fileserver is doing this every 10
seconds, and this becomes a major performance bottleneck,
particularly if the machine uses a journalled fs - as any disk
operations will end up blocking whilst the journal is written to
disk.

Change-Id: Id06cb99ae83af2e4a82e7b20fb14b8457dc16883
Reviewed-on: http://gerrit.openafs.org/1977
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Rainer Toebbicke <rtb@pclella.cern.ch>
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2010-05-18 06:08:30 -07:00
Simon Wilkinson
2736eb7b09 Demand Attach: Volumes and vnodes are different
fssync-debug attempts to copy sizeof(Volume) bytes into an object
defined as a Vnode, a sure fire way to make things go boom.

gcc on Snow Leopard picks this up as a buffer overflow, and warns about
it. Fix the problem by only copying sizeof(Vnode) bytes.

Change-Id: Iadcda0b465f9a9f310dcbe4d3862ea479e052674
Reviewed-on: http://gerrit.openafs.org/1834
Reviewed-by: Tom Keiser <tkeiser@sinenomine.net>
Reviewed-by: Alistair Ferguson <alistair.ferguson@mac.com>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2010-05-17 05:38:15 -07:00
Simon Wilkinson
6fd1db1a86 Demand Attach: Simplify __VVGC_entry_cl_add
The __VVGC_entry_cl_add was giving an uninitialised variable warning
for empty_idx, because it was using a separate variable, empty_found
as a sentinel for when empty_idx was holding a real value. Simplify all
of this by removing the sentinel, and making empty_idx being -1 mean
'not found', and a real value imply found.

Change-Id: I6c485993df1ff8dfd27824234c811af998ff94fa
Reviewed-on: http://gerrit.openafs.org/1833
Reviewed-by: Tom Keiser <tkeiser@sinenomine.net>
Reviewed-by: Alistair Ferguson <alistair.ferguson@mac.com>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2010-05-17 05:37:51 -07:00
Simon Wilkinson
44da0b32ee Demand-Attach: Remove dangerous trailing else
Change 9aa09f5e634db8a8b2dedf3a749f2a90ef206e2f introduced a
dangerous trailing else into the VScheduleSalvage_r function:

 #ifdef A
    if (foo) {
      ...
    } else
 #endif
 #ifdef B
    if (bar) {
      ...
    }
 #endif
    something_else()

In a situation where we have A && !B, then something_else() ends up
only being run when foo is false. Given that something_else() is
VOL_LOCK, this will not end well.

In the real world, we hit this problen when we build the volume
package with SALVSYNC_BUILD_CLIENT and !FSYNC_BUILD_CLIENT - in
other words, whilst building the fileserver.

Change-Id: I97e07a6e730df8ac480d295b4cf30b0695ace511
Reviewed-on: http://gerrit.openafs.org/1832
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2010-05-17 05:37:22 -07:00
Jeffrey Altman
54f66f3722 Fix missing semicolon in non-AFS_NAMEI_ENV builds vol/nuke.c
Change-Id: Ibfd37180199aecf6f79fbc84e2f035678e826d17
Reviewed-on: http://gerrit.openafs.org/1953
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
2010-05-12 07:29:32 -07:00
Derrick Brashear
88d13f1f58 vnode alloc bitnumber returns bitnumber
fix function return types to match a bitnumber (int)
and comment the function appropriately

Change-Id: I9542c02b1aa7aacdd0596675992bb1e8a1708572
Reviewed-on: http://gerrit.openafs.org/1941
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2010-05-11 09:52:27 -07:00