Subject: linux-next: manual merge of the vfs tree with Linus' tree

From: Stephen Rothwell <[email-masked]>
Date: Tue, 2 Jan 2024 09:36:17 +1100

Hi all,

Today's linux-next merge of the vfs tree got a conflict in:

  fs/tracefs/inode.c

between commit:

  7e8358edf503 ("eventfs: Fix file and directory uid and gid ownership")

from Linus' tree and commit:

  da549bdd15c2 ("dentry: switch the lists of children to hlist")

from the vfs tree.

I fixed it up (see below) and can carry the fix as necessary. This
is now fixed as far as linux-next is concerned, but any non trivial
conflicts should be mentioned to your upstream maintainer when your tree
is submitted for merging.  You may also want to consider cooperating
with the maintainer of the conflicting tree to minimise any particularly
complex conflicts.

-- 
Cheers,
Stephen Rothwell

diff --cc fs/tracefs/inode.c
index 62524b20964e,61ca5fcf10f9..000000000000
--- a/fs/tracefs/inode.c
+++ b/fs/tracefs/inode.c
@@@ -207,24 -206,14 +206,21 @@@ static void set_gid(struct dentry *pare
  
  	change_gid(this_parent, gid);
  repeat:
- 	next = this_parent->d_subdirs.next;
+ 	dentry = d_first_child(this_parent);
  resume:
- 	while (next != &this_parent->d_subdirs) {
+ 	hlist_for_each_entry_from(dentry, d_sib) {
 +		struct tracefs_inode *ti;
- 		struct list_head *tmp = next;
- 		struct dentry *dentry = list_entry(tmp, struct dentry, d_child);
- 		next = tmp->next;
 +
  		spin_lock_nested(&dentry->d_lock, DENTRY_D_LOCK_NESTED);
  
  		change_gid(dentry, gid);
  
 +		/* If this is the events directory, update that too */
 +		ti = get_tracefs(dentry->d_inode);
 +		if (ti && (ti->flags & TRACEFS_EVENT_INODE))
 +			eventfs_update_gid(dentry, gid);
 +
- 		if (!list_empty(&dentry->d_subdirs)) {
+ 		if (!hlist_empty(&dentry->d_children)) {
  			spin_unlock(&this_parent->d_lock);
  			spin_release(&dentry->d_lock.dep_map, _RET_IP_);
  			this_parent = dentry;