mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Greg KH <gregkh@linuxfoundation.org>
To: Ming Lei <ming.lei@canonical.com>
Cc: linux-kernel@vger.kernel.org, Kay Sievers <kay@vrfy.org>
Subject: Re: [PATCH] driver core: add uid and gid to devtmpfs
Date: Wed, 10 Apr 2013 08:56:28 -0700	[thread overview]
Message-ID: <20130410155628.GA14723@kroah.com> (raw)
In-Reply-To: <CACVXFVNctGZ5hs-sBuA8MxO8NJtGkQREURiVJbFRVSO9WLO-JA@mail.gmail.com>

On Wed, Apr 10, 2013 at 05:12:17PM +0800, Ming Lei wrote:
> On Sun, Apr 7, 2013 at 12:56 AM, Greg KH <gregkh@linuxfoundation.org> wrote:
> > @@ -201,14 +206,14 @@ static int handle_create(const char *nod
> >         if (IS_ERR(dentry))
> >                 return PTR_ERR(dentry);
> >
> > -       err = vfs_mknod(path.dentry->d_inode,
> > -                       dentry, mode, dev->devt);
> > +       err = vfs_mknod(path.dentry->d_inode, dentry, mode, dev->devt);
> >         if (!err) {
> >                 struct iattr newattrs;
> >
> > -               /* fixup possibly umasked mode */
> >                 newattrs.ia_mode = mode;
> > -               newattrs.ia_valid = ATTR_MODE;
> > +               newattrs.ia_uid = uid;
> > +               newattrs.ia_gid = gid;
> 
> drivers/base/devtmpfs.c: In function 'handle_create':
> drivers/base/devtmpfs.c:214:19: error: incompatible types when
> assigning to type 'kuid_t' from type 'uid_t'
> drivers/base/devtmpfs.c:215:19: error: incompatible types when
> assigning to type 'kgid_t' from type 'gid_t'
> make[2]: *** [drivers/base/devtmpfs.o] Error 1

I can't duplicate this here, what options am I missing?

> Looks the below patch may fix it.
> --
> diff --git a/drivers/base/devtmpfs.c b/drivers/base/devtmpfs.c
> index fda5256..e268fc5 100644
> --- a/drivers/base/devtmpfs.c
> +++ b/drivers/base/devtmpfs.c
> @@ -211,8 +211,8 @@ static int handle_create(const char *nodename,
> umode_t mode, uid_t uid,
>  		struct iattr newattrs;
> 
>  		newattrs.ia_mode = mode;
> -		newattrs.ia_uid = uid;
> -		newattrs.ia_gid = gid;
> +		newattrs.ia_uid = KUIDT_INIT(uid);
> +		newattrs.ia_gid = KGIDT_INIT(gid);
>  		newattrs.ia_valid = ATTR_MODE|ATTR_UID|ATTR_GID;
>  		mutex_lock(&dentry->d_inode->i_mutex);
>  		notify_change(dentry, &newattrs);
> 

Care to resend this in a format I can apply it in?  :)

thanks,

greg k-h

  reply	other threads:[~2013-04-10 15:56 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-06 16:56 Greg KH
2013-04-06 17:09 ` Al Viro
2013-04-06 17:26   ` Greg KH
2013-04-06 17:45     ` Al Viro
2013-04-06 17:58       ` Greg KH
2013-04-07 16:38         ` Kay Sievers
2013-04-08 18:14 ` Rob Landley
2013-04-08 18:25   ` Greg KH
2013-04-09 15:11     ` Rob Landley
2013-04-11 16:08       ` Greg KH
2013-04-10  9:12 ` Ming Lei
2013-04-10 15:56   ` Greg KH [this message]
2013-04-10 16:07     ` Ming Lei
2013-04-11  4:10 ` Eric W. Biederman
2013-04-11 15:56   ` Greg KH
2013-04-11 15:57     ` Greg KH
2013-04-11 16:31     ` Eric W. Biederman
2013-04-11 16:43     ` Greg KH
2013-04-11 16:50       ` Eric W. Biederman
2013-04-11 16:19   ` Greg KH
2013-04-11 16:41     ` Eric W. Biederman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20130410155628.GA14723@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=kay@vrfy.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=ming.lei@canonical.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome