Calling set_page_writeback and end_page_writeback is necessary to
ensure that the dirty page radix tree and the page dirty flags
tally. The results of end_page_writeback are also used by the
bdi code to prioritise writeback. The Linux kernel
documentation contains further warnings of doom for what may
happen due to not calling them.
Adding set_page_writeback and end_page_writeback also allows us to
unlock the page earlier (the page can be locked any time after the
writeback flag is set). This means that we're not calling the
backing filesystem's ->write function with our pages locked, and
should help reduce contention and the potential for deadlocks there.
Change-Id: I9130b2ad9a09c6b9b16a0f63d7b4a614a93de8d3
Reviewed-on: http://gerrit.openafs.org/819
Reviewed-by: Marc Dionne <marc.c.dionne@gmail.com>
Tested-by: Marc Dionne <marc.c.dionne@gmail.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Recent kernels (2.6.29 and above) have a separate ref-counted
structure for holding credentials. Use it directly instead of
keeping a separate afs specific structure that shadows the same
information.
Also adapt Linux for the change from cr_xxx to afs_cr_xxx wrappers.
Reference counting is done with the appropriate get/put calls.
Change-Id: I1135bb5a66cda51cee4fa9f3f3e63eaa9af28f61
Reviewed-on: http://gerrit.openafs.org/797
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
*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.
Change-Id: Ibed16b35ea14237f44a494add8c7a4a48e0c2b71
Reviewed-on: http://gerrit.openafs.org/814
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
A number of recent changes haven't caught all of the locations where
warning inhibition can be removed. This patch updates all of the
inhibitions to reflect the current state of the tree when built with
gcc4.2
Change-Id: I7bad4fee1258f4e37fd729cda84711fed66acbc9
Reviewed-on: http://gerrit.openafs.org/813
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
Prototype the kalog_Init function in kauth_internal.h, and remove
the warning inhibition from kaserver.c
Change-Id: Ic48d199126629f1c0c2e498081be97901678ec70
Reviewed-on: http://gerrit.openafs.org/812
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
ubik_ServerInit* take a pathname, which should really be a const.
It already is in many of the callers, some of which remove the
const by casting, the others throw errors.
Make pathName const for all of ubik_ServerInitByInfo, ubik_ServerInit
and ubik_ServerInitCommon.
Update all of our callers to remove the now unecessary casting.
Remove the now uneccessary warning inhibition on vlserver/vlserver.c
Change-Id: I009103dc49e4473eec65ebd75aab727915c26f3c
Reviewed-on: http://gerrit.openafs.org/811
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
The call to afsconf_AddKey was using 'akey' rather than 'akey->data'.
As data is the first element of the akey structure, these are actually
identical, but the compiler sees it as a type error. Fix to use the
correct name, and remove the warning inhibition.
Change-Id: Id4775a836276ddd6f5ae105c298dcc3c68b92145
Reviewed-on: http://gerrit.openafs.org/810
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
Publicly prototype UV_Bind in volser_prototypes.h
Make dump.c use the public prototype, instead of an incomplete
private copy, and remove the warning inhibition that was required to
support the private copy.
Change-Id: I945192454702d79083a10062adaf2cb124d14a35
Reviewed-on: http://gerrit.openafs.org/809
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
Since the beginning, we've had M variants of the lock macros, which
are identical to the normal form. Dispose of these variants, to make
it clearer what's going on.
Change-Id: I0b7708ec670ef0edb4c1dc21d472e5041d31f6a2
Reviewed-on: http://gerrit.openafs.org/807
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
If a is declared as an array, then a == &a. However, the compiler
still gives a type warning when usign the & form, as the types no
longer match. 5f720faab9 fixed this
problem for calls to GetExtendedCellInfo - do the same for the
corresponding Set calls.
Change-Id: I8204afe7df0c0db1d059cb3f6ab61eff1cdf9140
Reviewed-on: http://gerrit.openafs.org/808
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
f6ce2af008 added a call to
AFS_SIGSET_CLEAR to vol/volume.c. However, it didn't add signal.h
to this file. As AFS_SIGSET_CLEAR calls sigfillset(), this broke
checked builds.
Add signal.h to the list of headers to fix the build warning.
Change-Id: Ib861abfbd153f6ef2ff4b42ea03b5604a95975d4
Reviewed-on: http://gerrit.openafs.org/806
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
This file generates a warning because the left side of a variable
assignment is commented out. Keep the effect of the line
(incrementing packet) but remove the unused casting and
reference, and remove the comments that date from the original
IBM source.
Leave a new comment in place in case the information is useful.
Adjust the Makefile and README.WARNINGS to account for the change.
Change-Id: I944e1c488e39411d32d700cba2d3ef567eddddb4
Reviewed-on: http://gerrit.openafs.org/804
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Access the vcache callback member after taking
the xvcb lock to avoid the server object from
being freed in FlushServer on another thread.
Eventually, we should have a ref count on
avc->server.
FIXES 125596
Change-Id: I760819b1632d0e8188eaa34531239951aab980d3
Reviewed-on: http://gerrit.openafs.org/800
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
ka_UserAuthenticateGeneral expects an afs_int32 pointer for the
password_expires argument. A (long *) was used in afs_auth.c,
generating a few warnings.
Change-Id: Iafc92e72022644ff23c642e801d51bd4387afa88
Reviewed-on: http://gerrit.openafs.org/803
Reviewed-by: Russ Allbery <rra@stanford.edu>
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Commit eb8e55bba7 introduced a variety
of functions for accessing members of the credentials structure in a
platform independent way. Sadly, cr_gid is already defined by the
Darwin platform headers (on Darwin, the GID is just the first of
the user's groups)
Turn cr_gid() into afs_cr_gid() to avoid this problem, and for
consistency, also rename cr_uid, cr_ruid, cr_rgid, and the
corresponding set_* functions.
Change-Id: I82d74900324d079b5a5c8985510a2c9586c4a526
Reviewed-on: http://gerrit.openafs.org/805
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
correctly process dns lookups corresponding to the srv record changes in
network byte order
Change-Id: Id70f972331582912ca984ae1b1c027c7b702a22c
Reviewed-on: http://gerrit.openafs.org/801
Reviewed-by: Thomas L. Kula <tkula@umich.edu>
Tested-by: Russ Allbery <rra@stanford.edu>
Reviewed-by: Russ Allbery <rra@stanford.edu>
Cache parameters are discussed in two locations in the afsd man page,
and the first copy had not been updated for the new auto-tuning of
the chunk size and the stat parameter. Fix both.
Note that the firewall requirements for klog only apply if you're using
kaserver and klog. Kerberos v5 has its own requirements, but this is not
the place to talk about them.
Change-Id: I9cdaaa71351a64cecc1b6904efba87d4871d42fb
Reviewed-on: http://gerrit.openafs.org/798
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
The disconnected code doesn't request locking from FlushVCBs when
it calls it, but also doesn't hold the required locks itself.
Fix this.
Change-Id: I2450df4b19b2d44dca80990197e5e7637c9c8334
Reviewed-on: http://gerrit.openafs.org/802
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
This patch introduces and makes use of wrappers for access
to credentials structure members:
cr_uid (afs_ucred_t *)
cr_ruid(afs_ucred_t *)
cr_gid (afs_ucred_t *)
cr_rgid(afs_ucred_t *)
cr_group_info(afs_ucred_t *)
Inline functions are also introduced to set values:
set_cr_uid (afs_ucred_t *, uid_t)
set_cr_ruid(afs_ucred_t *, uid_t)
set_cr_gid (afs_ucred_t *, gid_t)
set_cr_rgid(afs_ucred_t *, gid_t)
set_cr_group_info(afs_ucred_t *, struct group_info *)
This will allow an architecture to make use of an alternate
structure to hold credentials. In particular it will allow
the linux client to be modified to use the kernel credentials
structure directly instead of shadowing it into our own local
structure.
There should be no functional change.
Change-Id: I7739196a0691a9c30887043b085e4878e88780ae
Reviewed-on: http://gerrit.openafs.org/768
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
Avoid leaving an unnecessary core file when the fileserver is
shutdown while still attaching volumes. The bosserver issues
SIQUIT to shutdown the fileserver which leaves a core file by
default.
Register the fileserver shutdown signal handler earlier in the
fileserver initialization, before the long running volume
attachment is started. The volume package shutdown has been
changed to allow the VShutdown to gracefully abort the volume
attachment (or pre-attachment for DAFS).
FIXES 124485
Change-Id: Ic22e68afb7bcc54ad956b2ae093375f29b969191
Reviewed-on: http://gerrit.openafs.org/764
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
Add the AFS_ATTRIBUTE_FORMAT macro which can be used to turn on
printf-like format checking for our va-arg log functions.
Enable this checking for volser's Log(), and fix the fallout from
doing so.
Change-Id: Ic5ab93ba731856f1f90e894d711b0f84298ded12
Reviewed-on: http://gerrit.openafs.org/789
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
With commit cfce015ead (in 2006) all
of the files specific to the DUX cache manager were removed.
However, the DUX code within general files remained untouched.
This patch completes the removal of the (entirely non-functional)
DUX client, by removing all cache manager code which is for
AFS_DUX*_ENV and AFS_OSF_ENV platforms.
It also takes the advantage of this removal to simplify some #ifdef
ladders, and indents others (purely because I needed the indentation
to work out what on earth was going on!)
Change-Id: Icbea5ed3ef94c5e902cdb0d722be85f376c3d296
Reviewed-on: http://gerrit.openafs.org/785
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
The tree is inconsistent whether macros for access to vnodes are
provided by the OS directories, or in afs_osi.h. This makes things
very confusing, especially in the Linux case where macros are
provided in afs_osi.h, and then promptly redefined in
LINUX/osi_machdep.h
Adopt a convention where default macros are conditionally provided
by osi_machdep.h. Where these aren't wanted, they should be disabled
in osi_machdep.h, and OS specific versions provided in the individual
OS's directory.
Change-Id: I47bc969af3f6670db9348689b5ce60181fd44f21
Reviewed-on: http://gerrit.openafs.org/784
Tested-by: Marc Dionne <marc.c.dionne@gmail.com>
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
In one error case in afs_linux_lookup unlock_kernel() is called
directly instead of using the conditional "maybe" form.
If the config is such that the BKL is not taken, this can result
in an attempt to unlock when the lock has not been taken, and
can cause an oops.
Change-Id: I27d5db58e9b9d45d925b24e27bc43960499c6ead
Reviewed-on: http://gerrit.openafs.org/790
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
error_table.c is a build product for comerr, should we should
gitignore it
Change-Id: Ie47ae4daec734b31c884e4732d053635ee1048bb
Reviewed-on: http://gerrit.openafs.org/788
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Make the 'Volume X (Y) is now offline' messages appear more sanely in
the log; logging as one line at once.
Change-Id: I8a3cf986fb30e292e509237357bd1039f2f181b9
Reviewed-on: http://gerrit.openafs.org/782
Tested-by: Andrew Deason <adeason@sinenomine.net>
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
When ShakeLooseVCaches is called from afs_Daemon, the xvcache lock
is not held. This means that if the GLOCK is dropped for any reason
(for example, whilst purging the dentry cache), then
ShakeLooseVCaches can be raced, end we can end up attempting to
flush the same vcache twice.
The symptoms of this in Linux are that we oops in clear_inode.
Get the xvcache lock in afs_Daemon(), before calling
ShakeLooseVCaches. Also, remove the conditional GLOCK code from
that function. If we don't have the GLOCK on entry, then we're really
in trouble (and both code paths - afs_Daemon and afs_NewVCache should
get the GLOCK for us, anyway)
FIXES 125589
Change-Id: I3fe5b41a661cd162ec73c51492925ad87c6d4c13
Reviewed-on: http://gerrit.openafs.org/781
Reviewed-by: Marc Dionne <marc.c.dionne@gmail.com>
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Recalculates a volume's disk space used and number of files upon
every clone where it is effortless. Even though tracked mostly
correctly, bugs and accidents leave their traces which only a
salvage would correct.
Change-Id: Ied6fb9eb3944b6e30eac175fe42649c5b7cfaefb
Reviewed-on: http://gerrit.openafs.org/756
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
everything else on osx will look for config in /var/db/openafs; make
fstrace do the same
Change-Id: I7b787435343b15c82cd8eb8f3ed00096d469e888
Reviewed-on: http://gerrit.openafs.org/772
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
the 64 bit pointer massaging was incomplete for kernel
tracing on macos. add in the missing cases.
Change-Id: I38eb608c233819ab437adec25e2cd3afac3e234e
Reviewed-on: http://gerrit.openafs.org/771
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
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
FIXES 92944,125544
Change-Id: Ief8acd65c1a3e4d8c951f80bfd65f8340b8cec34
Reviewed-on: http://gerrit.openafs.org/752
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Russ Allbery <rra@stanford.edu>
Tested-by: Russ Allbery <rra@stanford.edu>
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.
FIXES 125507
Change-Id: Id1430529a1afdb5e2af29d40148877f5e4260a41
Reviewed-on: http://gerrit.openafs.org/716
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
Avoid trying to contact the salvageserver for any reason while we are
shutting down. During shutdown the salvageserver may not be around
anymore, so any SALVSYNC communication will appear to hang.
Just set a global flag to indicate 'no-SALVSYNC' on shutdown, in
addition to the thread-local flag we already have.
Change-Id: Id96f20917fd0753b4934a0377b91032b2ea3d0dc
Reviewed-on: http://gerrit.openafs.org/765
Tested-by: Andrew Deason <adeason@sinenomine.net>
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
In the FSYNC_VOL_OFF handler, fssync-server.c errors out if the call to
VGetVolumeByVp_r fails. However, this can fail if the volume is in an
error state such as SALVAGING. Normally we don't even call GetVolume
when the volume is salvaging, but the volume state can change to
SALVAGING inside GetVolume. This is particularly likely to happen on a
demand salvage, since we switch to the SALVSYNC_REQ state when
scheduling the salvage, and if we are still in that state when the
salvaged child requests a VOL_OFF, we will fail to get the heavyweight
ref.
Fix this in two ways. First, we VWaitExclusiveState_r before examining
states for the short-circuit logic so our view of the volume state is
more accurate. Second, re-examine the volume state after the call to
GetVolume, and perform the same short-circuit logic, since the volume
state may have changed during GetVolume.
Change-Id: I4ebb87691c28170b42e0056b342477a12d0f6888
Reviewed-on: http://gerrit.openafs.org/769
Tested-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
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
Change-Id: Ifce92c593d17050e45add9e37a7a9ed4fbc377ef
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>
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.
Change-Id: Idac9b318ff716b61bf8ca4508d2dbdbfbad5b50d
Reviewed-on: http://gerrit.openafs.org/759
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Tested-by: Marc Dionne <marc.c.dionne@gmail.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
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.
Change-Id: I4c28c848f155dec9d89e6199cde34209227ca5c9
Reviewed-on: http://gerrit.openafs.org/758
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
This field was once used to track allocations in a credentials pool.
That code was removed a few years ago but the field remained.
Change-Id: Ieac642d7d55c4da766a5a3aa8ff790a514b606d6
Reviewed-on: http://gerrit.openafs.org/753
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Reviewed-by: Dan Hyde <drh@umich.edu>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
This patch cleans up the cache bypass code so that it uses a
consistent form of indentation throughout the file.
It also changes the do { } while(0); macros to omit the trailing
semicolon, as macro definitions with trailing semicolons break
normal coding conventions.
Change-Id: Id5161fe4b1ba27110e41ed27e14a2bb3c9cccd4a
Reviewed-on: http://gerrit.openafs.org/754
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
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.
Change-Id: I3d5275c3862003e372d3c19a5462e62bf9cb269e
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>
Our style for function definitions has the name of the function as
the first item on a new line - this means you can find a definition
by using grep ^functionName. Fix the disconnected code to follow this
style.
Change-Id: I925039070f2bbbd97f04fbee006ea08df92d7cf5
Reviewed-on: http://gerrit.openafs.org/751
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
9d396c4916 (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.
Change-Id: Iea2035743cb45cca1c249bc2e838405039ad7d3a
Reviewed-on: http://gerrit.openafs.org/744
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
1206e7538b added linux/errqueue.h to
rx_user.c, but added the include in the middle of a function - which
means that the new structure is out of scope for the rest of the file,
which breaks the build on Linux.
Put the header include at the start with all of its other friends.
Cc: Alf Wachsmann <alfw@slac.stanford.edu>
Change-Id: Id932ff63b59e6cd62eda3df4f01e4eef354736ca
Reviewed-on: http://gerrit.openafs.org/748
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Squash a warning about lt being potentially used uninitialized.
Change-Id: I41bfccfd1a0db925a4d728a217b154f45c28b112
Reviewed-on: http://gerrit.openafs.org/742
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Tested-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
When we're not in AFS_MAXVCOUNT_ENV, make afsd_dynamic_vcaches a
static 0, which allows the removal of a scattering of #ifdef's in
the middle of conditionals in afs_vcache.c, and generally improves
the code browsing experience.
Also, move the externs for this variable to afs.h, where they belong,
and fix related formatting.
Change-Id: I4d56ebae63fe1855ac80f8511b9fc76f7e5a326f
Reviewed-on: http://gerrit.openafs.org/741
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
When iterating across the buffer list, afs_newslot used a hardcoded
maximum time to find the oldest. Instead of using this, just use the
accesstime of the first unused buffer that we find as the oldest, and
continue as normal.
Change-Id: Ifeacb8a407901b46a23fbc838b1fca761108ebbb
Reviewed-on: http://gerrit.openafs.org/738
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
Both dynamic vcaches and rxmaxmtu had been committed as using the
35th command entry. Fix this according to the order they are in
the command list (35 and 36, respectively). Tidy up the command list
so it's easier to read, and remove the #ifdef notdef entry from it,
as adding it back in would just cause chaos.
Change-Id: I3fce403aa0ab01c42f0e1a48ae401503b0e21c24
Reviewed-on: http://gerrit.openafs.org/740
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Back in 2002, 0eb68f307a was committed
to fix locking problems in dir/buffer.c.
Sadly, similar changes were never made to afs/afs_buffer.c, so the
same problems remain in the cache manager.
The issue here is with two processes racing in afs_newslot. Calls to
afs_newslot protect buffers with a zero reference count using
afs_bufferLock. If we release afs_bufferLock, before we increase the
reference count of the vcache, then we can end up with newslot
picking the same buffer for two different purposes.
The GLOCK actually protects us from the worst of this, but this fix
is necessary both for correctness, and for symmetry with the file
server buffer code.
Change-Id: I7f1c7d6571559c5f1784926c39d4889b77677231
Reviewed-on: http://gerrit.openafs.org/737
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
The pininodes option has been commented out of afsd since the
original OpenAFS commit. Enabling it now would cause chaos, due to
the way that cmd orders its arguments. Just remove the sections
of code to avoid this danger.
Change-Id: I9e9944d4470fd21d2ec9e36e17771b499d7c8e0b
Reviewed-on: http://gerrit.openafs.org/739
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>