The Netbios NCBRESET command resets all of the Netbios state
associated with the LAN adapter including the name bindings.
In response to a detected LAN adapter IP address change, the
smb_LanAdapterChange() function is called to determine if any
Netbios LAN adapter bindings that were in use or should be in
use by afsd_service were altered. As part of the check,
lana_GetUncServerNameEx() is called which in turn calls
lana_FindLoopback() which in turn issued a lana_IsLoopback()
for each LAN adapter with the 'reset adapter' flag set to TRUE.
Calling lana_IsLoopback() with 'reset' equal TRUE was fine
when lana_GetUncServerNameEx() was only called from smb_Init(),
but it is not fine when called after the service is processing
calls. By resetting the adapter the binding of the netbios name
"AFS" (or "<MACHINE>-AFS") is removed and all outstanding calls
are canceled. If the SMB redirector attempts a reconnect during
the window before NCBADDNAM is called to re-bind the name, a
negative cache entry will be placed in the netbios name lookup
table that will prevent the SMB redirector from connecting to
the client for several minutes.
If the environment is one in which frequent IP address change
events are triggered, it is possible that the SMB redirector
will never be able to reconnect to the service.
This patchset adds a flag, LANA_NETBIOS_NO_RESET, to the
lana_GetUncServerEx interface which permits smb_LanAdapterChange()
to avoid the undesirable reset. This negative flag was selected
in order to avoid changing the current default behavior as the
lanahelper library is used by out of tree installers and it
is preferred that OpenAFS avoid breaking them unnecessarily.
Reviewed-on: http://gerrit.openafs.org/3821
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit efe4a20c46c73c39bd979437956beddcd3057bc3)
Change-Id: Ice4380550fec8c1ac2c2c5ec76e1b73f23cd4829
Reviewed-on: http://gerrit.openafs.org/3911
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Do not use reserved preprocessor symbol names. Instead
use OPENAFS_<PATH>_<HEADER>_H formatted names where <PATH>
is the subdirectory path from src/ in which the header
file originates in the repository.
Reviewed-on: http://gerrit.openafs.org/3599
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
(cherry picked from commit 8e9fff9ed8d773e4a22730d485c0617c456bb0e0)
Change-Id: Ic99253b74d3d88712b1959757d294b31ad590ba0
Reviewed-on: http://gerrit.openafs.org/3806
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
namei_RemoveDataDirectories currently calls delTree with 'tree'
pointing to the part of the path immediately following n_base (i.e.
starting at the beginning of n_voldir1). This causes delTree to
traverse all of n_voldir1, trying to delete every directory it finds.
Since we are typically only trying to remove a single volume when
calling namei_RemoveDataDirectories, instead call delTree with 'tree'
pointing to immediately after n_voldir1, and beginning at n_voldir2
and try to just rmdir n_voldir1 afterwards. This way, we do not
traverse a large fraction of the entire partition when just trying to
delete a single volume, and so can significantly speed up volume
removals.
(cherry picked from commit 1ca0a24775794ba2e645854a3bbaa656f2fc8086)
Reviewed-on: http://gerrit.openafs.org/2651
Tested-by: Andrew Deason <adeason@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Change-Id: Iadae1e231b533695af615a231e42ad8204674fe4
Reviewed-on: http://gerrit.openafs.org/3908
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
When removing data directories in namei_RemoveDataDirectories, do not
remove the n_voldir1 directory (directory X in /vicepa/AFSIDat/X).
Removing this directory can race against the creation of an entirely
unrelated volume, causing the create op to fail (since it tries to
create a directory in a directory that no longer exists).
We don't currently have the necessary locking to make this safe, and
since the overhead of n_voldir1 existing is pretty negligible, just
leave it there. Also add some comments briefly justifying this.
Note that other similar races probably exist for directories under
n_voldir1, but they would only be between volumes in the same VG, and
so are much less likely to occur.
(cherry picked from commit f2df207274c65b4fa8c24419150e9084a4d17fca)
Reviewed-on: http://gerrit.openafs.org/2727
Tested-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
Change-Id: I2df4b73dd5125da0a2de52c3011ba167dc036a8b
Reviewed-on: http://gerrit.openafs.org/3907
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
Fix some macros to eliminate unreached trailing empty statements (such
as: "{code = foo; goto error;};"), and other oddities causing
"statement not reached" warnings. Also eliminate a couple of code
blocks that were never reached.
(cherry picked from commit 1c45cc746e7484e72191fc8d010640692e90bc82)
Reviewed-on: http://gerrit.openafs.org/3368
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Change-Id: Ibe9a94c64d38fe102fdf4fb9c182a5eb3b2adaa5
Reviewed-on: http://gerrit.openafs.org/3906
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
file descriptors on Windows are not ints and therefore
cannot be safely compared against -1. Always use INVALID_FD
which is -1 on UNIX and INVALID_HANDLE_VALUE on Windows.
Reviewed-on: http://gerrit.openafs.org/3178
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Tested-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit d21dd16789458c07e63abe021f93f656dba4e52c)
Change-Id: I99e0ef2f0c1ff23817ffb13b270bc0f04bcf12a4
Reviewed-on: http://gerrit.openafs.org/3905
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
In DAFS, FSYNC_sync was waiting for VInit to reach at least 2 by
looping around pthread_yield(). For a server with a large number of
volumes, it can take a while for volumes to preattach, and so we are
effectively busy-waiting for preattach to finish. This can slow
fileserver startup and peg the cpu.
So instead, add a condition variable for when VInit changes, and wait
on that. Also modify other checkers of VInit to use the cond var.
(cherry picked from commit 31bb2e5eb5feb9c8e84d17b49fe70268127cdd43)
Reviewed-on: http://gerrit.openafs.org/2648
Tested-by: Andrew Deason <adeason@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Change-Id: I773ab01095bb0c101a34146ef9bf201946ebcf8b
Reviewed-on: http://gerrit.openafs.org/3887
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Some potentially-threaded callers were calling PrintInode with a NULL
first argument, which is not threadsafe. Alter them to use local
storage.
(cherry picked from commit 38cf31463e3f3c675de727c1e793e117a90e6d20)
Reviewed-on: http://gerrit.openafs.org/2593
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
Change-Id: I4b6e0f8c41180c017739dbfdb4f2ecbce96df8ec
Reviewed-on: http://gerrit.openafs.org/3886
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
The FSync file descriptor is an osi_socket which has an invalid
value of OSI_NULLSOCKET which is not necessarily -1. Be sure to
compare against OSI_NULLSOCKET and not -1 when checking an invalid
value.
Reviewed-on: http://gerrit.openafs.org/3179
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Tested-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit e8991ff8286f151d109bb4f98d885a583e198f83)
Change-Id: I1627ce0b78d10626b7d375546b400459ff1724ca
Reviewed-on: http://gerrit.openafs.org/3885
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
We need to still keep sending periodic keepalives after receiving an
ACKALL, since the call is not done yet. ACKALLs can be received when
the peer has received all data from us, well before the call has
finished. This is particularly noticeable for long-lived calls that
have little data transfer, such as AFSVolForward and
AFSVolForwardMultiple.
This reverts commit b1549f29a9515de09d4a64bfb28bf5afdfee2615, which
was intended to be part of a fix for RT 20727.
FIXES 128848
Reviewed-on: http://gerrit.openafs.org/3876
Tested-by: Andrew Deason <adeason@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit ba51b43e3558058b949ccc5de1d4559e4caf9d9b)
Change-Id: I9a2edb819ba052786ec9f4c9d15d11ea48905af3
Reviewed-on: http://gerrit.openafs.org/3878
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
The recent refactoring of cm_CheckCBExpiration introduced
a lock ordering error between the cm_scache_t rw lock and the
cm_scacheLock. This patchset fixes the error by dropping the
cm_scacheLock as each cm_scache_t is being processed.
Reviewed-on: http://gerrit.openafs.org/3773
Tested-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
(cherry picked from commit 67195401c915b23e092f98c89ab5f5580a9cf3f6)
Change-Id: I14e57ca1b6b2f86bee585bc6fa86bdf0b7d77d44
Reviewed-on: http://gerrit.openafs.org/3872
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
FD_t is an abstract type. Invalid file decriptors are == INVALID_FD.
In most places this module does the right thing. Fix the last
stragglers where it is testing as less than zero.
Reviewed-on: http://gerrit.openafs.org/3768
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit 299e942ae98dfea3a4804c724e5d440715974e0c)
Change-Id: I8f676c45794ecf53af65e9b3089c7b2d075089bb
Reviewed-on: http://gerrit.openafs.org/3871
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Signal to the vfs that we don't support path RCU walk in
d_revalidate. It will call back in non-RCU mode.
(cherry picked from commit 52556d50298e4a636f07e9a3cf0b6557c882c82d)
Reviewed-on: http://gerrit.openafs.org/3759
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Change-Id: I44d8577feba382a193d1f1735a05db74c3151df0
Reviewed-on: http://gerrit.openafs.org/3870
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
In 2.6.38, the super block structure has a new field to hold the
default dentry ops. The vfs will automatically set it for new
dentries in most cases.
Set s_d_op to our set of operations, and omit setting the dentry
ops where the vfs will already do it (and where new locking rules
prohibit it).
Reviewed-on: http://gerrit.openafs.org/3758
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit 08bb83d95027bb3ac68834d12b72bdc647fa24a9)
Change-Id: Ia108e8c7c624521965bdbddd7a37ebf281eb7967
Reviewed-on: http://gerrit.openafs.org/3869
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
When we receive an RX_PACKET_TYPE_BUSY packet, we currently ignore it.
This is a problem when the server has a long-running call on that same
call channel that we don't know about, since we will then keep
retrying the call on the same channel and keep getting
RX_PACKET_TYPE_BUSY responses.
Try to avoid this by returning the RX_CALL_TIMEOUT error when we get a
BUSY packet and there are other free call channels available on the
conn. When the application gets the error and retries the call, we
avoid using the same call channel again where possible. When all of
the call channels appear busy, we revert to effectively the old
behavior of retrying the call on the same channel until we get an
RX_CALL_DEAD (or similar) error.
FIXES 128671
Reviewed-on: http://gerrit.openafs.org/3431
Tested-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit 54fb96d2b6517ae491fd7a7c03246850d29156d5)
Change-Id: I098c482a6a5b9f34907e9f8f40913df40c5b5d4b
Reviewed-on: http://gerrit.openafs.org/3763
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
cm_volume_t flags was used for two categories of flags. The first
protected by the cm_volume_t->rw lock. The second protected by
the global cm_volumeLock. Separate the flags field into two
afs_uint16 fields and break the flag space into FLAG and QFLAG.
Add assertions to the volume LRU functions to ensure that they
are always called with cm_volumeLock write-locked.
Correct two locations where cm_AdjustVolumeLRU() was called
read-locked instead of write-locked.
Reviewed-on: http://gerrit.openafs.org/3760
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
(cherry picked from commit 962a95c21cc82a8bbb1dc1233c91acd7236fc8e4)
Change-Id: I6c60dd770057f665f66bf3cea2d653bbe2524979
Reviewed-on: http://gerrit.openafs.org/3867
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
In SalvageIndex, if check is true, we're only supposed to check for
consistency and not actually change anything (this is enforced by an
assert later on). The check for vnode magic consistency breaks this
assumption, and just always fixes the vnode.
Change this so we just error out if check is set, and the vnode magic
is wrong.
Reviewed-on: http://gerrit.openafs.org/3756
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit 5817a13b84496c087b350be50c17a8b0f9aac9d5)
Change-Id: I1b12c56d680111ba71b611ab9bbb6159a35dd14e
Reviewed-on: http://gerrit.openafs.org/3866
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
Implement a multi_RXAFS_GiveUpAllCallBacks version of
cm_GiveUpAllCallBacksAllServers() and use it in place of
the non-multi version.
Reviewed-on: http://gerrit.openafs.org/3648
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
(cherry picked from commit 5fe04739e0407079a0439f28c6aaaa86d5399e71)
Change-Id: I99660917d9f658cb95be6655aa9fb30cdf73b164
Reviewed-on: http://gerrit.openafs.org/3865
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
SetFilePointerEx takes specific values
(FILE_BEGIN/FILE_CURRENT/FILE_END) whilse fseek requires SEEK_SET,
SEK_END, SEEK_CUR. It turns out that these overlap, but we should
not let that pass unchallenged.
SetFilePointerEx returns nonzero for success zero for failure. fseek
returns the other way around.
Neither of these changes currently matter, but we should fix them.
Reviewed-on: http://gerrit.openafs.org/3746
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
(cherry picked from commit 4f838b03bbf9ea0e1ede8a188ea6dde3efb4e231)
Change-Id: I295d172e8f14bc50facf38f08e3dc3af02b7404b
Reviewed-on: http://gerrit.openafs.org/3864
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
nt_read and nt_write were defined to take a char* buffer which was
then cast to a void *. Meantime every call of OS_READ and
OS_WRITE were casting to a char*.
Equally every call of OS_OPEN was passing down a const char*,
causing warnings.
This checkin fixes this:
nt_read : char* to void*
nt_write: char* to const void*
nt_open char* to const char*
Reviewed-on: http://gerrit.openafs.org/3744
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
(cherry picked from commit 6d2636b886789f2ddc6374c6b7e58ccd28d518aa)
Change-Id: Ib07ea6d1e0dad935717810c1279cc7f38645e229
Reviewed-on: http://gerrit.openafs.org/3863
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
With OpenBSD 4.8, OpenBSD now uses gcc 4. With its new
defaults, the OpenAFS compile of the kernel module now
complains incessantly about the conflict between the
built-in malloc versus the kernel version (which has
extra parameters). Therefore, set -fno-builtin-malloc
when compiling the kernel module to remove the noise
since the differences can't be reconciled otherwise.
Reviewed-on: http://gerrit.openafs.org/3751
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit 42c5806599c1df65ee8ec1272f691df30ea44d4c)
Change-Id: I311d9c642d6272acd229a64a6a72eedf7dd39018
Reviewed-on: http://gerrit.openafs.org/3862
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
OpenBSD 4.8 no longer needs to include h/user.h in dir.c
and it's presence now gets in the way of the compile so
remove it.
Reviewed-on: http://gerrit.openafs.org/3750
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit e1b0a95352e2e6aa312a526ffcc8a2f77a8fb7df)
Change-Id: I7f46c816f6fcd8ce6018f5e93f2ea0044b221b51
Reviewed-on: http://gerrit.openafs.org/3861
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
The label 'retry' in nt_open is not used and was causing a warning. Remove it.
Reviewed-on: http://gerrit.openafs.org/3747
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
(cherry picked from commit 40497fa667d15aaaa8f6befdc45cff40cc544616)
Change-Id: I7887e4ba31556b2bf6b1e2a4867aecd1e8b41297
Reviewed-on: http://gerrit.openafs.org/3860
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
The implementation has an assumption that all disk volumes have an
object name of \Device\HarddiskXXX (where XXX is a number). This is
wrong since the name is purely a convention and since about WXP they
have been called \Device\HarddiskVolumeXXX.
Either way it is spurious to assume the format and then try to compare
the XXX. This change just compares the strings. This is done in a
case insenstive manner which is the safer option. It is quite
feasible, but very unlikely that someone will uses 'case sensitively
different' object names.
Reviewed-on: http://gerrit.openafs.org/3745
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
(cherry picked from commit ffb0cdcc91d86f6e7b62561aebe6dcb722c3d768)
Change-Id: I3f69c2a8f76d073afcfe626eec45be9942bf4042
Reviewed-on: http://gerrit.openafs.org/3859
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
If when parsing a directory page in cm_ApplyDir the consistency
checks fail, log a message and invalidate the page in case
it was a transient failure.
Reviewed-on: http://gerrit.openafs.org/3742
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
(cherry picked from commit de7af90fb8a1a132fb44fcc3d732fb593a45f6db)
Change-Id: I76cd2738df31b1609d0065ac2706a86f75d8a269
Reviewed-on: http://gerrit.openafs.org/3857
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
nt_unlink: when opening a file handle to assign delete on close
status the caller must request DELETE permission.
nt_open: make sure that DELETE permission along with FILE_SHARE_DELETE
is requested if we wish to permit another CreateFile call in the future
to assign delete on close.
Reviewed-on: http://gerrit.openafs.org/3711
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Rod Widdowson <rdw@steadingsoftware.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit 5fdc2679dc973fa45bf4b3bc7f21a527492868db)
Change-Id: I63855a65c5e209dc7b601e5b5b67ccb21bfb653c
Reviewed-on: http://gerrit.openafs.org/3856
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
use NAMEI_SPECDIRC, NAMEI_INODESPECIAL, INVALID_FD and other
preprocessor symbols in place of numeric constants.
namei_create() on Windows must call namei_CreateDataDirectories()
and retry if the afs_open() call fails with either ENOTDIR or
ENOENT.
modify namei_HandleToName() on Windows to make its decision
process clearer.
Reviewed-on: http://gerrit.openafs.org/3712
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
(cherry picked from commit d6528628b4dcadce47bb1a9244768ca3d43b0bf3)
Change-Id: I4d55a7e3e8d0f942058d568c8f2f9f1ae1855044
Reviewed-on: http://gerrit.openafs.org/3855
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
On Windows, files opened via the CRT fopen or open
POSIX compatibility functions cannot be marked for delete
on close. Add a comment until such time as the use of
fopen and open on Windows can be replaced.
Reviewed-on: http://gerrit.openafs.org/3707
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Rod Widdowson <rdw@steadingsoftware.com>
(cherry picked from commit eb6f3a89a3f4da6d3de2d4ae34743014e4eb0fb2)
Change-Id: I6d66617b53f46e832d72ac8ed9a41730fafca521
Reviewed-on: http://gerrit.openafs.org/3854
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
afs_sfsize_t is not always the same size as 'int'.
Avoid warnings by using afs_sfsize_t in the appropriate locations.
Change-Id: If77379b17fa984e3dacd2740726b7309a0e640dd
Reviewed-on: http://gerrit.openafs.org/3706
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Rod Widdowson <rdw@steadingsoftware.com>
Reviewed-on: http://gerrit.openafs.org/3853
Some callers in vol and volser were not using afs_foff_t for file
offsets for calls to STREAM_ASEEK, FDH_TRUNC, FDH_PREAD, or
FDH_PWRITE. Most notably, in code for volume cloning, purging, and
dumping operations. Fix them to use afs_foff_t to prevent errors when
dealing with large special files.
Reviewed-on: http://gerrit.openafs.org/3289
Tested-by: Andrew Deason <adeason@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit ef8c3db90ae9ec25705027c609a1bae5f186c4f1)
Change-Id: I17910490484efcd812f45dfeef1a99d6e450f5fa
Reviewed-on: http://gerrit.openafs.org/3894
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Use OS_UNLINK in order to ensure that platform specific
unlink functions are called. OS_UNLINK is unlink on Unix.
Reviewed-on: http://gerrit.openafs.org/3704
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
(cherry picked from commit 089a3f5e8b0b00942cd0ccff5be7b4f671fcbf82)
Change-Id: Ib3207b7c365b9ede5299bdbc7626e63450198ad7
Reviewed-on: http://gerrit.openafs.org/3851
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
The directory level represented by 'dirp2' does not exist on
Windows. Do not attempt to close the DIR object that was
never opened.
Remove unnecessary function prototypes.
Reviewed-on: http://gerrit.openafs.org/3703
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
(cherry picked from commit 141aca818ef9e5a6af309edc9512cc5cfee38e90)
Change-Id: I640d834f0bfd6490cf43183843d771f792f7fc06
Reviewed-on: http://gerrit.openafs.org/3850
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
Revert the prior change that added directory creation
to nt_open(). nt_open() should fail and the caller should
create the directories. Failure to do so results in an
incomplete tree which confuses the salvager.
Reviewed-on: http://gerrit.openafs.org/3709
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit 1ad22ed7e14d1ed643add0dbf80c82b96ae69fc8)
Change-Id: I4669ee27bd5c3d9100f3e7fc880d6c32e990493f
Reviewed-on: http://gerrit.openafs.org/3844
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
namei_ogm_t is not used on Windows. There is no equivalent
to owner/group mode.
Reviewed-on: http://gerrit.openafs.org/3698
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit 48508a202129be6e56beaec56314cc13d68d69f5)
Change-Id: I6f7c5dc22e45f4da45ebc391512e4a296fe4b2ca
Reviewed-on: http://gerrit.openafs.org/3842
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
Cast to DWORD since the results of the mask and shift
are guaranteed to be 32-bit. This avoids sixteen warnings.
Reviewed-on: http://gerrit.openafs.org/3695
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit fe9285f77a680b6e6d0995166f3c384aac676a8c)
Change-Id: Ic9a17074ce76d1676bb7d83e2e17d7c50e1c45a0
Reviewed-on: http://gerrit.openafs.org/3840
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
replace 'i' with 'dirl' and assign the new variable a value
before using it.
Reviewed-on: http://gerrit.openafs.org/3701
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
(cherry picked from commit 8bb5e291777a0439c7a15262bdbc70d8bd9cc4a6)
Change-Id: I9c7bb592516f609174fbf2a7b3bb6b5e0e81ba72
Reviewed-on: http://gerrit.openafs.org/3848
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
Separate the SetOGM function into two implementations to
match the other OGM functions. Implement the Windows version
as returning -1 always.
In the future, the OGM functions could be renamed to express
their purpose: saving and restoring the volume id and tag
associated with a file. Windows currently encodes this
information using the CreationDate and the file name but
in the future this information might be stored in an alternate
data stream.
Reviewed-on: http://gerrit.openafs.org/3700
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
(cherry picked from commit 270e5c01784f6459dd3d1dec81b714a6d7f2baea)
Change-Id: I347fb7b135c6fccb941ca4e34b3fb4f080f5b09c
Reviewed-on: http://gerrit.openafs.org/3847
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
The manner in which addtoname() is used can often result
in double dir separators in path names. Check for it and
avoid doubling the separator in addtoname()
Reviewed-on: http://gerrit.openafs.org/3699
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Rod Widdowson <rdw@steadingsoftware.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
(cherry picked from commit 959a892afcc1f33871489912a8ea183fc7fca6c2)
Change-Id: Ic9942f08af4ce45310bfffae5922c67a0655774d
Reviewed-on: http://gerrit.openafs.org/3846
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
in ih_reallyclose() clear ihP->ih_synced before dropped
the IH_LOCK. ih_reallyclose() is already committed to
performing the OS_SYNC() call. Failing to clear the ih_synced
flag before dropping the lock permits another thread, the ih_sync_all()
thread for example, to also conclude that it must sync the
file.
Reviewed-on: http://gerrit.openafs.org/3696
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit 9e689e96099dba5227e62ea2c6069062daaac85a)
Change-Id: I18baf1e1cd409a108845c2db2cb38144593016c8
Reviewed-on: http://gerrit.openafs.org/3845
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
cm_CheckCBExpiration() is refactored to make it easier
to read the decision process. cm_CheckCBExpiration()
determines when a callback is no longer usable and as a
result the object status info should be discarded.
The windows cache manager preserves status info past
callback expiration if all of the sources of a volume
became inaccessible prior to the callback expiration
time. The cache manager was improperly preserving the
status info for objects when the callback was issued by
a multi-homed file server when only the interface that
issued the callback is down.
A separate cm_server_t object is used to represent
each file server interface. When one interface goes
down and others are left up, the cache manager will
now replace the down cm_server_t reference for one that
is up. This substitution is performed as a side effect
of computing the effective downTime in cm_CBServersDownTime().
Reviewed-on: http://gerrit.openafs.org/3674
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
(cherry picked from commit 8895fe0fab04d49f8c2b279d915c5f292b55c2be)
Change-Id: I43e05dde3d2f12d2130b34125a6103b22f0259e9
Reviewed-on: http://gerrit.openafs.org/3837
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
In cm_Analyze() when processing VNOVOL, VMOVED or VOFFLINE errors
do not use pointer equivalence as the test to determine if a
server is affected by the error. Use cm_ServerEqual() instead.
Fix cm_ServerEqual() to work even when both cm_server_t objects
are not UUID aware.
Reviewed-on: http://gerrit.openafs.org/3659
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
(cherry picked from commit f25cbdf09ff890846a68f619ccb1d00ab2b3c7a8)
Change-Id: Iabebbb0e620c42898b428352ea2ec3cb64de8d74
Reviewed-on: http://gerrit.openafs.org/3836
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>