Thread (43 messages) 43 messages, 4 authors, 2024-01-31

Re: [PATCH 3/6] tracefs: dentry lookup crapectomy

From: Linus Torvalds <torvalds@linux-foundation.org>
Date: 2024-01-31 00:39:40
Also in: lkml

On Tue, 30 Jan 2024 at 16:23, Al Viro [off-list ref] wrote:
On Tue, Jan 30, 2024 at 11:03:52AM -0800, Linus Torvalds wrote:
quoted
 {
      struct eventfs_inode *ei;

-     mutex_lock(&eventfs_mutex);
      do {
              // The parent is stable because we do not do renames
              dentry = dentry->d_parent;
@@ -247,7 +246,6 @@ static struct eventfs_inode *eventfs_find_events(struct dentry *dentry)
              }
              // Walk upwards until you find the events inode
      } while (!ei->is_events);
-     mutex_unlock(&eventfs_mutex);
Unless I'm missing something, you've just lost exclusion with
removals (not that the original hadn't been suspicious in that
respect - what's to protect ei past that mutex_unlock?
No, the mutex is actually taken up the call chain, and removing it
here is fixing a deadlock.

Ie we have the mutex taken in eventfs_root_lookup(), and then that
goes either through lookup_dir_entry() or lookup_file_dentry(), before
it gets to update_inode_attr().

That series is not very clean, I'm afraid.

          Linus
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help