Re: [GIT PULL] Driver core patches for 4.19-rc1

From: Greg KH
Date: Sat Aug 18 2018 - 12:01:08 EST


On Sat, Aug 18, 2018 at 05:57:58PM +0200, Greg KH wrote:
> The following changes since commit acb1872577b346bd15ab3a3f8dff780d6cca4b70:
>
> Linux 4.18-rc7 (2018-07-29 14:44:52 -0700)
>
> are available in the Git repository at:
>
> git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core.git tags/driver-core-4.19-rc1
>
> for you to fetch changes up to d2fc88a61b4ea99f574bde16e92718e22f312136:
>
> Merge 4.18-rc7 into driver-core-next (2018-07-30 10:08:09 +0200)
>
> ----------------------------------------------------------------
> Driver core patches for 4.19-rc1
>
> Here are all of the driver core and related patches for 4.19-rc1.
>
> ZNothing huge here, just a number of small cleanups and the ability to
> now stop the deferred probing after init happens.
>
> All of these have been in linux-next for a while with only a merge issue
> reported. That merge issue is in fs/sysfs/group.c and Stephen has
> posted the diff of what it should be to resolve this. I'll follow up
> with that diff to this pull request.

Here's Stephen's email with the merge resolution that Rajat verified is
correct:

------------
Date: Mon, 23 Jul 2018 15:12:24 +1000
From: Stephen Rothwell <sfr@xxxxxxxxxxxxxxxx>
To: Greg KH <greg@xxxxxxxxx>, David Miller <davem@xxxxxxxxxxxxx>, Networking
<netdev@xxxxxxxxxxxxxxx>
Cc: Linux-Next Mailing List <linux-next@xxxxxxxxxxxxxxx>, Linux Kernel Mailing
List <linux-kernel@xxxxxxxxxxxxxxx>, Dmitry Torokhov
<dmitry.torokhov@xxxxxxxxx>, Rajat Jain <rajatja@xxxxxxxxxx>
Subject: linux-next: manual merge of the driver-core tree with the net-next
tree

Hi Greg,

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

fs/sysfs/group.c

between commit:

5f81880d5204 ("sysfs, kobject: allow creating kobject belonging to arbitrary users")

from the net-next tree and commit:

c855cf2759d2 ("sysfs: Fix internal_create_group() for named group updates")

from the driver-core tree.

I fixed it up (I think - 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/sysfs/group.c
index c7a716c4acc9,38240410f831..000000000000
--- a/fs/sysfs/group.c
+++ b/fs/sysfs/group.c
@@@ -122,15 -118,23 +122,24 @@@ static int internal_create_group(struc
kobj->name, grp->name ?: "");
return -EINVAL;
}
+ kobject_get_ownership(kobj, &uid, &gid);
if (grp->name) {
- kn = kernfs_create_dir_ns(kobj->sd, grp->name,
- S_IRWXU | S_IRUGO | S_IXUGO,
- uid, gid, kobj, NULL);
- if (IS_ERR(kn)) {
- if (PTR_ERR(kn) == -EEXIST)
- sysfs_warn_dup(kobj->sd, grp->name);
- return PTR_ERR(kn);
+ if (update) {
+ kn = kernfs_find_and_get(kobj->sd, grp->name);
+ if (!kn) {
+ pr_warn("Can't update unknown attr grp name: %s/%s\n",
+ kobj->name, grp->name);
+ return -EINVAL;
+ }
+ } else {
- kn = kernfs_create_dir(kobj->sd, grp->name,
- S_IRWXU | S_IRUGO | S_IXUGO,
- kobj);
++ kn = kernfs_create_dir_ns(kobj->sd, grp->name,
++ S_IRWXU | S_IRUGO | S_IXUGO,
++ uid, gid, kobj, NULL);
+ if (IS_ERR(kn)) {
+ if (PTR_ERR(kn) == -EEXIST)
+ sysfs_warn_dup(kobj->sd, grp->name);
+ return PTR_ERR(kn);
+ }
}
} else
kn = kobj->sd;