2024-01-05 00:10:33

by Stephen Rothwell

[permalink] [raw]
Subject: linux-next: manual merge of the vfs tree with Linus' tree

Hi all,

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

fs/tracefs/inode.c

between commits:

7e8358edf503 ("eventfs: Fix file and directory uid and gid ownership")
ad579864637a ("tracefs: Check for dentry->d_inode exists in set_gid()")

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 bc86ffdb103b,61ca5fcf10f9..000000000000
--- a/fs/tracefs/inode.c
+++ b/fs/tracefs/inode.c
@@@ -207,28 -206,14 +206,25 @@@ 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;
+
+ /* Note, getdents() can add a cursor dentry with no inode */
+ if (!dentry->d_inode)
+ continue;
+
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;


Attachments:
(No filename) (499.00 B)
OpenPGP digital signature

2024-01-05 00:19:23

by Steven Rostedt

[permalink] [raw]
Subject: Re: linux-next: manual merge of the vfs tree with Linus' tree

On Fri, 5 Jan 2024 11:10:16 +1100
Stephen Rothwell <[email protected]> wrote:

> Hi all,
>
> Today's linux-next merge of the vfs tree got a conflict in:
>
> fs/tracefs/inode.c
>
> between commits:
>
> 7e8358edf503 ("eventfs: Fix file and directory uid and gid ownership")
> ad579864637a ("tracefs: Check for dentry->d_inode exists in set_gid()")
>
> 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.
>

> diff --cc fs/tracefs/inode.c
> index bc86ffdb103b,61ca5fcf10f9..000000000000
> --- a/fs/tracefs/inode.c
> +++ b/fs/tracefs/inode.c
> @@@ -207,28 -206,14 +206,25 @@@ static void set_gid(struct dentry *pare

Oh, and this is the code that I'm removing and will be in linux-next soon.

-- Steve


>
> 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;
> +
> + /* Note, getdents() can add a cursor dentry with no inode */
> + if (!dentry->d_inode)
> + continue;
> +
> 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;

2017-11-30 23:36:43

by Stephen Rothwell

[permalink] [raw]
Subject: Re: linux-next: manual merge of the vfs tree with Linus' tree

Hi Al,

On Wed, 29 Nov 2017 10:53:29 +1100 Stephen Rothwell <[email protected]> wrote:
>
> Today's linux-next merge of the vfs tree got conflicts in several files
> due to commit:
>
> 1751e8a6cb93 ("Rename superblock flags (MS_xyz -> SB_xyz)")
>
> from Linus' tree and commit:
>
> c2c6773f9942 ("VFS: Roll out mount flag differentiation (MS_* -> SB_*) generally")
>
> from the vfs tree.
>
> I just dropped the vfs tree for today, can you please clean it up?

Ping?
--
Cheers,
Stephen Rothwell

From 1585356066298948431@xxx Tue Nov 28 23:56:02 +0000 2017
X-GM-THRID: 1585356066298948431
X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread