At the moment, the GetCapabilities RPC handler ignors errors from
CallPreamble or CallPostamble. Instead of silently swallowing these,
and potentially reutnring a bogus capabilities structure, make
it possible for the RPC to return failure to the caller.
Caught by clang-analyzer
Change-Id: Ic36e59e8cce8be4920f041a86d5636d54668d887
Reviewed-on: http://gerrit.openafs.org/9241
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
If GetCellInfo returns a non-zero result, catch the error, rather
than just carrying on regardless.
Caught by clang-analyzer
Change-Id: I6b9ca91c8cea2ff0d68873913abdc0daadcc0e27
Reviewed-on: http://gerrit.openafs.org/9240
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
If CopyOnWrite has already failed, and is taking the volume offline
for salvage we can't (and don't) do anything with further errors from
IH_DEC. Instead of assigning these to 'rc', just ignore them.
Caught by clang-analyzer
Change-Id: I7bcd82f124740e3ca3d11cb2b079aa7ea5751cf9
Reviewed-on: http://gerrit.openafs.org/9239
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
In lots of places scout takes the return value of a graphics
function, then decides it doesn't actually care about the result.
Get rid of the assignments, as they provide a false sense of
security.
Caught by clang-analyzer
Change-Id: I1ea8514b969777f1276b4e8f8ab946a4d36a870c
Reviewed-on: http://gerrit.openafs.org/9238
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
The switch which selects the collection number was missing a
'break', so selecting the CBSTATS collection would always fall
through to the default, error, case.
Caught by clang-analyzer
Change-Id: I354873d711c5f49ddad51f1b9fb332af91a6d13a
Reviewed-on: http://gerrit.openafs.org/9235
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
The bosserver doesn't do anything if the core file rename fails, so
don't bother storing the result code.
Caught by clang-analyzer
Change-Id: I9b1b7d77404b0fd560c7735646e5afe1fbcc0752
Reviewed-on: http://gerrit.openafs.org/9232
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Chas Williams - CONTRACTOR <chas@cmf.nrl.navy.mil>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
In the Restart RPC handler, don't assign a value to code
immediately before we use it to hold the return value of
bozo_WaitStatus.
Caught by clang-analyzer
Change-Id: I0781c57c87088cb3ba6170ca1e5c8d5053cf9001
Reviewed-on: http://gerrit.openafs.org/9231
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Chas Williams - CONTRACTOR <chas@cmf.nrl.navy.mil>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
We don't care about whether the renames succeed in SaveOldFiles,
so don't bother assigning their results to a variable
Caught by clang-analyzer
Change-Id: I0605fc71d243ef0f587706f9f3856aa4d722fb82
Reviewed-on: http://gerrit.openafs.org/9207
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
len is zeroed at the start of the next block, so don't bother assigning
tlen to it if we're not going to do anything with it.
Caught by clang-analyzer
Change-Id: Ie1cd5a4d9dd96920018f054b6edfc18c569c9807
Reviewed-on: http://gerrit.openafs.org/9206
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tidy up a lot of places where we initialise a variable, then
immediately assign a proper value to it, or store a return value
that we don't actually care about.
Caught by clang-analyzer
Change-Id: Icf0ec713dac6f2c4f0a60e8ead52a8d3e19381f0
Reviewed-on: http://gerrit.openafs.org/9205
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Fix the use of an incorrect variable as loop iterator which would have
resulted in a crash.
Caught by clang analyzer.
Change-Id: I785d06b9be0915bc540c37b43d1001a562a7cde4
Reviewed-on: http://gerrit.openafs.org/9202
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Fix a couple more errors where we assign to a variable, but never
read the result back out.
Caught by clang-analyzer
Change-Id: I78f8f1403d166c4231b0abdb607de77e9ed62a27
Reviewed-on: http://gerrit.openafs.org/9201
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
When we're cleaning up temporary volumes, we don't care whether
it succeeds or not. Don't assign code to the results of these
volume deletions, only to then discard it.
Caught by clang-analyzer
Change-Id: I81583cc82e78db38de8aad92c7c7d0c2f44eb33d
Reviewed-on: http://gerrit.openafs.org/9200
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
If lsmount or flushmount encounter an error, then they may include
the contents of parent_dir in their error message. However, in both
cases, this was freed a couple of lines earlier.
Just move the free() later, so that the contents of this variable
are still available.
Caught by clang-analyzer
Change-Id: Ideba52b7ba98f034baf923194007239a6cf0221f
Reviewed-on: http://gerrit.openafs.org/9193
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Report errors on both filehandles in up's Copy routine, rather
than just on the second one that we close.
Caught by clang-analyzer
Change-Id: Ia3aa9be91ccfca2993a4f27c291332e0b0d350f5
Reviewed-on: http://gerrit.openafs.org/9192
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Don't reset the value of 'code' when nothing else references it.
Caught by clang-analyzer
Change-Id: Ifd361ed6eb8c6b8740466f6c1a337669160874f4
Reviewed-on: http://gerrit.openafs.org/9191
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
The for loop in icl_EnumerateLogs looks up the next pointer in the
current entry after zapping it. Depending on reference counts, this
may result in us looking up freed memory.
Take a copy of the next point before zapping the current entry, just
in case.
Caught by clang-analyzer
Change-Id: If38f0af2b01c5b8ea00e68e4432c6ad5517578c8
Reviewed-on: http://gerrit.openafs.org/9190
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
We're about to exit anyway, so we don't care whether Cleanup
succeeds or not
Caught by clang-analyzer
Change-Id: I6350d60e6a5d29b8aaa272a54cf9ead47fdb5fad
Reviewed-on: http://gerrit.openafs.org/9186
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
When we're not interested in the return value of a function, don't
assign it to a variable.
Caught by clang-analyzer
Change-Id: I5b576f312376780c98c2dbe4f9b85e00d529ddd8
Reviewed-on: http://gerrit.openafs.org/9185
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Help out the static analyzer by telling it that rmt_Quit never returns
Change-Id: I5ee0d2ea444706e68af5a1298fd638e7d0d7f41d
Reviewed-on: http://gerrit.openafs.org/9184
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
checkCksum is assigned to by both sides of the if() expression, so
there's no need to initialise it to 0.
Caught by clang-analyzer
Change-Id: Id0e286943e11b6948231577085cdb0ce96bb0b97
Reviewed-on: http://gerrit.openafs.org/9183
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
If we can't initialise the ubik_client mutex, don't leak the
structure when returning an error.
Caught by clang-analyzer
Change-Id: Ib36d2ddf585a31b628e56dce1f33ee859fc835bc
Reviewed-on: http://gerrit.openafs.org/9182
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
We never do anything with the return value from select(), so don't
bother storing it into code.
Caught by clang-analyzer
Change-Id: I6e0352b74f0e90b62ad32a3ef1a9d0173bf307ee
Reviewed-on: http://gerrit.openafs.org/9181
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Don't ignore a failure from afsconf_GetExtendedCellInfo, as it will
leave buffers that we later read uninitialised.
Caught by clang-analyzer
Change-Id: Ia0c2675a3083385d011fd340f36bf13373f89feb
Reviewed-on: http://gerrit.openafs.org/9180
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
If ka_KeyCheckSum fails, typically because the key being used is bad,
catch the failure rather than just silently ignoring it.
Caught by clang-analyzer
Change-Id: Id51174fdf94356db10961690808670da372bc60e
Reviewed-on: http://gerrit.openafs.org/9179
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Remove various places where a variable is assigned to, and then the
result never read.
Caught by clang-analyzer
Change-Id: Id8b7aeb6c54b7c93093ad44df5a9fe01575f2fbe
Reviewed-on: http://gerrit.openafs.org/9172
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
In the current version of CacheStoreDCaches, the stored variable is
maintained within the for loop that iterates over the chunk list. This
means that it is reset to 0 each time we handle a new chunk.
However, this means that our progress is no longer accurately tracked,
as (bytes - stored) no longer gives the number of bytes which remain to
be transfered. In fact, as stored is zeroed with each loop iteration,
(bytes - stored) == bytes. This means that store behind is no longer
activated according to the users settings.
Prior to commit 334114ac58, the
stored variable was maintained within the outer, function, scope.
Just move it back there to restore the previous behaviour.
Caught by clang-analyzer
Change-Id: I248ed81f1331f4d3d4ed2e1206acebb0a8200762
Reviewed-on: http://gerrit.openafs.org/9237
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Even if allocating the dcache fails, there's no point zeroing the
parameters to the allocation function, as those changes aren't
visible outside of that function.
Caught by clang-analyzer
Change-Id: Ieb91b525e818b73e38b8d78a55d170d36273177c
Reviewed-on: http://gerrit.openafs.org/9234
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Chas Williams - CONTRACTOR <chas@cmf.nrl.navy.mil>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
A stray $ had crept into the license string in afs_dcache.c. Fix it.
Change-Id: I1ab096aadb947cb08318a56b9ae21ed0786d3339
Reviewed-on: http://gerrit.openafs.org/9233
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Chas Williams - CONTRACTOR <chas@cmf.nrl.navy.mil>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
AddKey calls GetConn twice - once at the start of the function,
and then again immediately before calling BOZO_AddKey. This leaks
a connection...
Caught by clang-analyzer
Change-Id: I5c593de56e7f61fb21b973a34bea1a5b4f4a3177
Reviewed-on: http://gerrit.openafs.org/9230
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Chas Williams - CONTRACTOR <chas@cmf.nrl.navy.mil>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
We don't do anything with the return code from the LWP_CreateProcess
that starts the daemon thread, so don't bother recording it at all.
Caught by clang-analyzer
Change-Id: I9310bdd90236a90d71dc202c73d7e06ea58a31f8
Reviewed-on: http://gerrit.openafs.org/9229
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Chas Williams - CONTRACTOR <chas@cmf.nrl.navy.mil>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Don't assign the serverNumber to j, when we're just about to try
and get it from a multi homed extent record
Caught by clang-analyzer.
Change-Id: I79349ff211b5df2d16e6ee9122dbb28b04ad7823
Reviewed-on: http://gerrit.openafs.org/9228
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Chas Williams - CONTRACTOR <chas@cmf.nrl.navy.mil>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Remove a couple of places where we initialise a variable, only to
assign a new value to it a few lines later.
Caught by clang-analyzer
Change-Id: I096b80cce851f3494475e6f9683715b081ff8375
Reviewed-on: http://gerrit.openafs.org/9208
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
tbuf is assigned to during the initialisation phase of all of the
for loops that follow, so just remove this assignment
Caught by clang-analyzer
Change-Id: I3f2ffc8cee93768bd03e0abf3b391e1f6c45c70f
Reviewed-on: http://gerrit.openafs.org/9189
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
This patchset implements and enables by default the new
Direct IO pathway between the AFS redirector and the afsd_service.exe.
When Direct IO is enabled all reads and writes are performed by the
AFS redirector locking memory allocated by the kernel and mapping it into
the service's memory address space.
The service supports cache bypass in this mode when the
AFS_REQUEST_FLAG_CACHE_BYPASS flag is set in the request from the
redirector. When cache bypass is active, the AFSCache file is ignored and
data is either directly fetched from or stored to the file server. Cache
bypass is enabled by IIS and other applications that request no
intermediate buffering when opening file handles. This is often done
because the application implements its own data caching. All cache bypass
store operations are synchronous.
When cache bypass is not enabled, the memory region provided by the AFS
redirector is either used to populate the cm_buf_t objects or is populated
by them. When cache bypass is not enabled, one outstanding store
operation can be in flight asynchronously to improve performance.
Direct IO is enabled by default and can be disabled by creating the
registry value.
..\Services\TransarcAFSDaemon\Parameters
"DirectIO" DWORD 0x0
Change-Id: I3cac3660c8b8eded58226ba4a819692c454704a8
Reviewed-on: http://gerrit.openafs.org/9211
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Implement a new IO processing model in which extents are not passed between
afsredirlib.sys and afsd_service.exe. Instead the AFSCache file is
maintained exclusively by the service and the redirector locks kernel
memory, maps it into the service's address space, and permits the service
to manage all IO directly.
This interface adds an AFS Cache Bypass option to the AFS Redirector which
is activated when the file handle has been opened with the no intermediate
buffering option.
This patchset implements the kernel interface. A subsequent
patchset will implement the service component.
Assisted by Jeffrey Altman <jaltman@your-file-system.com>
Change-Id: I25a4764db060b3b3f2b0de4006479dd3a220c6eb
Reviewed-on: http://gerrit.openafs.org/9210
Reviewed-by: Peter Scott <pscott@kerneldrivers.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Modify the buf_Get() and buf_GetNewLocked() interfaces to
permit the cm_scache.bufCreateLocked lock to be held prior to
calling to buf_Get(). Holding the cm_scache.bufCreateLocked lock
before the buf_Get() call prevents a race with another thread
that attempts to set the file size.
Change-Id: I54b13c83801a4d9a2078552d5be7ada6f4607850
Reviewed-on: http://gerrit.openafs.org/9209
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Set the ObjectInformationCB AFS_OBJECT_FLAGS_DIRECTORY_ENUMERATED flag
from within the AFSEnumerateDirectory() function and not from its callers.
Change-Id: I2bddedba1165557679ddd9c637dbeb85cd74e1de
Reviewed-on: http://gerrit.openafs.org/9119
Reviewed-by: Peter Scott <pscott@kerneldrivers.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
The AFS redirector has required that directories be fully enumerated
when the directory object is opened. This is a very expensive
operation involving large numbers of file server RPC round trips for
directories with tens of thousands of objects and those containing
symlinks.
This patchset delays directory enumeration for the last component
in a path until such time as dirctory data is requested by the
application. If the request is for a non-wildcard pattern, the
service will be asked to provide the details for just the one required
object.
Delaying the directory enumeration improves performance for
GetFileAttributes[Ex], GetDiskFreeSpace[Ex], GetVolumeInformation,
and GetNamedSecurityInfo Win32 API calls. In those cases it is
no longer necessary to enumerate the target directory at all.
Change-Id: I7ef2fbafff925697d8b40e56837ef53bfcc78542
Reviewed-on: http://gerrit.openafs.org/9118
Reviewed-by: Peter Scott <pscott@kerneldrivers.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Add AFS_REQUEST_FLAG_LAST_COMPONENT flag for use with
AFS_REQUEST_TYPE_EVAL_TARGET_BY_NAME requests to the service.
When set the service will perform cm_Lookup calls without the
CM_FLAG_CHECKPATH flag set.
Change-Id: I47ec2fb8b1e2699f2d87a6625b1db549ecb4e03d
Reviewed-on: http://gerrit.openafs.org/9133
Reviewed-by: Peter Scott <pscott@kerneldrivers.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Directory lookups in AFS should favor case-sensivite matches
but permit case-insensitive matches otherwise. The service
should not follow mount points. The redirector exposes mount
points as junctions.
Change-Id: I34c9244e2756a926f29bbf184dc250e7a29d264f
Reviewed-on: http://gerrit.openafs.org/9132
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Currently, when the library is unloaded it stops all worker
threands and then evaporates the work item queues. Thus
any work items which are pending will disappear.
Whilst it is OK that the threads going away, any work items need to
remain queued so that when the library is restarted the work
can continue. This checkin does this by moving the work item
queues and their synchronization primitives into the FS maintained
Control Device Object Extension. The list of worker threads
remains in the Library Device Object Extension.
Change-Id: If5c7cd3bdfea1a368c8df69649e627bac3a9585f
Reviewed-on: http://gerrit.openafs.org/9139
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Peter Scott <pscott@kerneldrivers.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>