All of lore.kernel.org
 help / color / mirror / Atom feed
From: Matthew Wilcox <willy@infradead.org>
To: Deepanshu Kartikey <kartikey406@gmail.com>
Cc: mark@fasheh.com, jlbec@evilplan.org, joseph.qi@linux.alibaba.com,
	bigeasy@linutronix.de, clrkwllms@kernel.org, rostedt@goodmis.org,
	ocfs2-devel@lists.linux.dev, linux-kernel@vger.kernel.org,
	linux-rt-devel@lists.linux.dev,
	syzbot+ce129763ce7d7e914739@syzkaller.appspotmail.com
Subject: Re: [PATCH] ocfs2: fix deadlock in dio write orphan cleanup path
Date: Sat, 20 Jun 2026 18:59:40 +0100	[thread overview]
Message-ID: <ajbVDMX0mSnLKe2X@casper.infradead.org> (raw)
In-Reply-To: <20260620080802.35165-1-kartikey406@gmail.com>

On Sat, Jun 20, 2026 at 01:38:02PM +0530, Deepanshu Kartikey wrote:
> PREEMPT_RT's rtmutex PI chain walker detected a lock dependency
> cycle in a single thread:
> 
>   ocfs2_file_write_iter()
>     inode_lock(file_inode)             [Lock A]
>       ocfs2_dio_end_io_write()
>         ocfs2_inode_lock()             [Lock B]
>           ocfs2_del_inode_from_orphan()
>             inode_lock(orphan_dir)     [Lock D] <- cycle detected!

This seems like a false positive.  You can't call write_iter() on
a directory, and orphan_dir is always a directory.

I would suggest that the easiest way to make this warning go away is to
replace inode_lock(orphan_dir) with inode_lock_nested(orphan_dir,
I_MUTEX_NONDIR2).  It's a bit quirky because, well, orphan2 is a
directory.  We could add a seventh lock class to
inode_i_mutex_lock_class, but that feels a bit excessive.


  parent reply	other threads:[~2026-06-20 17:59 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-20  8:08 [PATCH] ocfs2: fix deadlock in dio write orphan cleanup path Deepanshu Kartikey
2026-06-20  8:20 ` sashiko-bot
2026-06-20 17:59 ` Matthew Wilcox [this message]
2026-06-20 23:26   ` Deepanshu Kartikey

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=ajbVDMX0mSnLKe2X@casper.infradead.org \
    --to=willy@infradead.org \
    --cc=bigeasy@linutronix.de \
    --cc=clrkwllms@kernel.org \
    --cc=jlbec@evilplan.org \
    --cc=joseph.qi@linux.alibaba.com \
    --cc=kartikey406@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rt-devel@lists.linux.dev \
    --cc=mark@fasheh.com \
    --cc=ocfs2-devel@lists.linux.dev \
    --cc=rostedt@goodmis.org \
    --cc=syzbot+ce129763ce7d7e914739@syzkaller.appspotmail.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.