All of lore.kernel.org
 help / color / mirror / Atom feed
From: Greg KH <gregkh@linuxfoundation.org>
To: Amitoj Kaur Chawla <amitoj1606@gmail.com>
Cc: outreachy-kernel@googlegroups.com
Subject: Re: [Outreachy kernel] [PATCH] staging: lustre: llite: dir: Add __user annotations to remove sparse warnings
Date: Fri, 30 Oct 2015 15:50:11 -0700	[thread overview]
Message-ID: <20151030225011.GA2400@kroah.com> (raw)
In-Reply-To: <20151030220302.GA3803@amitoj-Inspiron-3542>

On Sat, Oct 31, 2015 at 03:33:03AM +0530, Amitoj Kaur Chawla wrote:
> This patch fixes the following multiple sparse warnings by adding
> __user annotations:
> 
> warning: incorrect type in argument 1 (different address spaces)
> expected void [noderef] <asn:1>*to got char *<noident>
> warning: incorrect type in argument 1 (different address spaces)
> expected void [noderef] <asn:1>*to got int *<noident>
> warning: incorrect type in argument 1 (different address spaces)
> expected void [noderef] <asn:1>*to got void *<noident>
> warning: incorrect type in argument 2 (different address spaces)
> expected void const [noderef] <asn:1>*from got struct lov_user_md_v3
> warning: incorrect type in argument 2 (different address spaces)
> expected void const [noderef] <asn:1>*from got struct lov_user_md_v1
> warning: incorrect type in argument 1 (different address spaces)
> expected void const [noderef] <asn:1>*from got const char
> 
> After this patch, there are no more sparse warnings for this file.
> 
> Signed-off-by: Amitoj Kaur Chawla <amitoj1606@gmail.com>
> ---
>  drivers/staging/lustre/lustre/llite/dir.c | 71 ++++++++++++++++---------------
>  1 file changed, 36 insertions(+), 35 deletions(-)
> 
> diff --git a/drivers/staging/lustre/lustre/llite/dir.c b/drivers/staging/lustre/lustre/llite/dir.c
> index cc6f0f5..da91226 100644
> --- a/drivers/staging/lustre/lustre/llite/dir.c
> +++ b/drivers/staging/lustre/lustre/llite/dir.c
> @@ -1244,6 +1244,9 @@ static long ll_dir_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
>  	struct ll_sb_info *sbi = ll_i2sbi(inode);
>  	struct obd_ioctl_data *data;
>  	int rc = 0;
> +	int __user *argi = (int __user *)arg;
> +	void __user *argv = (void __user *)arg;
> +	char __user *argc = (char __user *)arg;

It's impossible to fix up lustre with the correct __user markings,
sorry.  The code is horribly designed and probably wrong in places
(kernel semaphore structures in userspace!), so I would just ignore
these warnings, we can't fix them up until the developers of the code do
the work, it's very non-trivial.

sorry.

greg k-h


  parent reply	other threads:[~2015-10-30 22:50 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-30 22:03 [PATCH] staging: lustre: llite: dir: Add __user annotations to remove sparse warnings Amitoj Kaur Chawla
2015-10-30 22:13 ` [Outreachy kernel] " Julia Lawall
2015-10-30 22:26   ` Amitoj Kaur Chawla
2015-10-30 22:33     ` Arnd Bergmann
2015-10-30 22:50 ` Greg KH [this message]
2015-10-30 22:56   ` Amitoj Kaur Chawla

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=20151030225011.GA2400@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=amitoj1606@gmail.com \
    --cc=outreachy-kernel@googlegroups.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.