Commit Graph

6588 Commits

Author SHA1 Message Date
Simon Wilkinson
987816dfa8 Linux: Simplify keyring compatibility code
This introduces a few inline functions in osi_compat.h, to reduce the
number of #ifdefs in the main chunk of code. In particular, we gain
  * afs_linux_key_alloc : to handle all the different key_alloc
                          signatures
  * afs_linux_search_keyring : to handle our two different mechanisms
                               for searching a keyring
  * afs_linux_cred_is_current : will return true if we're using native
				credentials, and the passed creds are also
				those of the current task

Change-Id: I138f3533a7e8e88e04e4b5508158e003882d63ee
Reviewed-on: http://gerrit.openafs.org/1005
Reviewed-by: Marc Dionne <marc.c.dionne@gmail.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2009-12-20 10:03:56 -08:00
Simon Wilkinson
cda45cc7a1 Linux: Don't panic when keys aren't found
This fixes two potential problems in our session keyring lookup code,
which can lead to panics in situations where we're using the new struct
cred based code.

The first is that if there is no session kerying installed for the
current task, we'll attempt to do a lookup on a NULL kerying and oops.

The second is that if the keyring_search returns EPERM, then we can end
up unmasking that error code, and return NULL, rather than an error.

Change-Id: If0e2804408ec17b00f352980cee6a8e56704d93f
Reviewed-on: http://gerrit.openafs.org/1004
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>
2009-12-19 08:36:25 -08:00
Simon Wilkinson
994ef0e7ca Linux: Flush vcaches when a mount fails
GetVCache (well, really NewVCache) creates a new vcache, with an attached
inode, and links it into the VLRU queue, regardless of whether it is
successful in populating that vcache or not. The attached inode, on Linux,
contains a reference to the super block of the filesystem. If the created
vcache is for the root, however, and populating that vcache failes, then mount
fails, and the super block is disposed of. This leaves us with a vcache in
the VLRU queue which contains a reference to a non-existent inode.

When ShakeLooseVCaches comes along a few minutes later, it attempts to discard
this inode. However, doing so fails because the inode no longer has a valid
super block.

Avoid this trauma by ensuring all vcaches are disposed of before the super
block goes away, in the event of a mount failure.

Change-Id: I68864f1ea401d24adba76164905a17de6ab3e6ce
Reviewed-on: http://gerrit.openafs.org/1003
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>
2009-12-19 08:35:56 -08:00
Andrew Deason
c7b92a3018 Do not trust FetchData length from fileservers
Currently the Unix CM implicitly trusts that the length from a FetchData
request from a fileserver will always be less than the requested length.
If the fileserver sends more data than requested, we can use up more
cache space than we intended, possibly exceeding the cacheinfo cache
limits.

Add a check for this, and return EIO to the caller if the fileserver
responds with too much data.

Change-Id: I413393a7bacbf207332d7f904cf396c79b77b6b5
Reviewed-on: http://gerrit.openafs.org/996
Tested-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2009-12-18 12:58:11 -08:00
Andrew Deason
244397335e platform target depends on cmd and vol
The 'platform' target depends on cmd and vol, since on solaris
non-namei, we build fs_conv_sol26.c, which depends on some volume
structures, and uses libcmd. So, have Makefile.in accurately reflect
that dependency so we can build.

Change-Id: Ic7038f252dd069522ebfc8e72b9743c01c97d99c
Reviewed-on: http://gerrit.openafs.org/998
Tested-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2009-12-18 12:57:45 -08:00
Derrick Brashear
9faaa2fed8 kernel ioctl32 conversion typecasting
cast types to avoid a pointer from integer warning when using pointer
types for sizing

Change-Id: Idac76608e5352c65a13d07bfadb66d78f9db0ffd
Reviewed-on: http://gerrit.openafs.org/988
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2009-12-17 06:52:38 -08:00
Andrew Deason
3df80a1638 Add the 'vos endtrans' command
Add a command to vos to explicitly end volume transactions. These can
happen if (for example) we segfault or the user ctrl-C's in 'vos'
before/after a volume operation, but before we AFSVolEndTrans.

