@@ -292,6 +292,7 @@ void locks_release_private(struct file_lock *fl)
if (fl->fl_lmops) {
if (fl->fl_lmops->lm_put_owner) {
+ trace_printk("lo=%p type=%d\n", fl->fl_owner, fl->fl_type);
fl->fl_lmops->lm_put_owner(fl->fl_owner,
fl->fl_type == F_UNLCK);
fl->fl_owner = NULL;
@@ -373,8 +374,10 @@ static void locks_copy_conflock(struct file_lock *new, struct file_lock *fl,
new->fl_ops = NULL;
if (fl->fl_lmops) {
- if (fl->fl_lmops->lm_get_owner)
+ if (fl->fl_lmops->lm_get_owner) {
+ trace_printk("lo=%p type=%d\n", fl->fl_owner, fl->fl_type);
fl->fl_lmops->lm_get_owner(fl->fl_owner, lock);
+ }
}
}
@@ -6742,6 +6742,10 @@ nfsd4_lm_get_owner(fl_owner_t owner, bool lock)
nfs4_get_stateowner(&lo->lo_owner);
if (lock)
atomic_inc(&lo->lo_lockcnt);
+ trace_printk("lo=%p lock=%s lockcnt=%d so_count=%d\n",
+ lo, lock ? "true" : "false",
+ atomic_read(&lo->lo_lockcnt),
+ atomic_read(&lo->lo_owner.so_count));
return owner;
}
@@ -6751,6 +6755,10 @@ nfsd4_lm_put_owner(fl_owner_t owner, bool unlock)
struct nfs4_lockowner *lo = (struct nfs4_lockowner *)owner;
if (lo) {
+ trace_printk("lo=%p unlock=%s lockcnt=%d so_count=%d\n",
+ lo, unlock ? "true" : "false",
+ atomic_read(&lo->lo_lockcnt),
+ atomic_read(&lo->lo_owner.so_count));
if (unlock)
atomic_dec(&lo->lo_lockcnt);
nfs4_put_stateowner(&lo->lo_owner);
@@ -7564,6 +7572,8 @@ nfsd4_release_lockowner(struct svc_rqst *rqstp,
continue;
lo = lockowner(sop);
+ trace_printk("lo=%p lockcnt=%d so_count=%d\n",
+ lo, atomic_read(&lo->lo_lockcnt), atomic_read(&sop->so_count));
if (atomic_read(&lo->lo_lockcnt) != 0) {
spin_unlock(&clp->cl_lock);
return nfserr_locks_held;
Signed-off-by: Chuck Lever <chuck.lever@oracle.com> --- fs/locks.c | 5 ++++- fs/nfsd/nfs4state.c | 10 ++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-)