CID #18461 Double lock in fridgethr_submit

Actually, this is a missing unlock in the error path of fridge_spawn

Signed-off-by: Jim Lieb <jlieb@panasas.com>
Missing err_type set in fsal_commit

Signed-off-by: Jim Lieb <jlieb@panasas.com>
CID #23917 Unchecked return value in release_export_root_locked

Signed-off-by: Jim Lieb <jlieb@panasas.com>
Deprecate exp_state_mutex in exportlist in favor of gsh_export's lock

Convert to the rwlock and eliminate the extra locking confusion.

Signed-off-by: Jim Lieb <jlieb@panasas.com>
Remove improper glist_init usage from exportlist initialization

And use glist_null for assert.  glist_init is only for heads...
Explain it in the header.

Signed-off-by: Jim Lieb <jlieb@panasas.com>
Add asserts for export related lists in put_gsh_export

Make sure the entry is clean before releasing.
Also destroy the rwlock properly.

Signed-off-by: Jim Lieb <jlieb@panasas.com>
CID #24067 Removed logically dead code in get_nfsv_export_total_ops

Signed-off-by: Jim Lieb <jlieb@panasas.com>
Multiple Coverity fixes for illegal access, resource leaks, uninit vars

CID#: 55636, 55637, 30364, 30354, 53509, 53511 per ffilz project build...

Signed-off-by: Jim Lieb <jlieb@panasas.com>
Make a more robust vfs_check_handle

Copy code from vfs_create_handle to use to check handles also
for extract_handle. This will do more checking earlier.

It also sets the stage for checking if a handle has a valid
filesystem for the given export. We won't put that bit in until
we clean up some locking and refcounting though.

Signed-off-by: Frank S. Filz <ffilzlnx@mindspring.com>
Acked-by: Jim Lieb <jlieb@panasas.com>
Convert FSAL module, export, and obj_handle mutexes to rwlocks

Signed-off-by: Frank S. Filz <ffilzlnx@mindspring.com>
Acked-by: Jim Lieb <jlieb@panasas.com>
Cleanup refcounting in FSAL

fsal_module refcounting is now atomic instead of under lock.

fsal_put is now an inline function.

Make sure fsal_put is called in correct places.

fsal_export no longer has a refcount or get/put methofs. fsal_exports
are always attached to an exportlist_t/gsh_export and this the
refcounting on gsh_export is sufficient.

fsal_obj_handle no longer has a refcount or get/put methods.
fsal_obj_handles are either attached to a cache inode, and will be
managed by the cache inode refcount, or are tempory objects that are
immediately released.

Since the return code for release was pretty much never checked for
any of these objects, and most release methods can't actually fail,
all release methods are now void return.

Several fsal_obj_handle methods attempted to deal with making sure
the file was closed. None of the close routines actually fails to
close the file (there may be an error, but for example, the
system call close never fails to release the file descriptor). The
error checking in these cases has been cleaned up.

fsal_obj_handle methods that checked if the file was closed have
been modified to close the file (if the return code from release
wasn't going to be checked, and the caller wasn't going to continue
to reference the fsal_obj_handle, no one would ever close it otherwise).

Signed-off-by: Frank S. Filz <ffilzlnx@mindspring.com>
Acked-by: Jim Lieb <jlieb@panasas.com>
Remove FS_JUNCTION file type

This was never used, and improperly handled.

If in the future we actually need such a type, we can re-introduce it
with proper handling in all places.

Signed-off-by: Frank S. Filz <ffilzlnx@mindspring.com>
Acked-by: Jim Lieb <jlieb@panasas.com>
fsal_filesystem: uses dev_t as the fsid when get_posix_fsid() found (0,0) as fsid for a fileystem

Signed-off-by: Philippe DENIEL <philippe.deniel@cea.fr>
Acked-by: Frank S. Filz <ffilzlnx@mindspring.com>
FSAL_LUSTRE/fsal_file_system: adds what's needed to manage Lustre with fsal_filesystem

This commit integrates changes made after Frank and Malahal's review on github.

Signed-off-by: Philippe DENIEL <philippe.deniel@cea.fr>
Acked-by: Frank S. Filz <ffilzlnx@mindspring.com>
Clean up use of another FSAL's name

Signed-off-by: Frank S. Filz <ffilzlnx@mindspring.com>
Acked-by: Malahal Naineni <malahal@us.ibm.com>
Reviewed-by: Venkateswararao Jujjuri (JV) <jvrao@linux.vnet.ibm.com>
Acked-by: Jim Lieb <jlieb@panasas.com>
FSAL_GLUSTER: fixed few minor issues in lookup_path and glfs_get_volumeid

Signed-off-by: Soumya Koduri <skoduri@redhat.com>
Remove pseudofs nodes

When removing an export, remove unnecessary pseudofs nodes.

Signed-off-by: suhrud <supatank@in.ibm.com>
Signed-off-by: Frank S. Filz <ffilzlnx@mindspring.com>
Merge branch 'dev_next_bugs' into merge_next

Signed-off-by: Jim Lieb <jlieb@panasas.com>
Acked-by: Frank S. Filz <ffilzlnx@mindspring.com>
Add global config param for delegations.

Signed-off-by: Srikrishan Malik <srimalik@in.ibm.com>
cut-paste errors and dead code removal

Signed-off-by: Malahal Naineni <malahal@us.ibm.com>