Re: [PATCH] ocfs2: fix deadlock in dio write orphan cleanup path
From: Deepanshu Kartikey
Date: Sat Jun 20 2026 - 19:26:49 EST
On Sat, Jun 20, 2026 at 11:29 PM Matthew Wilcox <willy@xxxxxxxxxxxxx> wrote:
>
> 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.
>
Thanks for the review. I have sent the patch v2 with
inode_lock_nested(orphan_dir_inode, I_MUTEX_NONDIR2)