linux-spdx.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: [PATCH v3 07/20] sg: move header to uapi section
       [not found] ` <20190807114252.2565-8-dgilbert@interlog.com>
@ 2019-08-12 14:24   ` Christoph Hellwig
  2019-08-12 14:32     ` Greg KH
                       ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Christoph Hellwig @ 2019-08-12 14:24 UTC (permalink / raw)
  To: Douglas Gilbert
  Cc: linux-scsi, martin.petersen, jejb, hare, bvanassche, linux-spdx

[note: question for the linux-spdx audience below]

> -
>  #ifdef __KERNEL__
>  extern int sg_big_buff; /* for sysctl */
>  #endif

FYI, these __KERNEL__ ifdefs in non-uapi headers should go away.

>  
> +/*
> + * In version 3.9.01 of the sg driver, this file was spilt in two, with the
> + * bulk of the user space interface being placed in the file being included
> + * in the following line.
> + */
> +#include <uapi/scsi/sg.h>

Splitting uapi headers is standard practive, no need for the comment,
especially not with a meaningless driver version number.

> diff --git a/include/uapi/scsi/sg.h b/include/uapi/scsi/sg.h
> new file mode 100644
> index 000000000000..072b45bd732f
> --- /dev/null
> +++ b/include/uapi/scsi/sg.h
> @@ -0,0 +1,329 @@
> +/* SPDX-License-Identifier: GPL-2.0 */

This needs the syscall noticed for uapi headers.  FYI, what is our
stance of just adding that notice to headers newly moved to UAPI?
Do we need agreement from everyone who touched the file?  Or just
after we started the split and SPDX annotations, as in this case
this header used to be available to user programs?

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

* Re: [PATCH v3 07/20] sg: move header to uapi section
  2019-08-12 14:24   ` [PATCH v3 07/20] sg: move header to uapi section Christoph Hellwig
@ 2019-08-12 14:32     ` Greg KH
  2019-08-12 14:35     ` James Bottomley
  2019-08-13  0:21     ` Douglas Gilbert
  2 siblings, 0 replies; 4+ messages in thread
From: Greg KH @ 2019-08-12 14:32 UTC (permalink / raw)
  To: Christoph Hellwig
  Cc: Douglas Gilbert, linux-scsi, martin.petersen, jejb, hare,
	bvanassche, linux-spdx

On Mon, Aug 12, 2019 at 07:24:51AM -0700, Christoph Hellwig wrote:
> > diff --git a/include/uapi/scsi/sg.h b/include/uapi/scsi/sg.h
> > new file mode 100644
> > index 000000000000..072b45bd732f
> > --- /dev/null
> > +++ b/include/uapi/scsi/sg.h
> > @@ -0,0 +1,329 @@
> > +/* SPDX-License-Identifier: GPL-2.0 */
> 
> This needs the syscall noticed for uapi headers.  FYI, what is our
> stance of just adding that notice to headers newly moved to UAPI?

Just add them.

> Do we need agreement from everyone who touched the file?  Or just
> after we started the split and SPDX annotations, as in this case
> this header used to be available to user programs?

The license of the entire kernel source is pretty obvious that anything
UABI related needs the dual license, so adding it is fine.

If not, the scripts will notice and we will just end up generating a
patch to fix it anyway :)

thanks,

greg k-h

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

* Re: [PATCH v3 07/20] sg: move header to uapi section
  2019-08-12 14:24   ` [PATCH v3 07/20] sg: move header to uapi section Christoph Hellwig
  2019-08-12 14:32     ` Greg KH
@ 2019-08-12 14:35     ` James Bottomley
  2019-08-13  0:21     ` Douglas Gilbert
  2 siblings, 0 replies; 4+ messages in thread
From: James Bottomley @ 2019-08-12 14:35 UTC (permalink / raw)
  To: Christoph Hellwig, Douglas Gilbert
  Cc: linux-scsi, martin.petersen, hare, bvanassche, linux-spdx

On Mon, 2019-08-12 at 07:24 -0700, Christoph Hellwig wrote:
> [note: question for the linux-spdx audience below]
> 
> > -
> >  #ifdef __KERNEL__
> >  extern int sg_big_buff; /* for sysctl */
> >  #endif
> 
> FYI, these __KERNEL__ ifdefs in non-uapi headers should go away.
> 
> >  
> > +/*
> > + * In version 3.9.01 of the sg driver, this file was spilt in two,
> > with the
> > + * bulk of the user space interface being placed in the file being
> > included
> > + * in the following line.
> > + */
> > +#include <uapi/scsi/sg.h>
> 
> Splitting uapi headers is standard practive, no need for the comment,
> especially not with a meaningless driver version number.
> 
> > diff --git a/include/uapi/scsi/sg.h b/include/uapi/scsi/sg.h
> > new file mode 100644
> > index 000000000000..072b45bd732f
> > --- /dev/null
> > +++ b/include/uapi/scsi/sg.h
> > @@ -0,0 +1,329 @@
> > +/* SPDX-License-Identifier: GPL-2.0 */
> 
> This needs the syscall noticed for uapi headers.  FYI, what is our
> stance of just adding that notice to headers newly moved to UAPI?
> Do we need agreement from everyone who touched the file?  Or just
> after we started the split and SPDX annotations, as in this case
> this header used to be available to user programs?

It's pretty much covered by the original linux COPYING file, which
contains the systemcall exception for everything.  I think our
intention is that this still applies globally, so things can be moved
into the UAPI without additional permissions.

James


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

* Re: [PATCH v3 07/20] sg: move header to uapi section
  2019-08-12 14:24   ` [PATCH v3 07/20] sg: move header to uapi section Christoph Hellwig
  2019-08-12 14:32     ` Greg KH
  2019-08-12 14:35     ` James Bottomley
