All of lore.kernel.org
 help / color / mirror / Atom feed
From: syzbot <syzbot+355da3b3a74881008e8f@syzkaller.appspotmail.com>
To: linux-kernel@vger.kernel.org
Subject: Re: [syzbot] Re: [syzbot] [jfs?] possible deadlock in diFree (2)
Date: Wed, 18 Dec 2024 18:56:59 -0800	[thread overview]
Message-ID: <67638b7b.050a0220.15da49.0003.GAE@google.com> (raw)
In-Reply-To: <673f2511.050a0220.3c9d61.016e.GAE@google.com>

For archival purposes, forwarding an incoming command email to
linux-kernel@vger.kernel.org.

***

Subject: Re: [syzbot] [jfs?] possible deadlock in diFree (2)
Author: lizhi.xu@windriver.com

In following calltrace, diAlloc and diFree need to hold same ag lock,
so before calling duplicateIXtree(), we maybe unlock it, and relock it after.

 diAlloc()->
   diAllocAG()->
     diAllocExt()->
       diNewIAG()->
         duplicateIXtree()->
	   diFreeSpecial()->
	     evict()->
	       jfs_evict_inode()->
	         diFree()

#syz test

diff --git a/fs/jfs/jfs_imap.c b/fs/jfs/jfs_imap.c
index a360b24ed320..1f47c6e5456b 100644
--- a/fs/jfs/jfs_imap.c
+++ b/fs/jfs/jfs_imap.c
@@ -2594,7 +2594,9 @@ diNewIAG(struct inomap * imap, int *iagnop, int agno, struct metapage ** mpp)
 		txEnd(tid);
 		mutex_unlock(&JFS_IP(ipimap)->commit_mutex);
 
+		AG_UNLOCK(imap, agno);
 		duplicateIXtree(sb, blkno, xlen, &xaddr);
+		AG_LOCK(imap, agno);
 
 		/* update the next available iag number */
 		imap->im_nextiag += 1;

  reply	other threads:[~2024-12-19  2:57 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-21 12:18 [syzbot] [jfs?] possible deadlock in diFree (2) syzbot
2024-12-19  2:56 ` syzbot [this message]
2024-12-19  8:24 ` [syzbot] " syzbot
2024-12-19  8:52 ` syzbot
2024-12-21  7:33 ` [PATCH] jfs: Prevent setting of nlink with value 0 from disk inode Edward Adam Davis
2024-12-24  8:17   ` [PATCH V2] jfs: Prevent copying " Edward Adam Davis
2025-02-19 16:38     ` [Jfs-discussion] " Dave Kleikamp
2025-02-20 11:13       ` [PATCH V3] " Edward Adam Davis
2025-02-20 16:15         ` Dave Kleikamp
2025-02-20 23:22           ` Edward Adam Davis
2025-02-20 23:28             ` Dave Kleikamp
2025-02-22  0:16               ` Edward Adam Davis
2025-02-24 14:56                 ` Dave Kleikamp

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=67638b7b.050a0220.15da49.0003.GAE@google.com \
    --to=syzbot+355da3b3a74881008e8f@syzkaller.appspotmail.com \
    --cc=linux-kernel@vger.kernel.org \
    /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.