Remove bogus NULL checks from Cache_inode

If someone passes us a NULL pointer when they shouldn't, it's better to
crash than LogDebug.

Signed-off-by: Adam C. Emerson <aemerson@linuxbox.com>
Remove bogus NULL tests from nfs_proto_tools.c

It's better to crash outright than LogDebug in these cases.

Signed-off-by: Adam C. Emerson <aemerson@linuxbox.com>
Remove bogus NULL tests from cidr

We'd much rather crash on pointer errors than LogDebug.

Signed-off-by: Adam C. Emerson <aemerson@linuxbox.com>
Remove NULL checks in Common and ConfigParsing

Signed-off-by: Adam C. Emerson <aemerson@linuxbox.com>
Remove bogus NULL checks from FSAL_VFS

Other FSAL authors should pull any out of their own FSAL.

Signed-off-by: Adam C. Emerson <aemerson@linuxbox.com>
Remove fuse_binding.c

Should have been taken out in the previous FUSE removal.

Signed-off-by: Adam C. Emerson <aemerson@linuxbox.com>
Remove (some) NULL checks from SAL

I was very conservative here, since there are some instances that just
return false or NULL on NULL.  More could probably removed without
breaking legitimate cases but making bugs easier to find.

Signed-off-by: Adam C. Emerson <aemerson@linuxbox.com>
Remove bogus NULL checks from support
Save UDP request remote port number in svc_req, since UDP xprt
is shared among different endpoints of the same host addr.
This port is needed to send data gram response back
to client.

Signed-off-by: Rong Zeng <rongzeng@us.ibm.com>
Signed-off-by: Matt Benjamin <matt@linuxbox.com>
CID#18499 Resource leak

Error handling could lead to a resource leak of
the struct pointed by task if allocation of mul
failed. The fix is a bit longer than the previous
version but it's more readable and avoids a
resource leak.
CID#18466 Missing break in switch

Missing break for LAYOUTRETURN4_FSID case leading
to a fallthrough to the next case.
CID#18465 Missing break in switch

Missing break for case 123 leads to a
fallthrough to the default case used
for error handling.
CID#18453 Explicit null dereferenced

son_owner_val struct member of oname wasn't
initialized before calling memcpy. Thus, leading
to a segfault.
Moreover, this section of the code is only used
if 9P support was activated at build time. oname
isn't used at all in the general case.
CID#18447 Logically dead code

Whatever the course of action, found is set
to TRUE (1) anyway. The last conditionnal
statement isn't needed. This makes the code
a little more simple.
CID#18444 Copy-paste error

Simple typo here, should be mtime instead
of atime.
Fix deadlock on unknown program in UDP

Change is_rpc_call_valid() function to use DISP_SLOCK2 and add a
corresponding DISP_SUNLOCK2 macro.

Signed-off-by: Adam C. Emerson <aemerson@linuxbox.com>
Merge remote-tracking branch 'linuxbox2/next' into merge_next
Merge remote-tracking branch 'tfb-bull/next-pre-2.0-dev_47' into merge_next
Fix MOUNTED_ON_FILEID, setting from export if entry is export root

This is a complete rework of 1.5 patch
6aa4a7800602b2f89a129986b5795bc47c05c8a8

Added mounted_on_fileid parameter to cache_inode_getattr callback.

cache_inode_getattr handles selecting the correct value for
mounted_on_fileid based on the req_ctx and the inode entry.

Call cache_inode_getattr from cache_inode_readdir instead of calling
cache_inode_lock_trust_attrs directly. cache_inode_readdir now does not
have it's own callback, the callback for each entry will come from
cache_inode_getattr. To accomplish this, the readdir callers pass a
common structure to cache_inode_readdir, which will fill in the readdir
entry parameters, and then call cache_inode_getattr. The callback
function will then have both the directory entry items and the
correct attributes with a correct mounted_on_fileid having been passed.

Remove mounted_on_fileid from struct attrlist. Since mounted_on_fileid
is an NFS server attribute and is not at all an underlying filesystem
attribute, it is not appropriate for this attribute to be part of the
FSAL attrlist.

Add mounted_on_fileid to xdr_attrs_args so that it is available to
encode_mounted_on_fileid. nfs4_PseudoToFattr sets this from the
pseudo_id for PsuedoFS READDIR of a non-junction PseudoFS inode.
cache_entry_To_Fattr accomplishes thsi via Fattr_filler which is a
getattr callback function for GETATTR and PseudoFS READDIR of a
junction. nfs4_readdir_callback accomplishes this for all other
READDIR calls.

Note that a PseudoFS junction which resutls in an NFS4ERR_WRONGSEC for
the client attempting to cross, for which the client was just requesting
FATTR4_MOUNTED_ON_FILEID via READDIR of the PseudoFS directory, will
get mounted_on_fileid via nfs4_PseudoToFattr using the "trick" that
the mounted_on_fileid for the junction node is the same as it's fileid.
This is code that will be obsoleted in the future when FSAL_PSEUDO is
introduced as a first class FSAL and junctions are fully supported (in
that case, all junctions will be handled by cache_inode_readdir which
will then have to handle the NFS4ERR_WRONGSEC case - probably by
calling cache_inode_getattr anyway).

Signed-off-by: Frank S. Filz <ffilzlnx@mindspring.com>