From: Dan Carpenter <dan.carpenter@oracle.com>
To: Tolga Ceylan <tolga.ceylan@gmail.com>
Cc: Oleg Drokin <oleg.drokin@intel.com>,
Andreas Dilger <andreas.dilger@intel.com>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Julia Lawall <Julia.Lawall@lip6.fr>,
Greg Donald <gdonald@gmail.com>,
aybuke ozdemir <aybuke.147@gmail.com>,
Al Viro <viro@zeniv.linux.org.uk>,
Tina Johnson <tinajohnson.1234@gmail.com>,
Joe Perches <joe@perches.com>,
HPDD-discuss@ml01.01.org, devel@driverdev.osuosl.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/1] staging: lustre/lustre/llite: get rid of incorrect type warning
Date: Thu, 11 Jun 2015 12:11:20 +0300 [thread overview]
Message-ID: <20150611091120.GH28762@mwanda> (raw)
In-Reply-To: <1433804517-7709-1-git-send-email-tolga.ceylan@gmail.com>
On Mon, Jun 08, 2015 at 04:01:57PM -0700, Tolga Ceylan wrote:
> In dir.c and llite_lib.c, sparse reports multiple warnings messages
> due to different address spaces. This patch resolves these warnings
> by adding the tag __user for username addresses.
>
> Signed-off-by: Tolga Ceylan <tolga.ceylan@gmail.com>
> ---
> drivers/staging/lustre/lustre/llite/dir.c | 78 +++++++++++++------------
> drivers/staging/lustre/lustre/llite/llite_lib.c | 8 +--
> 2 files changed, 45 insertions(+), 41 deletions(-)
>
> diff --git a/drivers/staging/lustre/lustre/llite/dir.c b/drivers/staging/lustre/lustre/llite/dir.c
> index 4b0de8d..0441c20 100644
> --- a/drivers/staging/lustre/lustre/llite/dir.c
> +++ b/drivers/staging/lustre/lustre/llite/dir.c
> @@ -1258,7 +1258,7 @@ static long ll_dir_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
> return ll_iocontrol(inode, file, cmd, arg);
> case FSFILT_IOC_GETVERSION_OLD:
> case FSFILT_IOC_GETVERSION:
> - return put_user(inode->i_generation, (int *)arg);
> + return put_user(inode->i_generation, (int __user *)arg);
I have looked at this briefly and I think the correct fix is to make
ll_dir_ioctl() take a void __user *arg instead of an unsigned long arg.
Of course, doing that will introduce more sparse warnings, but those are
correct warnings and we should be warned about them.
Maybe start at the lower level functions like obd_ioctl_getdata() and
obd_ioctl_popdata() and add annotations then work up to the big
functions like ll_dir_ioctl().
We shouldn't be introducing these little casts throughout.
regards,
dan carpenter
prev parent reply other threads:[~2015-06-11 9:11 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-06-08 23:01 [PATCH 1/1] staging: lustre/lustre/llite: get rid of incorrect type warning Tolga Ceylan
2015-06-11 0:48 ` Greg Kroah-Hartman
2015-06-11 8:08 ` Tolga Ceylan
2015-06-12 16:04 ` [HPDD-discuss] " Simmons, James A.
2015-06-11 9:11 ` Dan Carpenter [this message]
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=20150611091120.GH28762@mwanda \
--to=dan.carpenter@oracle.com \
--cc=HPDD-discuss@ml01.01.org \
--cc=Julia.Lawall@lip6.fr \
--cc=andreas.dilger@intel.com \
--cc=aybuke.147@gmail.com \
--cc=devel@driverdev.osuosl.org \
--cc=gdonald@gmail.com \
--cc=gregkh@linuxfoundation.org \
--cc=joe@perches.com \
--cc=linux-kernel@vger.kernel.org \
--cc=oleg.drokin@intel.com \
--cc=tinajohnson.1234@gmail.com \
--cc=tolga.ceylan@gmail.com \
--cc=viro@zeniv.linux.org.uk \
/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