Commit Graph

9537 Commits

Author SHA1 Message Date
Simon Wilkinson
2ba597391d afsd: Fix res_init warning
afsd requires res_init to be declared - get a definition for this by
including roken.h (which has the necessary magic to figure out which
set of headers are required to get resolver functions)

Change-Id: I217405df223f0bc42be90aea991cb228db4da4f0
Reviewed-on: http://gerrit.openafs.org/5373
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
2011-09-08 08:28:20 -07:00
Simon Wilkinson
85d54a064b pam: Fix test_pam on Darwin
Darwin doesn't have a getpassphrase function. Fix the PAM test to
use getpass, in the same way as we do for lots of other platforms.

Change-Id: Ib252174ac1356a8975a9187b252d4fe0246d5d39
Reviewed-on: http://gerrit.openafs.org/5372
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
2011-09-08 08:28:05 -07:00
Simon Wilkinson
1589e29f4e pam: Don't duplicate .c.o rule
Our included configuration has a perfectly fine .c.o rule, so don't
override it in this Makefile, as all that does is produce a warning at
build time

Change-Id: If8d37f50932124ef0adef64ec23d81e646da337a
Reviewed-on: http://gerrit.openafs.org/5371
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
2011-09-08 08:27:41 -07:00
Russ Allbery
ec51fcc2b6 Import new pam-const.m4 from rra-c-util 3.8
Fixes detection of whether the PAM library uses const on FreeBSD and
possibly others.  Report and testing from Julien ÉLIE.

Change-Id: Ice01914f4a00f73e4e473934f4ad907da3a3493f
Reviewed-on: http://gerrit.openafs.org/5376
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
2011-09-08 08:26:54 -07:00
Jeffrey Altman
4ec6fd0030 Windows: add clean rule to src/afs/NTMakefile
Change-Id: I433dee1e3f9e4b5774dc8011690b6c74162772ce
Reviewed-on: http://gerrit.openafs.org/5368
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
2011-09-07 14:27:22 -07:00
Jeffrey Altman
b6e5493437 Windows: correct comments in cm_BkgStore
Change-Id: I1b74db2cc37626dad2e92e86facf7bbaf71d6177
Reviewed-on: http://gerrit.openafs.org/5369
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
2011-09-07 14:27:02 -07:00
chas williams - CONTRACTOR
39b788eeaf ppc64_linux26: build binaries as 64-bit by default
lwp doesnt work since ucontext/setjmp are incomplete when running 32-bit
binaries with the 64-bit kernel.

Change-Id: I9c52d9d934638075fc1693ed94f20665822e5e6e
Reviewed-on: http://gerrit.openafs.org/5365
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
2011-09-07 09:01:48 -07:00
Ben Kaduk
dc077b83c9 Free memory from afs_events
DARWIN and LINUX were already doing this, but everybody else had
a memory leak.  Consolidate most of the common code to do so,
including afs_event_t definitions.

Change-Id: I5ec83cf23fd15dbbd5716995c671998e35862843
Reviewed-on: http://gerrit.openafs.org/5314
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
2011-09-07 07:43:06 -07:00
Simon Wilkinson
327762071b rx/rxkad: Move rxkad initialisation into rxkad
When the RX pthread conversion was done, the initialisation of rxkad
mutexes was incorporated into the rx library itself. This is a layering
violation (it breaks the relatively clean security object abstraction),
and means that you can't actually use RX without the rxkad library.

So, remove all of this initialisation from RX. As security libraries
don't have an explicit initialisation function, we setup our various
mutexes using a pthread_once function called from the NewSecurityObject
functions.

This has the added bonus that it removes the final error in rx.c for
pthread builds, and so another bit of warning suppression can be
removed.

Change-Id: I3cf9b2404a03fb58534c5f41afd77aa5ba5e2256
Reviewed-on: http://gerrit.openafs.org/5361
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
2011-09-06 17:43:53 -07:00
Simon Wilkinson
ca0f1946a2 volser: Don't declare cstruct twice
Both vsprocs.c and vsutils.c declare the global variable 'cstruct'
(which is initialised by vos.c in order to pass a ubik client structure
through to many of the libvolser functions). This double declaration
prevents libvolser from being linked as a shared library on some
platforms. We only need one of these, so just make vsprocs.c declare it,
and vsutils.c refer to it as an extern.