Change-Id: Ie34ee1fdff917b56900f456c7cf8b1329533a7da
Reviewed-on: http://gerrit.openafs.org/870
Reviewed-by: Dan Hyde <drh@umich.edu>
Reviewed-by: Alistair Ferguson <alistair.ferguson@mac.com>
Tested-by: Alistair Ferguson <alistair.ferguson@mac.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2009-12-16 10:57:07 -08:00
Claudio Bisegni
2a69aa22c1 OpenAFS Preference Pane
Now the preference pane is fat compiled.

Change-Id: I5c54555d00b16d85f01286719bbc41ea5f1fb67d
Reviewed-on: http://gerrit.openafs.org/906
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2009-12-13 08:22:41 -08:00
Andrew Deason
6f439ff7ed Expand ProgramType enumeration
The ProgramType values volumeUtility and salvager are overloaded. Expand
the ProgramType enum to include more specific program types, and adjust
conditionals to match.

Also, instead of determining all behavior by checking programType, add
some flags to be passed in to VInitVolumePackage to determine e.g.
whether or not we can use the FSSYNC channel. This makes it easier to
see the intent of some conditionals, and reduces the number of times a
caller must lie about what program it is.

Change-Id: Ic9852a35bb16a6b1f4b0aa9766de63178ecea56f
Reviewed-on: http://gerrit.openafs.org/786
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2009-12-10 11:49:46 -08:00
Simon Wilkinson
34ffc9cd7d Linux: Use splice to speed up cache storeback
This patch adds a new cache store function for Linux, which uses
splice() and direct access to the page cache, rather than doing
data copies to a temporary buffer between rx and afs. It removes
one copy, and some context switching, from the write codepath.

One side-effect here is that it will delay storebehinds from
returning control to the user. Instead of returning once the first
4k has been successfully transfered, we will wait until a cache
chunk has been transmitted. This is currently unavoidable, as we
can't take the GLOCK within a splice actor.

Change-Id: I5b0284d67febccf099710589908fad18b808332c
Reviewed-on: http://gerrit.openafs.org/903
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2009-12-10 11:45:36 -08:00
Simon Wilkinson
292ec075d2 Rework cache store back
This patch reworks the code to store data from the cache to the server,
such that the entire store loop can be replaced. The idea here is that a
platform which wishes to provide a different store loop, in particular
one which doesn't rely upon multiple data copies, may do so simply by
plugging in a new function.

Change-Id: I6573c6a5c3e93a1259266e7e1a2b7bd17357203f
Reviewed-on: http://gerrit.openafs.org/902
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2009-12-10 11:45:23 -08:00
Marc Dionne
886801b069 Linux: deal with ctl_name removal
The binary sysctl interface will be removed in kernel 2.6.33 and
ctl_name will be dropped from the ctl_table structure.
Make the code that uses ctl_name conditional on a configure test.

Change-Id: Iba0f107f299c6515e4e560d7596e6187bd68e399
Reviewed-on: http://gerrit.openafs.org/904
Tested-by: Marc Dionne <marc.c.dionne@gmail.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2009-12-09 16:49:18 -08:00
Simon Wilkinson
33a87fce6b pt_util runs on database servers
Fix the pt_util manpage to reflect the fact that it is run on database
servers, not fileservers.

Change-Id: If2a8e5b65ef925c50eb9bfebea4e0d30c20f0970
Reviewed-on: http://gerrit.openafs.org/901
Tested-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
2009-12-08 07:25:27 -08:00
Jeffrey Altman
62a21819a1 Windows: cm_BPlusEnumAlloc should not fail for zero entries
If cm_BPlusEnumAlloc returns NULL, the caller assumes a
memory allocation error.  If the enumeration consists of
zero entries, allocate a structure that stores zero entries.

LICENSE MIT

Change-Id: I8ed3811a1b3a0e4262749e110027c5d5812338b6
Reviewed-on: http://gerrit.openafs.org/892
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
2009-12-08 06:34:00 -08:00
Jeffrey Altman
2bffe725c5 Windows: cm_BPlusDirBuildTree can fail
It is possible that cm_BPlusDirBuildTree can fail.  For example,
the server could be marked down after a callback is obtained
but before all of the directory data buffers have been fetched.
cm_BeginDirOp must check for the failure, destroy the tree,
and return the failure code to the caller.  Otherwise, a tree
with no entries may be created and marked with the current
data version.

LICENSE MIT

