nfsv4: lock_owner is by client, not by filehandle
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>libnfs-4.0.0-vitalif
parent
208dd08039
commit
09f8a621fb
|
@ -295,6 +295,7 @@ struct nfs_context {
|
|||
uint64_t clientid;
|
||||
verifier4 setclientid_confirm;
|
||||
uint32_t seqid;
|
||||
int has_lock_owner;
|
||||
};
|
||||
|
||||
typedef int (*continue_func)(struct nfs_context *nfs, struct nfs_attr *attr,
|
||||
|
@ -382,7 +383,6 @@ struct nfsfh {
|
|||
/* NFSv4 */
|
||||
struct stateid stateid;
|
||||
/* locking */
|
||||
int has_lock;
|
||||
uint32_t lock_seqid;
|
||||
struct stateid lock_stateid;
|
||||
};
|
||||
|
|
|
@ -903,7 +903,7 @@ nfs4_op_lock(struct nfs_context *nfs, nfs_argop4 *op, struct nfsfh *fh,
|
|||
largs->offset = offset;
|
||||
largs->length = length;
|
||||
|
||||
if (fh->has_lock) {
|
||||
if (nfs->has_lock_owner) {
|
||||
largs->locker.new_lock_owner = 0;
|
||||
largs->locker.locker4_u.lock_owner.lock_stateid.seqid =
|
||||
fh->lock_stateid.seqid;
|
||||
|
@ -3903,7 +3903,7 @@ nfs4_lockf_cb(struct rpc_context *rpc, int status, void *command_data,
|
|||
}
|
||||
|
||||
lresok = &res->resarray.resarray_val[i].nfs_resop4_u.oplock.LOCK4res_u.resok4;
|
||||
fh->has_lock = 1;
|
||||
nfs->has_lock_owner = 1;
|
||||
fh->lock_stateid.seqid = lresok->lock_stateid.seqid;
|
||||
memcpy(fh->lock_stateid.other, lresok->lock_stateid.other, 12);
|
||||
break;
|
||||
|
|
Loading…
Reference in New Issue