Of course, using a global variable to pass state around is really quite
nasty, but let's fix that in another change.

Change-Id: Ief1667bd7a5b70dbfb49cdc02cc435eb2344527e
Reviewed-on: http://gerrit.openafs.org/5362
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
2011-09-06 17:42:25 -07:00
Rod Widdowson
8a24a7c933 Windows: Replace "%T" as format string to strftime
Checkin I18ed36cc4dce9aa354ad1398710ab7db83c814a2 made strftime
much more widespread.  However the %T format is not available on
all platforms and causes (at least) Windows servers to fail on
first attempt to log.  %T is just shorthand to %H:%M:%S so this
checkin just replaces the one with the other.

Change-Id: Ibfff133d9263f5513276d96f3624801fd8ab229e
Reviewed-on: http://gerrit.openafs.org/5364
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
2011-09-06 13:50:41 -07:00
Jeffrey Altman
37d72aa156 Windows: Freelance vnode,unique pairs
The redirector maintains file object state after the afs
service has shutdown in case it is restarted.  It is critical that
Freelance FIDs not be reused.  Add cm_data.fakeDirVersion into
the mix when generating unique values.

Change-Id: I1cf480d3e0ec6e0b7eadf731a1ef867079c2dc44
Reviewed-on: http://gerrit.openafs.org/5357
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
2011-09-05 23:09:41 -07:00
Jeffrey Altman
796684c024 windows: fix comments, add logging
Change-Id: I383ce8679828f91d013d1f98ea3d25c73a0399df
Reviewed-on: http://gerrit.openafs.org/5356
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
2011-09-05 23:09:28 -07:00
Jeffrey Altman
b6f23864ff Windows: remove CM_BUF_CMBKGFETCH flag
The processing of the CM_BUF_CMBKGFETCH flag adds more
overhead than it prevents.  Get rid of it.

LICENSE MIT

Change-Id: Ic152707fd3f0a7592409a5f570c02488f5503a9c
Reviewed-on: http://gerrit.openafs.org/5359
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
2011-09-05 23:09:14 -07:00
Jeffrey Altman
33af0f92e9 Windows: use lock conversion in cm_EndDirOp
Instead of dropping the lock for read and reacquiring for write
use lock_ConvertRToW() which will make the change atomicly if
it is possible or place the thread into the wait list if not.

LICENSE MIT

Change-Id: I5d134f045a0c935fdaaef6edf5bdf37bb0418a98
Reviewed-on: http://gerrit.openafs.org/5360
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
2011-09-05 23:08:53 -07:00
Derrick Brashear
c3e82ee98b aklog: strlen(NULL) doesn't work
strlen(filepath) when !filepath isnt going to work very well. i believe
this to be the intent of the author of the original patch.

Change-Id: Ib78c5a189b6980223946aff9cf027419127c35bd
Reviewed-on: http://gerrit.openafs.org/5328
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Chas Williams - CONTRACTOR <chas@cmf.nrl.navy.mil>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
2011-09-05 18:21:37 -07:00
Marc Dionne
def00ae8ba Linux: d_delete now takes a const argument
The d_delete dentry operation now takes a const argument.  Test for
this and define our function accordingly to avoid warnings.

Change-Id: I621f54d8e8182b29ccfdf82798773800f5870064
Reviewed-on: http://gerrit.openafs.org/5335
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
2011-09-05 07:04:27 -07:00
Jeffrey Altman
3e3400e422 Windows: tailor smb_MapNTError output for redirector
Separate mappings apply for the afs redirector.  Add a boolean
parameter to the function signature that is set true when the
call requires the redirector mapping.

