All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] staging: lustre: lprocfs_status.h: fix sparse error: symbol redeclared with different type
@ 2016-10-06 16:52 Samuele Baisi
  2016-10-07  3:55 ` Greg KH
  0 siblings, 1 reply; 3+ messages in thread
From: Samuele Baisi @ 2016-10-06 16:52 UTC (permalink / raw)
  To: gregkh; +Cc: devel, linux-kernel, luisbg, Samuele Baisi

drivers/staging/lustre/lustre/obdclass/lprocfs_status.c:1554:5: error:
symbol 'lprocfs_wr_root_squash' redeclared with different type (originally
declared at drivers/staging/lustre/lustre/obdclass/../include/lprocfs_status.h:704)
- incompatible argument 1 (different address spaces)

drivers/staging/lustre/lustre/obdclass/lprocfs_status.c:1618:5: error:
symbol 'lprocfs_wr_nosquash_nids' redeclared with different type (originally
declared at drivers/staging/lustre/lustre/obdclass/../include/lprocfs_status.h:706)
- incompatible argument 1 (different address spaces)

Added __user annotation to the header definitions arguments (which are
indeed userspace buffers).

Signed-off-by: Samuele Baisi <ciccio87@gmail.com>
---
 drivers/staging/lustre/lustre/include/lprocfs_status.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/lustre/lustre/include/lprocfs_status.h b/drivers/staging/lustre/lustre/include/lprocfs_status.h
index cc0713e..b5c24ca 100644
--- a/drivers/staging/lustre/lustre/include/lprocfs_status.h
+++ b/drivers/staging/lustre/lustre/include/lprocfs_status.h
@@ -701,9 +701,9 @@ static struct lustre_attr lustre_attr_##name = __ATTR(name, mode, show, store)
 extern const struct sysfs_ops lustre_sysfs_ops;
 
 struct root_squash_info;
-int lprocfs_wr_root_squash(const char *buffer, unsigned long count,
+int lprocfs_wr_root_squash(const char __user *buffer, unsigned long count,
 			   struct root_squash_info *squash, char *name);
-int lprocfs_wr_nosquash_nids(const char *buffer, unsigned long count,
+int lprocfs_wr_nosquash_nids(const char __user *buffer, unsigned long count,
 			     struct root_squash_info *squash, char *name);
 
 /* all quota proc functions */
-- 
2.9.3

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] staging: lustre: lprocfs_status.h: fix sparse error: symbol redeclared with different type
  2016-10-06 16:52 [PATCH] staging: lustre: lprocfs_status.h: fix sparse error: symbol redeclared with different type Samuele Baisi
@ 2016-10-07  3:55 ` Greg KH
  2016-10-07  8:29   ` Samuele Baisi
  0 siblings, 1 reply; 3+ messages in thread
From: Greg KH @ 2016-10-07  3:55 UTC (permalink / raw)
  To: Samuele Baisi; +Cc: devel, linux-kernel

On Thu, Oct 06, 2016 at 06:52:07PM +0200, Samuele Baisi wrote:
> drivers/staging/lustre/lustre/obdclass/lprocfs_status.c:1554:5: error:
> symbol 'lprocfs_wr_root_squash' redeclared with different type (originally
> declared at drivers/staging/lustre/lustre/obdclass/../include/lprocfs_status.h:704)
> - incompatible argument 1 (different address spaces)
> 
> drivers/staging/lustre/lustre/obdclass/lprocfs_status.c:1618:5: error:
> symbol 'lprocfs_wr_nosquash_nids' redeclared with different type (originally
> declared at drivers/staging/lustre/lustre/obdclass/../include/lprocfs_status.h:706)
> - incompatible argument 1 (different address spaces)
> 
> Added __user annotation to the header definitions arguments (which are
> indeed userspace buffers).

Are they really?  Have you tested this?  The last time this was looked
at, it was a non-trivial problem...

And any reason you didn't cc the lustre maintainers with this change?
If you think it is correct, please resend it with the testing
information and cc: them.

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] staging: lustre: lprocfs_status.h: fix sparse error: symbol redeclared with different type
  2016-10-07  3:55 ` Greg KH
@ 2016-10-07  8:29   ` Samuele Baisi
  0 siblings, 0 replies; 3+ messages in thread
From: Samuele Baisi @ 2016-10-07  8:29 UTC (permalink / raw)
  To: Greg KH; +Cc: devel, linux-kernel



Il giorno ven 7 ott 2016 alle 5:55, Greg KH 
<gregkh@linuxfoundation.org> ha scritto:
> On Thu, Oct 06, 2016 at 06:52:07PM +0200, Samuele Baisi wrote:
>>  drivers/staging/lustre/lustre/obdclass/lprocfs_status.c:1554:5: 
>> error:
>>  symbol 'lprocfs_wr_root_squash' redeclared with different type 
>> (originally
>>  declared at 
>> drivers/staging/lustre/lustre/obdclass/../include/lprocfs_status.h:704)
>>  - incompatible argument 1 (different address spaces)
>> 
>>  drivers/staging/lustre/lustre/obdclass/lprocfs_status.c:1618:5: 
>> error:
>>  symbol 'lprocfs_wr_nosquash_nids' redeclared with different type 
>> (originally
>>  declared at 
>> drivers/staging/lustre/lustre/obdclass/../include/lprocfs_status.h:706)
>>  - incompatible argument 1 (different address spaces)
>> 
>>  Added __user annotation to the header definitions arguments (which 
>> are
>>  indeed userspace buffers).
> 
> Are they really?  Have you tested this?  The last time this was looked
> at, it was a non-trivial problem...

No, I haven't really tested it, I just saw they're treated like 
userspace
buffers (copy_from_user) in the function body.

if (copy_from_user(kernbuf, buffer, count)) {
  errmsg = "bad address";
  rc = -EFAULT;
  goto failed_noprint;
 }

if (copy_from_user(kernbuf, buffer, count)) {
  errmsg = "bad address";
  rc = -EFAULT;
  goto failed;
 }

> And any reason you didn't cc the lustre maintainers with this change?
> If you think it is correct, please resend it with the testing
> information and cc: them.

No, it was a mistake on my part, I thought to CC lustre-devel, but it 
seems not to be
public access and then I forgot to add a Lustre mantainer.

Anyway, I do not think I'm going to have a chanche to really test it, 
so it's probably
better to dismiss the matter.

Sorry for having wasted your time.

> 
> thanks,
> 
> greg k-h

Thank you and best regards.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-10-07  8:32 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-10-06 16:52 [PATCH] staging: lustre: lprocfs_status.h: fix sparse error: symbol redeclared with different type Samuele Baisi
2016-10-07  3:55 ` Greg KH
2016-10-07  8:29   ` Samuele Baisi

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.