Allow v3 to return fileid on READDIR in 444 directory

When a user only has read access in a directory, the client is still
dependent on getting the fileid for each file. If it does not, the
client fails to show any directory entries (other than . and ..).

Unfortunately, for Linux clients, this only works for v3 (other
clients are unknown). v4 Linux client must get all the attributes
or it does not work correctly.

There was also a bug where Ganesha was actually not returning all
the entries.

Signed-off-by: Frank S. Filz <ffilz@us.ibm.com>
Remove the trailing slash in mount export response. Window client
does not seem to like it.

Signed-off-by: Rong Zeng <rongzeng@us.ibm.com>
Crash in nfs_access_op

Attempt to access uninitialized supported_access resulted in SEGFAULT.

Signed-off-by: Venkateswararao Jujjuri "<jvrao@linux.vnet.ibm.com>
Fix directory fd leak.

Signed-off-by: Venkateswararao Jujjuri "<jvrao@linux.vnet.ibm.com>
Change entry to entry_wkref in  cache_inode_dir_entry_t

Signed-off-by: Venkateswararao Jujjuri "<jvrao@linux.vnet.ibm.com>
Avoid getting handle and attr as part of readdir in GPFS FSAL

Signed-off-by: Venkateswararao Jujjuri "<jvrao@linux.vnet.ibm.com>
Signed-off-by: Jeremy Bongio <jbongio@us.ibm.com>
Rearrange readdir codepath to avoid unnecessary duplicate operations.
This patch makes two scans of the dirent cache to remove recently
deleted directory entries.

Signed-off-by: Venkateswararao Jujjuri "<jvrao@linux.vnet.ibm.com>
Signed-off-by: Jeremy Bongio <jbongio@us.ibm.com>
Use a more reasonable readdir entry count estimate for v3.

Signed-off-by: Venkateswararao Jujjuri (JV) <jvrao@linux.vnet.ibm.com>
Add the weakref to dirent in readdir path.

If cache_inode_weakref_get fails we add the entry in the cache through
cache_inode_lookup_weakref, and when that happens add the weakref of
newly created entry to the dirent

Signed-off-by: Venkateswararao Jujjuri "<jvrao@linux.vnet.ibm.com>
Added a new SIGUSR1 handler. On receiving USR1, Ganesha starts Grace.
Removed the old SIGUSR1 and SIGUSR2 handlers

Signed-off-by: Poornima Gupte <poornima.gupte@in.ibm.com>
Signed-off-by: Venkateswararao Jujjuri "<jvrao@linux.vnet.ibm.com>
Make NFSv3 FSID unique/less collision prone
By performing xor on filesystem_id major and rotated minor numbers.
This allows client to mount one export on top of other even if the
major numbers of the exported filesystem is same.

Signed-off-by: Venkateswararao Jujjuri "<jvrao@linux.vnet.ibm.com>
Increase the Ganesha inode cache limit to match the GPFS cache limit.
Done for READDIR performance improvement.

Signed-off-by: suhrud <supatank@in.ibm.com>
This branch will fix RTC defect 16867. The fix will use condition flag inside
while loop in both ptfsal_closeHandle_listener_thread and ptfsal_polling_closeHandler_thread.
In function PTFSAL_terminate, first set the flag to stop above two two thread functions.
Replace pthread_kill with pthread_join for thread g_pthread_closehandle_lisetner.

Signed-off-by: Jeff Huang <huangz@us.ibm.com>
Commit for pt v4.1 rev_10

Signed-off-by: Allison Henderson <achender@vnet.linux.ibm.com>
Make debugging permission checking easier.

Using COMPONENT_NFS_V4_ACL will allow tracing permission checking at
all layers. If it is not turned on, some log messages will go to
COMPONENT_CACHE_INODE or COMPONENT_NFSPROTO.

Signed-off-by: Frank S. Filz <ffilz@us.ibm.com>
Make sure asked_attributes is set when calling cache_inode_getattr

Signed-off-by: Frank S. Filz <ffilz@us.ibm.com>
Fix typos in FSAL/access_check.c

Signed-off-by: Frank S. Filz <ffilz@us.ibm.com>
Add a tool to to permission testing

Signed-off-by: Frank S. Filz <ffilz@us.ibm.com>
Add some debug for cache_inode_rename and cache_inode_remove

Signed-off-by: Frank S. Filz <ffilz@us.ibm.com>
Fix FSAL_MODE_BIT_MASK to ONLY include FSAL_R_OK, FSAL_W_OK, FSAL_X_OK

These are the only permission mask bits that matter for mode checking.

Extra bits caught the new FSAL_ACE4_PERM_CONTINUE flag.

Signed-off-by: Frank S. Filz <ffilz@us.ibm.com>