Change-Id: Ib2892b6c78047f3f1d289e31c4236ea90d8026ab
Reviewed-on: http://gerrit.openafs.org/5351
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
2011-09-05 07:02:44 -07:00
Jeffrey Altman
9b0cb61438 Windows: cm_SymLink export created cm_scache_t
Permit the caller to request the cm_scache_t that represents
the created symlink or mount point object.

Change-Id: Ida8fdc4214844dad009362877f125aa5d20120a1
Reviewed-on: http://gerrit.openafs.org/5355
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
2011-09-05 06:46:24 -07:00
Jeffrey Altman
537592f6bb Windows: correct cm_buf use of Head/Tail queues
The buffer free list least recently used queue has both
head and tail points.  Use the proper versions of the queue
mgmt functions and do not handle edge cases as special cases.

Change-Id: I570682ef1cd6801f1467c4b1af40ae6591a33862
Reviewed-on: http://gerrit.openafs.org/5354
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
2011-09-05 06:45:51 -07:00
Jeffrey Altman
1e23761b7f Windows: remove dead code from cm_scache.c
Change-Id: Ibc5ae641f6bacbe0975f8ffaf0d4cff3e294959a
Reviewed-on: http://gerrit.openafs.org/5353
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
2011-09-05 06:44:56 -07:00
Jeffrey Altman
741e478970 Windows: add cm_Gen8Dot3VolNameW()
Change-Id: Ic514719ee247d60862cc9ff07de16e5de4ffb774
Reviewed-on: http://gerrit.openafs.org/5352
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
2011-09-05 06:44:33 -07:00
Jeffrey Altman
69463ac0cb Windows: add logging to smb_IoctlRead
Change-Id: Ia1c7fc1035eee07de47776e63d6a054ee2809f2f
Reviewed-on: http://gerrit.openafs.org/5350
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
2011-09-05 06:24:47 -07:00
Jeffrey Altman
2588dd1247 Windows: remove potential data loss warning with cast
Change-Id: If9cbe1b777452dba5b0785d8abfccb9ec31540e3
Reviewed-on: http://gerrit.openafs.org/5349
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
2011-09-05 06:24:10 -07:00
Jeffrey Altman
722843e2df windows: pass cm_req_t through background ops
add cm_req_t object to background daemon operations in order to
permit request source to be propagated to the background daemon.

pass a cm_req_t into buf_SetDirty().