Change-Id: I26fbfceaf68389a1906797b12721c49172b027ec
Reviewed-on: http://gerrit.openafs.org/893
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
2009-12-08 06:29:40 -08:00
Derrick Brashear
019ae52406 macos avoid dotunderbar lookups in fakestat mode
cocoa tries to lookup ._ files for every object, possibly generating
AFSDB queries and other fun. avoid them

Change-Id: Id70b6335d4dddcb6d5628a9883b2c81193bb39d7
Reviewed-on: http://gerrit.openafs.org/896
Reviewed-by: Rod Widdowson <rdw@steadingsoftware.com>
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2009-12-08 04:34:15 -08:00
Derrick Brashear
61ba8e5a88 add newline to lockprocs_prototypes.h
gcc was unhappy about the lack of trailing newline. add one.

Change-Id: Ie9c93bd9ed8c923ea8069fe49e7f5ddb20c28f80
Reviewed-on: http://gerrit.openafs.org/898
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2009-12-07 12:55:37 -08:00
Andrew Deason
3cb49f57a3 Dump all hostFlags in hosts.dump
Currently only certain flags are dumped in hosts.dump. Also dump the
value of hostFlags itself, so we get more information from a host dump.

Change-Id: I2d265b85e057c2d44938e1d92f4c102048c4bf1f
Reviewed-on: http://gerrit.openafs.org/869
Tested-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Dan Hyde <drh@umich.edu>
Reviewed-by: Alistair Ferguson <alistair.ferguson@mac.com>
Tested-by: Alistair Ferguson <alistair.ferguson@mac.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2009-12-07 10:33:39 -08:00
Andrew Deason
5529bf9b6b Make HandleClientContext take an afs_ucred_t
5d5d180716 missed one occurrence of
AFS_UCRED. Make HandleClientContext take an afs_ucred_t instead of
AFS_UCRED, so afs_pioctl.c builds again.

Change-Id: I04c831ad262cade5da0f90fb8860174657dae4bf
Reviewed-on: http://gerrit.openafs.org/895
Tested-by: Andrew Deason <adeason@sinenomine.net>
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2009-12-06 20:32:04 -08:00
Simon Wilkinson
03b5994d7b Remove AFS_USEBUFFERS
The AFS_USEBUFFERS code has been disabled for all supported platforms
since the initial OpenAFS code drop. Simplify the buffers code by
removing it entirely.

Change-Id: Iab6b2d54361eca1a1446b4804b3d6533d75f2831
Reviewed-on: http://gerrit.openafs.org/894
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Tested-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2009-12-06 20:31:39 -08:00
Derrick Brashear
ae1926fa95 Windows: Version update for 1.5.68
1.5.6800 = 1.5.68

Change-Id: Id3bdc21e5f72ebe2047cb70c2496df2ba7300b4b
Reviewed-on: http://gerrit.openafs.org/891
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2009-12-04 16:55:33 -08:00
Derrick Brashear
adf9baebc8 unix 1.5.68
update version numbers for unix

Change-Id: Ic8a42a9ca1cfc74ab2d8f8d2ac0442efa716a84b
Reviewed-on: http://gerrit.openafs.org/888
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2009-12-04 16:49:56 -08:00
Derrick Brashear
1ad30c2ea8 rx packet dumper not in kernel
don't compile the rx packet dumper when in kernel

Change-Id: I8484f3ed80d3b97d733091901f6e252a455cefa1
Reviewed-on: http://gerrit.openafs.org/889
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2009-12-04 16:49:17 -08:00
Jeffrey Altman
b6b18f1231 Fix midnight volume calculation to build on Windows
Change I516d732d broke the Windows build.  localtime_r does not
exist on Windows.

Change-Id: Ib28e414a85d763dbe146bc2fadec91310f6144ab
Reviewed-on: http://gerrit.openafs.org/887
Tested-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
2009-12-04 11:37:23 -08:00
Jeffrey Altman
f48c0a20a1 Windows: Version update for 1.5.67
1.5.6700.0 == 1.5.67

Change-Id: I0f4402cdb8f387b67c93ee9066dc3be352d163c1
Reviewed-on: http://gerrit.openafs.org/886
Tested-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
2009-12-03 21:47:25 -08:00
Derrick Brashear
ccb64bd3aa unix 1.5.67
make 1.5.67 for unix

