All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chuck Lever <chuck.lever@oracle.com>
To: linux-nfs@vger.kernel.org
Subject: [PATCH v2 3/6] blargh
Date: Tue, 24 May 2022 14:57:10 -0400	[thread overview]
Message-ID: <165341863069.3187.13887522399281155313.stgit@bazille.1015granger.net> (raw)
In-Reply-To: <165341832236.3187.8388683641228729897.stgit@bazille.1015granger.net>

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(-)

diff --git a/fs/locks.c b/fs/locks.c
index bfeb6c3de03f..80cc410f72b2 100644
--- a/fs/locks.c
+++ b/fs/locks.c
@@ -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);
+		}
 	}
 }
 
diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c
index 7cedb0da888d..dd8749e96c9f 100644
--- a/fs/nfsd/nfs4state.c
+++ b/fs/nfsd/nfs4state.c
@@ -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;



  parent reply	other threads:[~2022-05-24 18:57 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-24 18:56 [PATCH v2 0/6] RELEASE_LOCKOWNER discussion, cont Chuck Lever
2022-05-24 18:56 ` [PATCH v2 1/6] fs/locks.c: Count held file locks Chuck Lever
2022-05-24 18:57 ` [PATCH v2 2/6] NFSD: Fix possible sleep during nfsd4_release_lockowner() Chuck Lever
2022-05-24 18:57 ` Chuck Lever [this message]
2022-05-24 18:57 ` [PATCH v2 4/6] NFSD: Modernize nfsd4_release_lockowner() Chuck Lever
2022-05-24 18:57 ` [PATCH v2 5/6] NFSD: Add documenting comment for nfsd4_release_lockowner() Chuck Lever
2022-05-24 18:57 ` [PATCH v2 6/6] NFSD: nfsd_file_put() can sleep Chuck Lever

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=165341863069.3187.13887522399281155313.stgit@bazille.1015granger.net \
    --to=chuck.lever@oracle.com \
    --cc=linux-nfs@vger.kernel.org \
    --subject='Re: [PATCH v2 3/6] blargh' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.