Change-Id: I8f805c2860e33df37040ee3785f18358e1a9b762
Reviewed-on: http://gerrit.openafs.org/5348
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
2011-09-05 06:23:39 -07:00
Russ Allbery
1d6593e952 Generate stub header files for h/*.h files included in libuafs
Previously, the libuafs build created a symlink from h to
/usr/include/sys so that files included under h/* by kernel source
files could be found in the normal system header location.  However,
this assumption about the system header location is no longer valid.
Debian and Ubuntu systems with multiarch have arch-specific include
paths so that the same host can be used to build 32-bit and 64-bit
binaries with different system headers, and those include paths are
automatically searched by the compiler.  This means some standard
headers are no longer found directly in /usr/include/sys but are
instead found in /usr/include/<arch>/sys.

Using a stripped-down version of similar code for building the kernel
module on Linux, create an h directory containing stub header files
that just include the relevant system <sys/*.h> header file instead.
This allows the compiler to implement its normal internal header
search algorithm.

Also remove all the other symlinks, such as sys, netinet, etc., that
just pointed to the same directories under /usr/include.  We can assume
the normal compiler search algorithm will find these headers without
requiring this assistance.

Change-Id: Ie19d12e3d3f0068c88d0a9c83f6a96d51baee018
Reviewed-on: http://gerrit.openafs.org/5305
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
2011-09-05 06:06:58 -07:00
Andrew Deason
0f4dfaed6b ihandle: OPEN fdPs are not counted in ihP refcount
Just add a comment explaining that an OPEN FdHandle_t does not count
against the ref count for its parent IHandle_t. Recently I've seen
some confusion about this when discussing ihandle internals, and this
should make this abundantly clear.

Change-Id: I73210e0d05869827ba99d09f504052d1a6797669
Reviewed-on: http://gerrit.openafs.org/5317
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
2011-09-05 06:06:16 -07:00
Simon Wilkinson
b298138bc4 libafs: Fix directory verification
With the earlier directory verification changes, every directory
was seen as corrupt, because the nde pointer was never being initialised

Rework the way that we check for the failure of afs_dir_GetVerifiedBlob
so that we can more robustly detect problems, whilst still allowing
normal directories to be browsed as before

Change-Id: I3d3f428025296956b5feff6ba290aaef79817dcd
Reviewed-on: http://gerrit.openafs.org/5318
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
2011-09-05 06:05:48 -07:00
Marc Dionne
8e97cf6f21 Linux: make sure backing_dev_info is zeroed
The afs backing_dev_info structure is allocated dynamically with
kmalloc, which doesn't zero out the contents.  In particular
there's no guarantee that congested_fn is NULL, causing spurious
oopses when bdi_congested tries to call it.

Change-Id: Ieeed870905627a132a0d1bd2f15cf80443b36303
Reviewed-on: http://gerrit.openafs.org/5334
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
2011-09-05 06:04:19 -07:00
Marc Dionne
cbaefa266d Linux: 3.1: adapt to fsync changes
The fsync file operation gets new arguments to specify a range.
Add a configure test to check for the API change.

The inode lock is also pushed down into the operation, so we need
to take it ourselves to keep the original behaviour.

Change-Id: Icf4e152ce52f2b32c99920f83a5cc3136c05d2cd
Reviewed-on: http://gerrit.openafs.org/5332
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
2011-09-05 06:04:00 -07:00
Jeffrey Altman
2077289765 Windows: correct log message in buf_Sync()
Change-Id: I808e37584a8dda303c037dca82c2230ff884560f
Reviewed-on: http://gerrit.openafs.org/5347
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
2011-09-04 21:37:00 -07:00
Jeffrey Altman
2f9f19085e Windows: restructure cm_ResetACLCache locking
Change-Id: Ic22ba2f54463dd0efa0efa1fff83890eb6d61cc1
Reviewed-on: http://gerrit.openafs.org/5346
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
2011-09-04 21:36:32 -07:00
Jeffrey Altman
0954e0ef9a Windows: add cm_BPlusDirEnumBulkStatOne
cm_BPlusDirEnumBulkStatOne() is similar to cm_BPlusDirEnumBulkStat()
except that it is used to obtain the status info for one FID in
particular via RXAFS_InlineBulkStat, the parent directory FID, and
up to 48 other FIDs in the same directory which do not currently
have a registered callback.

The parent directory is included to prevent the directory FID
callback from expiring when a directory such as /afs/andrew.cmu.edu/usr/
that requires more status objects then exist in the cache are continuously
recycled.

Up to 48 other FIDs are requested since in most cases on Windows
every entry in a directory is required for an enumeration.

Change-Id: Ic53134498ac0e776232a6f9c97cdb26367959546
Reviewed-on: http://gerrit.openafs.org/5345
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
2011-09-04 21:35:57 -07:00
Jeffrey Altman
1a0dd342cc Windows: remove warnings afskfw.c
Sometimes warnings are errors and sometimes they are just warnings.
In this case, the krb5 error message functions were being passed
a krb5_context with the wrong level of indirection which resulted
in an actual error.  Other warnings were due to improper typing
and unnecessary casts.  Fix them all.

Change-Id: Ib2cefe94acca858dda9af92baaae3168c074bb2e
Reviewed-on: http://gerrit.openafs.org/5344
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
2011-09-04 21:35:25 -07:00
Jeffrey Altman
79e3af59f1 Windows: non-persistent cache from pagefile->heap
Change the non-persistent cache mode to use a heap allocated
cache in place of a paging file allocated cache.  With a heap
cache the memory for the cache can be locked into physical memory
so it won't be swapped out when running in virtual machines.
This patch does not apply such memory locking.

Change-Id: I85e6da1bba481d3d9bca84673b918b1d7cde71f9
Reviewed-on: http://gerrit.openafs.org/5343
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
2011-09-04 21:35:00 -07:00
Jeffrey Altman
6aeab6595e Windows: Only mask Delete permission for SMB reqs
For SMB requests the Delete permission is masked if the
readonly attribute is set on the file.  Do not apply this
heuristic to non-SMB requests.

Change-Id: I6617e935cb32796e4a95b4eac0bec9519bd3e937
Reviewed-on: http://gerrit.openafs.org/5342
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
2011-09-04 21:34:35 -07:00
Jeffrey Altman
7dcc476637 Windows: buf_SetDirty do nothing if length is zero
Change-Id: Id6a96feadccc437900e944ab23b45d2717766e1c
Reviewed-on: http://gerrit.openafs.org/5358
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
2011-09-04 09:23:55 -07:00
Jeffrey Altman
abe0e6b7bc Windows: conditionalize cm_Analyze timeLeft on SMB or RDR
Restrict timeLeft in cm_Analyze() to SMB constraints only
when SMB mode is in use.

Change-Id: Iff37b90c1532fe9aa7d57567f4ff4e5e6877cb65
Reviewed-on: http://gerrit.openafs.org/5341
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
2011-09-04 09:19:53 -07:00
Jeffrey Altman
f1ca805de8 Windows: additional CM_REQ flags
Change-Id: Ic620d157817e39053e75ba79ad7d582ba3067424
Reviewed-on: http://gerrit.openafs.org/5340
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
2011-09-04 09:19:26 -07:00
Jeffrey Altman
21496cc223 Windows: add connection defaults for RDR mode
CM_CONN_IFS_HARDDEADTIME       120
  CM_CONN_IFS_CONNDEADTIME        50
  CM_CONN_IFS_IDLEDEADTIME        50

Change-Id: I0b110f2a33879bb889d4ad4b54b7c218a1006e65
Reviewed-on: http://gerrit.openafs.org/5339
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
2011-09-04 08:50:56 -07:00
Jeffrey Altman
b861e17c0b Windows: log SMB or RDR in use at startup
Change-Id: Ib38d8a755a8ace9db672ce2d10bcdd370e9e3de6
Reviewed-on: http://gerrit.openafs.org/5338
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
2011-09-04 08:50:18 -07:00
Jeffrey Altman
070383939d Windows: Make use of SMB interface a runtime decision
Add 'smb_Enabled' and 'RDR_Initialized' flag variables.
Default smb_Enabled to true and RDR_Initialized to false.

Add registry value "SMBInterfaceEnabled" to permit disabling
the SMB interface.

If the redirector interface is initialized (a future set of
patchsets will add it) disable the SMB interface at runtime.

Change-Id: I354e121001d942421aa98490b62b710ac175051f
Reviewed-on: http://gerrit.openafs.org/5337
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
2011-09-04 08:49:45 -07:00
Jeffrey Altman
f7d0e800eb Windows: pioctl path retrying with \\afs\all
When the redirector is in use, \\AFS is identified as being an AFS path.
With the SMB redirector, \\AFS was not considered a valid path.  In order
to simulate the notion of \\AFS being the root volume, failover logic
was added to the symlink and fs modules being triggered that
would retry a request for \\afs\foo as \\afs\all\foo.

The VIOC_SYMLINK and VIOC_AFS_CREATE_MT_PT pioctls are broken.  The
'path' parameter that is passed in contains the directory entry that
is to be created.  Since the AFS redirector maps \\afs to the root.afs
volume the "foo" in \\afs\foo must exist in order for the
_._AFS_IOCTL_._ special file to be opened.

This patch implements an alternative to the failover.  If the opcode
is one of the two listed above and the input path is a UNC path,
then the path is re-written as \\AFS\all.  This is necessary because
the repeated attempts to open a UNC path through the SMB redirector
with different usernames can result in the smb session becoming
disconnected.  If this is done when the SYSTEM account is in use,
the tokens associated with the connection can be lost.

LICENSE MIT

Change-Id: I2c2f6c08c7ca5c137062d34e1353731b6f78f633
Reviewed-on: http://gerrit.openafs.org/5336
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
2011-09-03 15:46:15 -07:00
Jeffrey Altman
2271d481d3 Windows: remove MULTIHOMED ifdef
All builds include the MULTIHOMED functionality.
Get rid of the #ifdef MULTIHOMED.

Change-Id: Ib9ea4597fcda47aa9dce0fbf92675a6606e2ec6e
Reviewed-on: http://gerrit.openafs.org/5333
Tested-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
2011-09-02 21:43:54 -07:00
Jeffrey Altman
8127e9332b Windows: missing ! in update volume location
The check to see if the volume name is numeric or not was
missing a ! in order to perform the correct test.  Add it.

Change-Id: I4626f4bdcf601cd1b421dd3d373edd634cc78527
Reviewed-on: http://gerrit.openafs.org/5331
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
2011-09-02 21:43:36 -07:00
Jeffrey Altman
f37b6dfaf0 Windows: improve handling of volume rename
The windows cache manager tracks volumes by volume group.
Up to this point all volume location updates have been performed
by the volume name.  What if the volume name was altered?  In this
case the volume location information for the in use volume ids will
fail until a mount point to the new name is queried.  Before
marking the volume group as non-existent attempt to perform a
lookup using either the volume id for the readwrite or readonly
volume.

Change-Id: I51b383150b0186867e1c51a28b01e8483ee470f2
Reviewed-on: http://gerrit.openafs.org/5330
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
2011-09-02 21:43:13 -07:00
Jeffrey Altman
9563dd68fc Windows: refactor volume location updates
Break out the VL_GetEntryByName RPC calls into support
functions so we can reduce the amount of duplicated code.

Change-Id: If4a26514959d3fd82e4b583a993ccea393267fdd
Reviewed-on: http://gerrit.openafs.org/5329
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
2011-09-02 21:42:56 -07:00
Derrick Brashear
85f917d076 macos: update 32 bit kernel build flags
this is what the current xcode uses. do the same.

Change-Id: I3ea2f3df6e0f39aafb421f6b0854af5d85659742
Reviewed-on: http://gerrit.openafs.org/5205
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Tested-by: Derrick Brashear <shadow@dementix.org>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
2011-09-02 05:48:12 -07:00
Derrick Brashear
16dff61e14 xserver lock order violation
individual volume locks are pretty far down, well after afs_xserver.

afs_SetupVolume (with tv->lock)-> InstallUVolumeEntry-> afs_GetServer.

Install*Volume is careful to protect against recursing into the volume
lock via ResetVolumeInfo. Unfortunately, GetServer acquires xserver,
and then if it needs to call GetCapabilities, it drops and reacquires
xserver.

turns out the volume locks weren't protecting much. they also aren't
grabbed before xvolume is dropped. fine, so, restructure to do all the
work, then merge the result.

Change-Id: I648900849a5a7349adc686658872706bd7024c90
Reviewed-on: http://gerrit.openafs.org/5303
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
2011-08-31 11:37:54 -07:00
Derrick Brashear
12fa5b859b xvcb lock order violation
afs_FlushVCBs(1) = xvcb, xserver (in that order)

afs_GetServer = xserver, xsrvAddr, (call afs_RemoveSrvAddr which calls
afs_FlushServer, which gets xvcb)

"nope". do a little dance to get xvcb, searching for a struct server to reuse
again if we had to block.

if you're curious:
Lock afs_xserver status: (reader_waitingwriter_waiting, write_locked(pid:1589 at:36), 3 waiters)
Lock afs_xvcb status: (none_waiting, write_locked(pid:0 at:273))
Lock afs_xsrvAddr status: (none_waiting, write_locked(pid:1589 at:116))

Change-Id: If295d0b9ce347c1cc24df12cd9934a30dce2a3c6
Reviewed-on: http://gerrit.openafs.org/5294
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Tested-by: Derrick Brashear <shadow@dementix.org>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
2011-08-31 11:37:21 -07:00