Change-Id: I1e25ec581b9b2a37230bd2a889f88f454a73ba8f
Reviewed-on: http://gerrit.openafs.org/885
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2009-12-03 20:47:35 -08:00
Derrick Brashear
a031c900ca add rx packet trace debug dumping for unix
revised version of a patch i've had for months to actually be clean.
allow state of all packets to be dumped so you can see what's on what
queues where.

Change-Id: Ibaa692c835e9ced5e7cd3299922f5bac09344d28
Reviewed-on: http://gerrit.openafs.org/883
Tested-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2009-12-03 20:47:22 -08:00
Rainer Toebbicke
b98ca30c16 Calculate midnight (for volume stats) based on standard functions
The "tz" structure used with gettimeofday is not blessed by common
standards and not widely supported, on Solaris for example it does not
return anything useful.
Calculate midnight based on standard functions (localtime/mktime).

Change-Id: I516d732d4a9dd4696a524a271d806d349c074c25
Reviewed-on: http://gerrit.openafs.org/849
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2009-12-03 13:05:43 -08:00
Jeffrey Altman
96eaa67edb Windows: change notes for 1.5.67 release
Change-Id: I0eedd81fbfee98c591cfd57364bc23392ccca2da
Reviewed-on: http://gerrit.openafs.org/884
Tested-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
2009-12-03 12:55:59 -08:00
Derrick Brashear
e269262100 add unlock support to afscp
make the afscp test client able to drop a lock on a file.
additionally, make it build again.

Change-Id: Ib4a5acf787f8f2e84699e1638a662068b993d965
Reviewed-on: http://gerrit.openafs.org/881
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2009-12-03 10:44:40 -08:00
Jeffrey Altman
b40b60650c Use xdr_alloc and xdr_free within ptuser
If the memory allocation routines for libafsauthent and libafsrpc
differ, callers of the ptuser routines in libafsauthent will crash.
Use xdr_alloc and xdr_free in ptuser to ensure that the memory
allocation routines are always consistent.

LICENSE MIT

Change-Id: I20fa1e1fc0677917e47e2ed9f0eaec83f23b699b
Change-Id: Id31bf20b482e9502a5af79f4d86319fe530aa5a5
Reviewed-on: http://gerrit.openafs.org/319
Tested-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
2009-12-03 08:26:42 -08:00
Michael Meffie
14dbe49786 shutdown_icl return type void
Change the shutdown_icl return type to void
to match the 1.4.x branch.

Change-Id: I641abbd0f87d648c3c9de3cab4d0dd926a51eb89
Reviewed-on: http://gerrit.openafs.org/879
Tested-by: Marc Dionne <marc.c.dionne@gmail.com>
Reviewed-by: Marc Dionne <marc.c.dionne@gmail.com>
Reviewed-by: Russ Allbery <rra@stanford.edu>
2009-11-30 17:27:46 -08:00
Andrew Deason
d393aabca5 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.

Change-Id: I15e34e8f2bccdc666bb59e3730fdf8bf51624259
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>
2009-11-30 09:00:45 -08:00
Marc Dionne
19f0da1e44 Warning fixes - key handling
Various warning fixes related mostly to the different types used
to handle keys.  This should clear most of the remaining warnings
in this area.  The technique of inline converter helpers is
extended to cover a few more cases.

README.WARNINGS is adjusted to reflect the current status.

Fixes:
- bos: define and use an inline converter from a ktc key to a bozo key
- bos.c and bos_utils.c should no longer have warnings - adjust Makefile
- define a ktc key to char * converter and use it in a few places
- define kas key to bozo key ptr converter and use it in a few places (afs_bosAdmin)
- cast a few arguments to ka_StringToKey which expects non-const pointers
Change-Id: I1c19869ac232d78209126d4eeeb11af8bcb95815
Reviewed-on: http://gerrit.openafs.org/860
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2009-11-29 11:52:24 -08:00
Andrew Deason
0188cf081f Add server prefix to utst_int.xg
When compiling src/ubik/utst_int.ss.c, a warning would be produced since
the server stubs are defined as accepting an rx_connection instead of an
rx_call, and since the server and client RPC stubs have the same name.
Give a server prefix so we can distinguish between the two, and fix the
server stubs and squash the warning, similar to
bd011aeee7.

