All of lore.kernel.org
 help / color / mirror / Atom feed
From: Prithvi Tambewagh <activprithvi@gmail.com>
To: syzbot+f6e8174215573a84b797@syzkaller.appspotmail.com
Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org,
	syzkaller-bugs@googlegroups.com,
	Prithvi Tambewagh <activprithvi@gmail.com>
Subject: Testing for v2: configfs: add lock class key to struct configfs_fragment for frag_sem
Date: Wed, 21 Jan 2026 20:32:11 +0530	[thread overview]
Message-ID: <20260121150211.82216-1-activprithvi@gmail.com> (raw)
In-Reply-To: <6767d8ea.050a0220.226966.0021.GAE@google.com>

#syz test upstream 3a8660878839faadb4f1a6dd72c3179c1df56787

Signed-off-by: Prithvi Tambewagh <activprithvi@gmail.com>
---
 fs/configfs/configfs_internal.h | 1 +
 fs/configfs/dir.c               | 6 +++++-
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/fs/configfs/configfs_internal.h b/fs/configfs/configfs_internal.h
index 0b969d0eb8ff..15bcde6c878b 100644
--- a/fs/configfs/configfs_internal.h
+++ b/fs/configfs/configfs_internal.h
@@ -21,6 +21,7 @@
 struct configfs_fragment {
 	atomic_t frag_count;
 	struct rw_semaphore frag_sem;
+	struct lock_class_key frag_sem_key;
 	bool frag_dead;
 };
 
diff --git a/fs/configfs/dir.c b/fs/configfs/dir.c
index 81f4f06bc87e..10c76cef88c9 100644
--- a/fs/configfs/dir.c
+++ b/fs/configfs/dir.c
@@ -163,6 +163,8 @@ static struct configfs_fragment *new_fragment(void)
 	if (p) {
 		atomic_set(&p->frag_count, 1);
 		init_rwsem(&p->frag_sem);
+		lockdep_register_key(&p->frag_sem_key);
+		lockdep_set_class(&p->frag_sem, &p->frag_sem_key);
 		p->frag_dead = false;
 	}
 	return p;
@@ -170,8 +172,10 @@ static struct configfs_fragment *new_fragment(void)
 
 void put_fragment(struct configfs_fragment *frag)
 {
-	if (frag && atomic_dec_and_test(&frag->frag_count))
+	if (frag && atomic_dec_and_test(&frag->frag_count)) {
+		lockdep_unregister_key(&frag->frag_sem_key);
 		kfree(frag);
+	}
 }
 
 struct configfs_fragment *get_fragment(struct configfs_fragment *frag)

base-commit: 3a8660878839faadb4f1a6dd72c3179c1df56787
-- 
2.34.1


  parent reply	other threads:[~2026-01-21 15:02 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-12-22  9:16 [syzbot] [fs?] possible deadlock in __configfs_open_file syzbot
2026-01-08 17:32 ` Syzbot test for fixing recursive locking " Prithvi Tambewagh
2026-01-08 17:58   ` [syzbot] [fs?] possible deadlock " syzbot
2026-01-21 15:02 ` Prithvi Tambewagh [this message]
2026-01-21 15:19   ` syzbot
2026-02-06  9:02 ` Forwarded: Testing for v3: scsi: target: fix recursive locking in __configfs_open_file() syzbot
2026-02-06 16:04 ` syzbot
2026-02-07 10:43 ` Forwarded: Testing for v4: " syzbot
2026-02-08 16:41 ` syzbot
2026-02-09  5:14 ` Forwarded: Testing for v3 " syzbot
2026-02-09  6:05 ` Forwarded: Testing for v4 " syzbot
2026-02-09 14:29 ` Forwarded: Syzbot build test syzbot
2026-02-09 15:01 ` Forwarded: Testing for v4 scsi: target: fix recursive locking in __configfs_open_file() syzbot
2026-02-09 15:37 ` Forwarded: Testing for v4: " syzbot
2026-02-09 15:45 ` Forwarded: Testing for v4 " syzbot
2026-02-10 13:41 ` syzbot
2026-02-10 13:48 ` syzbot
2026-02-10 13:53 ` Forwarded: Testing for v4: " syzbot
2026-02-10 14:00 ` Forwarded: Testing for v4 " syzbot
2026-02-16  4:27 ` syzbot
2026-02-16  5:18 ` syzbot

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=20260121150211.82216-1-activprithvi@gmail.com \
    --to=activprithvi@gmail.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=syzbot+f6e8174215573a84b797@syzkaller.appspotmail.com \
    --cc=syzkaller-bugs@googlegroups.com \
    /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
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.