@ 2019-08-13  0:21     ` Douglas Gilbert
  2 siblings, 0 replies; 4+ messages in thread
From: Douglas Gilbert @ 2019-08-13  0:21 UTC (permalink / raw)
  To: Christoph Hellwig
  Cc: linux-scsi, martin.petersen, jejb, hare, bvanassche, linux-spdx

On 2019-08-12 10:24 a.m., Christoph Hellwig wrote:
> [note: question for the linux-spdx audience below]
> 
>> -
>>   #ifdef __KERNEL__
>>   extern int sg_big_buff; /* for sysctl */
>>   #endif
> 
> FYI, these __KERNEL__ ifdefs in non-uapi headers should go away.

Yes, that could be removed, but perhaps not yet, see below.

>> +/*
>> + * In version 3.9.01 of the sg driver, this file was spilt in two, with the
>> + * bulk of the user space interface being placed in the file being included
>> + * in the following line.
>> + */
>> +#include <uapi/scsi/sg.h>
> 
> Splitting uapi headers is standard practive, no need for the comment,
> especially not with a meaningless driver version number.

The "meaningless driver version number" is in the sg (and bsg and
generalized ioctl(SG_IO)) API via ioctl(SG_GET_VERSION_NUM). All
versions of Windows have driver version numbers. So no, one kernel
version number doesn't tell the full story. FreeBSD implements a
subset of the sg driver, and I hope to expand that. The driver version
number will be useful to differentiate the driver API there too.

My libsgutils library which is under the sg3_utils, sdparm and ddpt
packages now acts on that version number when run on Linux. When it
is between 4.0.0 and 4.0.29 then the driver API as per the end of
this patchset is assumed. If the driver version number is 4.0.30
or above the sg interface as defined here:
http://sg.danny.cz/sg/sg_v40.html  is assumed.

Also version numbers are more human friendly and convey an ordering
unlike git with its handles, for example:
   c578603bab2ec27dd6bb2d38ad4c3fc44423c570
which obviously is this patch.


That comment is a heads up to the GNU library folks who need to
be careful when the publicly visible part of an API is moved from
say include/scsi/sg.h to include/uapi/scsi/sg.h . After that move
and without that __KERNEL__ conditional then user code will break in
compilation if the former (non-uapi) header is accidentally included.
Lack of that conditional will also catch out those who include:
    /lib/modules/<kernel_version>/build/include/scsi/sg.h

Doug Gilbert

>> diff --git a/include/uapi/scsi/sg.h b/include/uapi/scsi/sg.h
>> new file mode 100644
>> index 000000000000..072b45bd732f
>> --- /dev/null
>> +++ b/include/uapi/scsi/sg.h
>> @@ -0,0 +1,329 @@
>> +/* SPDX-License-Identifier: GPL-2.0 */
> 
> This needs the syscall noticed for uapi headers.  FYI, what is our
> stance of just adding that notice to headers newly moved to UAPI?
> Do we need agreement from everyone who touched the file?  Or just
> after we started the split and SPDX annotations, as in this case
> this header used to be available to user programs?
> 


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

end of thread, other threads:[~2019-08-13  0:21 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20190807114252.2565-1-dgilbert@interlog.com>
     [not found] ` <20190807114252.2565-8-dgilbert@interlog.com>
2019-08-12 14:24   ` [PATCH v3 07/20] sg: move header to uapi section Christoph Hellwig
2019-08-12 14:32     ` Greg KH
2019-08-12 14:35     ` James Bottomley
2019-08-13  0:21     ` Douglas Gilbert

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).