Change-Id: Iebf843bcabb4cf8f4a56c6ac30d210573b58d801
Reviewed-on: http://gerrit.openafs.org/876
Tested-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2009-11-29 07:37:54 -08:00
Andrew Deason
58258ba3b8 Add safety checks on all hostList traversals
Currently, h_Enumerate checks that it doesn't enumerate over more than
hostCount hosts, in case the hostList has a cycle or is otherwise
corrupt. Add similar checks to all places in the code that loop over
hostList, to prevent the code from getting in an infinite loop under
H_LOCK in the case of a hostList cycle.

Also, ShutDownAndCore instead of assert'ing, so we try and detach
volumes first, possibly reducing salvaging time when we restart after
core'ing.

Change-Id: Ide1e5aca7c2c4a4af3f62bc07821db694f2f9999
Reviewed-on: http://gerrit.openafs.org/863
Tested-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Alistair Ferguson <alistair.ferguson@mac.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2009-11-28 09:07:35 -08:00
Andrew Deason
9bff2027cb Add a watchdog timer for ShutDownAndCore(PANIC)
Add a watchdog timer that is started when ShutDownAndCore(PANIC) is
called, to ensure we actually panic and do not e.g. get stuck in
deadlock.

Change-Id: I9201fe7d09aeb6819beefaf1755b51129c7bda6b
Reviewed-on: http://gerrit.openafs.org/873
Tested-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Alistair Ferguson <alistair.ferguson@mac.com>
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2009-11-28 09:06:31 -08:00
Andrew Deason
c4780421a4 Correct include paths in fs_conv_sol26.c
Make the #include paths in fs_conv_sol26.c correspond to the
36524b2ed7 changes, so fs_conv_sol26.c
will build again.

Change-Id: Ic454dae07c0fb324f8550d1281b63fe539f8d525
Reviewed-on: http://gerrit.openafs.org/871
Tested-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2009-11-28 09:03:24 -08:00
Andrew Deason
af9d805128 'Flexible client buffer growth' fallout
e7c966354c re-introduced a usage of the
'M' lock macro variants previously removed by
bab6fd227f. Use the non-'M' macros
instead so we can build.

Change-Id: Ie27fb8e82a7440a6952517d9a0cc1aeb8523511c
Reviewed-on: http://gerrit.openafs.org/872
Tested-by: Andrew Deason <adeason@sinenomine.net>
Tested-by: Marc Dionne <marc.c.dionne@gmail.com>
Reviewed-by: Marc Dionne <marc.c.dionne@gmail.com>
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2009-11-28 08:59:53 -08:00
Jeffrey Altman
3138aaba25 Windows: Fix test for setting FILE_ATTR_READONLY
When checking whether or not to enforce the unix mode
bits as if they were the Windows FILE_ATTR_READONLY flag
the mask 0200 is used.  Make sure that the same mask is
used when publishing the FILE_ATTR_READONLY flag to the
smb client.

LICENSE MIT

Change-Id: Ia68bd17ad80341f1c14f3c0caaec8f09a0a2f3c5
Reviewed-on: http://gerrit.openafs.org/868
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
2009-11-26 12:39:37 -08:00
Rainer Toebbicke
e7c966354c Flexible client buffer growth
Allocates the 2k-directory-buffers for the client as needed, in
small increments, rather than a fixed-length area upon startup.

Change-Id: I6061b71d40284a0059e54377e3b374fee9b86816
Reviewed-on: http://gerrit.openafs.org/799
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2009-11-25 04:18:43 -08:00
Jeffrey Altman
f716962ab4 Windows: disable readonly volume versioning due to file server bug
Change I17e3980184ec68e38c5186e1c9637ac6e38451fe corrects a file
server bug that results in invalid volume sync data being sent
to clients during bulk status rpcs.  Unless this is fixed in the
file servers it is not safe to use the volume versioning functionality.

This patchset disables the functionality by default and permits
it to be turned on via a registry value.  If the client is deployed
in an environment in which all of the file servers have been fixed,
then it will be safe to turn this feature on.

LICENSE MIT

Change-Id: I0db38ffc9cdeb90db20b92adca9a42a06fed2e2f
Reviewed-on: http://gerrit.openafs.org/859
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Rod Widdowson <rdw@steadingsoftware.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
2009-11-24 14:49:18 -08:00
Jeffrey Altman
072d69ac27 Windows: provide enhanced error output to aklog
Add Simon Wilkinson's change from Unix aklog to Windows aklog
If afs_com_err fails to describe the error, allow the krb5
error_message function try.

LICENSE MIT

