Fix gpfs config file and init script
cmake rpm isn't used in RHEL, stop requiring it in spec file.
Use atomic inc for new_clientid and new_clientid_verifier

Also correct function name for new_clientid_verifier.

Ported from 1.5 5f67b48645e840c4d502eec440d7e0c3fe26d647

Signed-off-by: Frank S. Filz <ffilz@us.ibm.com>
Temp change to return NFS4ERR_BAD_STATEID before clientid is included in stateid for better judgement

Ported from 1.5 ef7e31d8c9ffca379c5e08d8f06300b949001c9d

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

Ported from 1.5 d213b1dc0193beaf88e184c4481f2f52ac1fe3eb

Signed-off-by: Frank S. Filz <ffilz@us.ibm.com>
Grace period should be >= Lease_lifetime.
For environments which have issues with grace period more than 60 seonds,
Lease_Lifetime in main.conf can be changed to a smaller value.

Ported from 1.5 71249367cdabac404425a74907900c143bd722cb

Signed-off-by: Srikrishan Malik <srimalik@in.ibm.com>
Signed-off-by: Frank S. Filz <ffilz@us.ibm.com>
Convert ETXTBSY to ERR_FSAL_SHARE_DENIED instead of FSAL_FILE_OPEN.
For v4 it will be converted to NFS4ERR_SHARE_DENIED.
For v3 it will be converted to NFS3ER_JUKEBOX, which will allow a client to wait
for the share reservation to be released.

Ported from 1.5 35b1a70bacdc777b4fd2fa056a4753220a7e24c7

Signed-off-by: Srikrishan Malik <srimalik@in.ibm.com>
Signed-off-by: Frank S. Filz <ffilz@us.ibm.com>
Don't allow OPEN of a PseudoFS file

Also, return a better error for nfs_FhandleToCache failures.

Ported from 1.5: 9075bee497b67ec1cd0826cda097d6e0de3cf89a

Signed-off-by: Frank S. Filz <ffilz@us.ibm.com>
Fixed byte range lock merging when up- or downgrading sub-ranges

Ported from 1.5: 44aab46665eee745cda796cd73cd96e34210d644

Signed-off-by: Manfred Haubrich <haubrich@de.ibm.com>
Signed-off-by: Frank S. Filz <ffilz@us.ibm.com>
Fix OPNDG10

Two issues:

1. OPEN CREATE UNGUARDED did not reuse existing state
2. state_share_upgrade did not create union of old access and new access

Signed-off-by: Frank S. Filz <ffilz@us.ibm.com>
Reintroduce -DUSE_TIRPC_IPV6=ON option

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

For open replay, we need to track the directory cache entry pointer not
the resulting file cache entry pointer.

The entry is saved by Copy_nfs4_state_req and checked by
Check_nfs4_seqid when validating a replayed request.

Ported from 1.5: 9d8a485c1b5726919a62a77e453341840b3e81ba

Additional fixes for 2.0:

open4_open_owner returns bool instead of the status, because
Check_nfs4_seqid could return ANY code including NFS4_OK, and if
we got there, then we have a replayed request.

entry_parent needs to be set at the to for use in Copy_nfs4_state_req.

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

It turns out Ganesha really wasn't handling a CLOSE with an invalid
stateid properly. If we detect that the stateid belongs to a valid
clientid, we can return NFS4_OK, but in that case, we must also
update the lease.

We also need to make sure that ONLY CLOSE is affected by this
functionality. V4.1 also handles leases differently.

Signed-off-by: Frank S. Filz <ffilz@us.ibm.com>
Signed-off-by: Venkateswararao Jujjuri "<jvrao@linux.vnet.ibm.com>
Signed-off-by: Frank S. Filz <ffilz@us.ibm.com>
Update 15to20-porting.txt

Signed-off-by: Frank S. Filz <ffilz@us.ibm.com>
Increase number of pseudo fs nodes to 2048 and check limits

Also clean up some dead code.

The limit of 100 pseudo fs nodes is rather insufficient for 1000 exports...

To make it somewhat sane to test, I increased the number of path elements in
a pseudo path to 128.

Moved set up of pseudo fs until after creating root entries. This assures
that the pseudo fs only contains valid exports (previously, an export for
a path that didn't actually exist in the FSAL would be instantiated in the
pseudo fs, and then the export would have been discarded, leaving a dangling
pointer for someone to trip on).

Also improved the logging within the pseudo fs.

Also check pseudofs_id in pseudo fs handle before dereferencing array.

Ported from 1.5: a0de6fb4a764ca4d049436eda750f9f7cce71275

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

Conflicts:

	src/Protocols/NFS/nfs4_Compound.c
	src/Protocols/NFS/nfs4_pseudo.c
	src/include/nfs_exports.h
Fix a bug in export manager

Signed-off-by: Frank S. Filz <ffilz@us.ibm.com>
Fix up READDIR in pseudo fs so it handles NFS4ERR_WRONGSEC properly

Allow READDIR with just MOUNTED_ON_FILEID to succeed even if NFS4ERR_WRONGSEC.

Also clean up some out of memory handling for READDIR, don't bother trying
to recover, just LogFatal.

Ported from 1.5: b37c3372278a5c07a4b6192ebdda4d723648d2d4

Signed-off-by: Frank Filz <ffilz@us.ibm.com>
Signed-off-by: Frank S. Filz <ffilz@us.ibm.com>
Don't check timestamp or length in creds when comparing v4 clientid verifiier

Confirmed ACE's comment. Clients create new creds so timestamp is a problem.

New creds might have a different group list, which changes length of cred, if
we don't care about group list, shouldn't care about cred length either.

Ported from 1.5: 2c309a762a38d58e660783ea7c264de02a3974d7

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