nfs_Create should use attribute from fsal instead of attr from request for post_op_attr.

Signed-off-by: Rong Zeng <rongzeng@us.ibm.com>
Waiting locks should be resubmitted only when coming out of grace.
This will give enough time for reclaim of conflicting locks which were taken
from another node which has released the locks due to a server restart.

Signed-off-by: Srikrishan Malik <srimalik@in.ibm.com>
AIX client expects NFS4ERR_SAME from NVERIFY replies if same.
Encoding GROUP@ name in ACL

The code does not check if the group id is special id.
This leads to mapping the special "GROUP@" name to system gid 2.
Fixed to first check for special id while encoding the group name.

Signed-off-by: suhrud <supatank@in.ibm.com>
Use integer uid/gid name as string

if uid/gid to name mapping fails, then convert the integer uid/gid to string.
Use the id string as name in response to get_attr.

Signed-off-by: suhrud <supatank@in.ibm.com>
NFSv3 fails to reacquire locks after network partition

Signed-off-by: Rick Mesta <rmesta@us.ibm.com>
Grace period check in v4 setattr.

Signed-off-by: suhrud <supatank@in.ibm.com>
Check for group_id bit in ACE flag
instead of comparing the complete flag value.

Signed-off-by: suhrud <supatank@in.ibm.com>
Let the FSAL decide for how much time it goes in grace
,based on the ganesha grace duration.

Signed-off-by: Srikrishan Malik <srimalik@in.ibm.com>
Revert "NFSv3 fails to reacquire locks after network partition"

This reverts commit 6345569f94e3758919666baf067612ce8d47ce77.
Add lock in nfs-ganesha.gpfs.init to avoid the race where multiple threads edit
epochfile at the sametime, and corrupt it as a result.

Signed-off-by: Rong Zeng <rongzeng@us.ibm.com>
We cannot set garray to NULL. it is dynamically allocated.
Also, we can't free it because later we may have to restore it!!
Start grace as soon as IP movement is detected.

Signed-off-by: Poornima Gupte <poornima.gupte@in.ibm.com>
Network attach/detach can assign the IP to any node, including the same
node it got detached from.
If ip gets assigned to different node:
- Client contacts the new node and the epoch from clientid is going to
  differ from that of the server node's. In this case server returns
  STALE_CLIENT_ID and forces client to reclaim their locks.
- If the ip gets assgined to same node, epochs are going to be same
  and server can't find the clientid in its hash table. This results in
  EXPIRED_CLIENT_ID and forcing client not to reclaim. The fix is for
  this case.

Fix: Keep the clientid in the hash table marking it stale. On the first
  attempt to use that client id, delete it from the hash and return
  STALE_CLIENT_ID, this allows client to reclaim locks after
  establishing new clientid.

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