Change-Id: I47bb6806f1076116a68967617d32d69b98a5bba9
Reviewed-on: http://gerrit.openafs.org/852
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Rod Widdowson <rdw@steadingsoftware.com>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
2009-11-24 14:48:53 -08:00
Jeffrey Altman
c5e362a683 Windows: cm_TryBulkStatus processing changes
move the logging of success or failure in order to
try to avoid the VS8 compiler optimizing them out.

merge the bulk status information if the current
cm_scache_t object is flagged with an access denied
failure on the last request or if it is a readonly
volume.  This permits us to return something valid
to the directory enumeration that generated the
cm_TryBulkStatus call.

LICENSE MIT

Change-Id: I97e9e096e2c36b0a87baaa8d728b588aaf10f153
Reviewed-on: http://gerrit.openafs.org/858
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
2009-11-24 14:48:21 -08:00
Jeffrey Altman
dac8173890 Windows: when assigning a new clientModTime, hold a lock
The smb server modifies the cm_scache_t clientModTime without
holding a write lock creating a race condition.  Fix it.

LICENSE MIT

Change-Id: I6f110f87ef76131965da31a8bf02685480ad9641
Reviewed-on: http://gerrit.openafs.org/857
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
2009-11-24 14:47:29 -08:00
Jeffrey Altman
985a62bcf1 Windows: modify src/rxkad/NTMakefile to avoid file copies
Permit src/rxkad/domestic/* files to be compiled / installed
in place.  This permits the tree to build after the
application of change I0796fabcf83ffcd74e533624c64e138a160dd632.

Change-Id: I5616c7ab9374751dcb44bb2bce37dec40e01148a
Reviewed-on: http://gerrit.openafs.org/854
Tested-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
2009-11-24 14:46:30 -08:00
Jeffrey Altman
13843d8527 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.

LICENSE MIT

Change-Id: I17e3980184ec68e38c5186e1c9637ac6e38451fe
Reviewed-on: http://gerrit.openafs.org/856
Reviewed-by: Dan Hyde <drh@umich.edu>
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2009-11-24 04:20:54 -08:00
Marc Dionne
7b272177de Linux: Keyrings PAG handling changes
We can take advantage of the fact that PagInCred now receives
a kernel credentials structure as an argument (including any session
keyring) to make some improvements in the handling of PAGs
when keyrings are in use.

These changes are effective only if keyrings are in use and we
have a recent enough kernel where we can use the kernel
credentials structure.

1 - Search the session keyring of the passed credentials instead of
the current process' to determine the PAG, if any.  This was always
not really correct, and now we're able to do the right thing.
In some situations such as background writeback and pre-fetching,
this means that we'll now do it with the right credentials, even when
in a PAG.

2 - Don't use groups at all to determine PAG membership.  Doing so
can lead to some inconsistent situations such as the one described
in RT 125198, where a process gets access through a soon to be
deleted PAG.  Make PagInCred look exclusively at the keyrings.
Groups are still updated to try to reflect the current PAG for now,
if the passed credentials belong to the current process.

Note that a process can no longer get a PAG's privileges simply by
adding the corresponding groups to its group list.

No behaviour change for kernels prior to 2.6.29.

FIXES 125198

Change-Id: Ifb171993cc9ca9d6a97fb7312909485ec0666efb
Reviewed-on: http://gerrit.openafs.org/730
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2009-11-22 20:44:41 -08:00
Marc Dionne
51ece42ab4 Remove "unused" warnings from lex generated files
Some (f)lex generated source files produce warnings because of unused
labels or variables.
Since there is limited control of the source itself, just be more
permissive in this particular case with -Wno-unused.

Change-Id: Ice25019f8a592a25f5084e88119b68846d900033
Reviewed-on: http://gerrit.openafs.org/867
Tested-by: Marc Dionne <marc.c.dionne@gmail.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2009-11-22 17:35:38 -08:00
Marc Dionne
85fd4e86af Linux: hinting removal fallout
The removal of the hinting missed a few things - the prototype to
afs_linux_raw_open needs to be changed, as well as a few additional
call sites.

Change-Id: I006540cee574bca7155d9209c2d9b6702c4f6c94
Reviewed-on: http://gerrit.openafs.org/864
Tested-by: Marc Dionne <marc.c.dionne@gmail.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2009-11-22 17:34:01 -08:00