mbox series

[v2,0/4] dedupe smb unicode files

Message ID 20230628232417.120844-1-linux@treblig.org (mailing list archive)
Headers show
Series dedupe smb unicode files | expand

Message

Dr. David Alan Gilbert June 28, 2023, 11:24 p.m. UTC
From: "Dr. David Alan Gilbert" <linux@treblig.org>

The smb client and server code have (mostly) duplicated code
for unicode manipulation, in particular upper case handling.

Flatten this lot into shared code.

There's some code that's slightly different between the two, and
I've not attempted to share that - this should be strictly a no
behaviour change set.

In addition, the same tables and code are shared in jfs, however
there's very little testing available for the unicode in there,
so just share the raw data tables.

I suspect there's more UCS-2 code that can be shared, in the NLS code
and in the UCS-2 code used by the EFI interfaces.

Lightly tested with a module and a monolithic build, and just mounting
itself.

This dupe was found using PMD:
  https://pmd.github.io/pmd/pmd_userdocs_cpd.html

Dave

Version 2
  Moved the shared code to fs/nls after v1 feedback.
  Renamed shared tables from Smb to Nls prefix
  Move UniStrcat as well
  Share the JFS tables

Dr. David Alan Gilbert (4):
  fs/smb: Remove unicode 'lower' tables
  fs/smb: Swing unicode common code from smb->NLS
  fs/smb/client: Use common code in client
  fs/jfs: Use common ucs2 upper case table

 fs/jfs/Kconfig               |   1 +
 fs/jfs/Makefile              |   2 +-
 fs/jfs/jfs_unicode.h         |  17 +-
 fs/jfs/jfs_uniupr.c          | 121 -------------
 fs/nls/Kconfig               |   8 +
 fs/nls/Makefile              |   1 +
 fs/nls/nls_ucs2_data.h       |  15 ++
 fs/nls/nls_ucs2_utils.c      | 144 +++++++++++++++
 fs/nls/nls_ucs2_utils.h      | 285 ++++++++++++++++++++++++++++++
 fs/smb/client/Kconfig        |   1 +
 fs/smb/client/cifs_unicode.c |   1 -
 fs/smb/client/cifs_unicode.h | 330 +----------------------------------
 fs/smb/client/cifs_uniupr.h  | 239 -------------------------
 fs/smb/server/Kconfig        |   1 +
 fs/smb/server/unicode.c      |   1 -
 fs/smb/server/unicode.h      | 325 +---------------------------------
 fs/smb/server/uniupr.h       | 268 ----------------------------
 17 files changed, 467 insertions(+), 1293 deletions(-)
 delete mode 100644 fs/jfs/jfs_uniupr.c
 create mode 100644 fs/nls/nls_ucs2_data.h
 create mode 100644 fs/nls/nls_ucs2_utils.c
 create mode 100644 fs/nls/nls_ucs2_utils.h
 delete mode 100644 fs/smb/client/cifs_uniupr.h
 delete mode 100644 fs/smb/server/uniupr.h

Comments

Dr. David Alan Gilbert July 12, 2023, 11:17 p.m. UTC | #1
* linux@treblig.org (linux@treblig.org) wrote:
> From: "Dr. David Alan Gilbert" <linux@treblig.org>
> 
> The smb client and server code have (mostly) duplicated code
> for unicode manipulation, in particular upper case handling.
> 
> Flatten this lot into shared code.

Gentle two week ping on this please.

Dave

(Apologies to the 3 of you who already got a copy of this ping,
recent due to a missing header ',' )

> There's some code that's slightly different between the two, and
> I've not attempted to share that - this should be strictly a no
> behaviour change set.
> 
> In addition, the same tables and code are shared in jfs, however
> there's very little testing available for the unicode in there,
> so just share the raw data tables.
> 
> I suspect there's more UCS-2 code that can be shared, in the NLS code
> and in the UCS-2 code used by the EFI interfaces.
> 
> Lightly tested with a module and a monolithic build, and just mounting
> itself.
> 
> This dupe was found using PMD:
>   https://pmd.github.io/pmd/pmd_userdocs_cpd.html
> 
> Dave
> 
> Version 2
>   Moved the shared code to fs/nls after v1 feedback.
>   Renamed shared tables from Smb to Nls prefix
>   Move UniStrcat as well
>   Share the JFS tables
> 
> Dr. David Alan Gilbert (4):
>   fs/smb: Remove unicode 'lower' tables
>   fs/smb: Swing unicode common code from smb->NLS
>   fs/smb/client: Use common code in client
>   fs/jfs: Use common ucs2 upper case table
> 
>  fs/jfs/Kconfig               |   1 +
>  fs/jfs/Makefile              |   2 +-
>  fs/jfs/jfs_unicode.h         |  17 +-
>  fs/jfs/jfs_uniupr.c          | 121 -------------
>  fs/nls/Kconfig               |   8 +
>  fs/nls/Makefile              |   1 +
>  fs/nls/nls_ucs2_data.h       |  15 ++
>  fs/nls/nls_ucs2_utils.c      | 144 +++++++++++++++
>  fs/nls/nls_ucs2_utils.h      | 285 ++++++++++++++++++++++++++++++
>  fs/smb/client/Kconfig        |   1 +
>  fs/smb/client/cifs_unicode.c |   1 -
>  fs/smb/client/cifs_unicode.h | 330 +----------------------------------
>  fs/smb/client/cifs_uniupr.h  | 239 -------------------------
>  fs/smb/server/Kconfig        |   1 +
>  fs/smb/server/unicode.c      |   1 -
>  fs/smb/server/unicode.h      | 325 +---------------------------------
>  fs/smb/server/uniupr.h       | 268 ----------------------------
>  17 files changed, 467 insertions(+), 1293 deletions(-)
>  delete mode 100644 fs/jfs/jfs_uniupr.c
>  create mode 100644 fs/nls/nls_ucs2_data.h
>  create mode 100644 fs/nls/nls_ucs2_utils.c
>  create mode 100644 fs/nls/nls_ucs2_utils.h
>  delete mode 100644 fs/smb/client/cifs_uniupr.h
>  delete mode 100644 fs/smb/server/uniupr.h
> 
> -- 
> 2.41.0
>
Steve French July 19, 2023, 5:56 p.m. UTC | #2
No objections to this on my part.  If Shaggy is ok with the JFS
change, we could target it for 6.6-rc1 if it tests out ok

On Wed, Jul 12, 2023 at 6:28 PM Dr. David Alan Gilbert <dave@treblig.org> wrote:
>
> * linux@treblig.org (linux@treblig.org) wrote:
> > From: "Dr. David Alan Gilbert" <linux@treblig.org>
> >
> > The smb client and server code have (mostly) duplicated code
> > for unicode manipulation, in particular upper case handling.
> >
> > Flatten this lot into shared code.
>
> Gentle two week ping on this please.
>
> Dave
>
> (Apologies to the 3 of you who already got a copy of this ping,
> recent due to a missing header ',' )
>
> > There's some code that's slightly different between the two, and
> > I've not attempted to share that - this should be strictly a no
> > behaviour change set.
> >
> > In addition, the same tables and code are shared in jfs, however
> > there's very little testing available for the unicode in there,
> > so just share the raw data tables.
> >
> > I suspect there's more UCS-2 code that can be shared, in the NLS code
> > and in the UCS-2 code used by the EFI interfaces.
> >
> > Lightly tested with a module and a monolithic build, and just mounting
> > itself.
> >
> > This dupe was found using PMD:
> >   https://pmd.github.io/pmd/pmd_userdocs_cpd.html
> >
> > Dave
> >
> > Version 2
> >   Moved the shared code to fs/nls after v1 feedback.
> >   Renamed shared tables from Smb to Nls prefix
> >   Move UniStrcat as well
> >   Share the JFS tables
> >
> > Dr. David Alan Gilbert (4):
> >   fs/smb: Remove unicode 'lower' tables
> >   fs/smb: Swing unicode common code from smb->NLS
> >   fs/smb/client: Use common code in client
> >   fs/jfs: Use common ucs2 upper case table
> >
> >  fs/jfs/Kconfig               |   1 +
> >  fs/jfs/Makefile              |   2 +-
> >  fs/jfs/jfs_unicode.h         |  17 +-
> >  fs/jfs/jfs_uniupr.c          | 121 -------------
> >  fs/nls/Kconfig               |   8 +
> >  fs/nls/Makefile              |   1 +
> >  fs/nls/nls_ucs2_data.h       |  15 ++
> >  fs/nls/nls_ucs2_utils.c      | 144 +++++++++++++++
> >  fs/nls/nls_ucs2_utils.h      | 285 ++++++++++++++++++++++++++++++
> >  fs/smb/client/Kconfig        |   1 +
> >  fs/smb/client/cifs_unicode.c |   1 -
> >  fs/smb/client/cifs_unicode.h | 330 +----------------------------------
> >  fs/smb/client/cifs_uniupr.h  | 239 -------------------------
> >  fs/smb/server/Kconfig        |   1 +
> >  fs/smb/server/unicode.c      |   1 -
> >  fs/smb/server/unicode.h      | 325 +---------------------------------
> >  fs/smb/server/uniupr.h       | 268 ----------------------------
> >  17 files changed, 467 insertions(+), 1293 deletions(-)
> >  delete mode 100644 fs/jfs/jfs_uniupr.c
> >  create mode 100644 fs/nls/nls_ucs2_data.h
> >  create mode 100644 fs/nls/nls_ucs2_utils.c
> >  create mode 100644 fs/nls/nls_ucs2_utils.h
> >  delete mode 100644 fs/smb/client/cifs_uniupr.h
> >  delete mode 100644 fs/smb/server/uniupr.h
> >
> > --
> > 2.41.0
> >
> --
>  -----Open up your eyes, open up your mind, open up your code -------
> / Dr. David Alan Gilbert    |       Running GNU/Linux       | Happy  \
> \        dave @ treblig.org |                               | In Hex /
>  \ _________________________|_____ http://www.treblig.org   |_______/
Steve French July 19, 2023, 6:02 p.m. UTC | #3
The related question is which tree to send it from, if no problems
reported (presumably mine since it mostly affect cifs.ko and ksmbd.ko,
and because there hasn't been activity in fs/nls for years)

On Wed, Jul 19, 2023 at 12:56 PM Steve French <smfrench@gmail.com> wrote:
>
> No objections to this on my part.  If Shaggy is ok with the JFS
> change, we could target it for 6.6-rc1 if it tests out ok
>
> On Wed, Jul 12, 2023 at 6:28 PM Dr. David Alan Gilbert <dave@treblig.org> wrote:
> >
> > * linux@treblig.org (linux@treblig.org) wrote:
> > > From: "Dr. David Alan Gilbert" <linux@treblig.org>
> > >
> > > The smb client and server code have (mostly) duplicated code
> > > for unicode manipulation, in particular upper case handling.
> > >
> > > Flatten this lot into shared code.
> >
> > Gentle two week ping on this please.
> >
> > Dave
> >
> > (Apologies to the 3 of you who already got a copy of this ping,
> > recent due to a missing header ',' )
> >
> > > There's some code that's slightly different between the two, and
> > > I've not attempted to share that - this should be strictly a no
> > > behaviour change set.
> > >
> > > In addition, the same tables and code are shared in jfs, however
> > > there's very little testing available for the unicode in there,
> > > so just share the raw data tables.
> > >
> > > I suspect there's more UCS-2 code that can be shared, in the NLS code
> > > and in the UCS-2 code used by the EFI interfaces.
> > >
> > > Lightly tested with a module and a monolithic build, and just mounting
> > > itself.
> > >
> > > This dupe was found using PMD:
> > >   https://pmd.github.io/pmd/pmd_userdocs_cpd.html
> > >
> > > Dave
> > >
> > > Version 2
> > >   Moved the shared code to fs/nls after v1 feedback.
> > >   Renamed shared tables from Smb to Nls prefix
> > >   Move UniStrcat as well
> > >   Share the JFS tables
> > >
> > > Dr. David Alan Gilbert (4):
> > >   fs/smb: Remove unicode 'lower' tables
> > >   fs/smb: Swing unicode common code from smb->NLS
> > >   fs/smb/client: Use common code in client
> > >   fs/jfs: Use common ucs2 upper case table
> > >
> > >  fs/jfs/Kconfig               |   1 +
> > >  fs/jfs/Makefile              |   2 +-
> > >  fs/jfs/jfs_unicode.h         |  17 +-
> > >  fs/jfs/jfs_uniupr.c          | 121 -------------
> > >  fs/nls/Kconfig               |   8 +
> > >  fs/nls/Makefile              |   1 +
> > >  fs/nls/nls_ucs2_data.h       |  15 ++
> > >  fs/nls/nls_ucs2_utils.c      | 144 +++++++++++++++
> > >  fs/nls/nls_ucs2_utils.h      | 285 ++++++++++++++++++++++++++++++
> > >  fs/smb/client/Kconfig        |   1 +
> > >  fs/smb/client/cifs_unicode.c |   1 -
> > >  fs/smb/client/cifs_unicode.h | 330 +----------------------------------
> > >  fs/smb/client/cifs_uniupr.h  | 239 -------------------------
> > >  fs/smb/server/Kconfig        |   1 +
> > >  fs/smb/server/unicode.c      |   1 -
> > >  fs/smb/server/unicode.h      | 325 +---------------------------------
> > >  fs/smb/server/uniupr.h       | 268 ----------------------------
> > >  17 files changed, 467 insertions(+), 1293 deletions(-)
> > >  delete mode 100644 fs/jfs/jfs_uniupr.c
> > >  create mode 100644 fs/nls/nls_ucs2_data.h
> > >  create mode 100644 fs/nls/nls_ucs2_utils.c
> > >  create mode 100644 fs/nls/nls_ucs2_utils.h
> > >  delete mode 100644 fs/smb/client/cifs_uniupr.h
> > >  delete mode 100644 fs/smb/server/uniupr.h
> > >
> > > --
> > > 2.41.0
> > >
> > --
> >  -----Open up your eyes, open up your mind, open up your code -------
> > / Dr. David Alan Gilbert    |       Running GNU/Linux       | Happy  \
> > \        dave @ treblig.org |                               | In Hex /
> >  \ _________________________|_____ http://www.treblig.org   |_______/
>
>
>
> --
> Thanks,
>
> Steve



--
Thanks,

Steve
Dr. David Alan Gilbert July 19, 2023, 9:58 p.m. UTC | #4
* Steve French (smfrench@gmail.com) wrote:
> The related question is which tree to send it from, if no problems
> reported (presumably mine since it mostly affect cifs.ko and ksmbd.ko,
> and because there hasn't been activity in fs/nls for years)

That was my hope, given that ~half of the patches are directly on that
code, and it's the only very active tree this touches as far as I can
tell.

> On Wed, Jul 19, 2023 at 12:56 PM Steve French <smfrench@gmail.com> wrote:
> >
> > No objections to this on my part.  If Shaggy is ok with the JFS
> > change, we could target it for 6.6-rc1 if it tests out ok

Thanks.

Dave

> > On Wed, Jul 12, 2023 at 6:28 PM Dr. David Alan Gilbert <dave@treblig.org> wrote:
> > >
> > > * linux@treblig.org (linux@treblig.org) wrote:
> > > > From: "Dr. David Alan Gilbert" <linux@treblig.org>
> > > >
> > > > The smb client and server code have (mostly) duplicated code
> > > > for unicode manipulation, in particular upper case handling.
> > > >
> > > > Flatten this lot into shared code.
> > >
> > > Gentle two week ping on this please.
> > >
> > > Dave
> > >
> > > (Apologies to the 3 of you who already got a copy of this ping,
> > > recent due to a missing header ',' )
> > >
> > > > There's some code that's slightly different between the two, and
> > > > I've not attempted to share that - this should be strictly a no
> > > > behaviour change set.
> > > >
> > > > In addition, the same tables and code are shared in jfs, however
> > > > there's very little testing available for the unicode in there,
> > > > so just share the raw data tables.
> > > >
> > > > I suspect there's more UCS-2 code that can be shared, in the NLS code
> > > > and in the UCS-2 code used by the EFI interfaces.
> > > >
> > > > Lightly tested with a module and a monolithic build, and just mounting
> > > > itself.
> > > >
> > > > This dupe was found using PMD:
> > > >   https://pmd.github.io/pmd/pmd_userdocs_cpd.html
> > > >
> > > > Dave
> > > >
> > > > Version 2
> > > >   Moved the shared code to fs/nls after v1 feedback.
> > > >   Renamed shared tables from Smb to Nls prefix
> > > >   Move UniStrcat as well
> > > >   Share the JFS tables
> > > >
> > > > Dr. David Alan Gilbert (4):
> > > >   fs/smb: Remove unicode 'lower' tables
> > > >   fs/smb: Swing unicode common code from smb->NLS
> > > >   fs/smb/client: Use common code in client
> > > >   fs/jfs: Use common ucs2 upper case table
> > > >
> > > >  fs/jfs/Kconfig               |   1 +
> > > >  fs/jfs/Makefile              |   2 +-
> > > >  fs/jfs/jfs_unicode.h         |  17 +-
> > > >  fs/jfs/jfs_uniupr.c          | 121 -------------
> > > >  fs/nls/Kconfig               |   8 +
> > > >  fs/nls/Makefile              |   1 +
> > > >  fs/nls/nls_ucs2_data.h       |  15 ++
> > > >  fs/nls/nls_ucs2_utils.c      | 144 +++++++++++++++
> > > >  fs/nls/nls_ucs2_utils.h      | 285 ++++++++++++++++++++++++++++++
> > > >  fs/smb/client/Kconfig        |   1 +
> > > >  fs/smb/client/cifs_unicode.c |   1 -
> > > >  fs/smb/client/cifs_unicode.h | 330 +----------------------------------
> > > >  fs/smb/client/cifs_uniupr.h  | 239 -------------------------
> > > >  fs/smb/server/Kconfig        |   1 +
> > > >  fs/smb/server/unicode.c      |   1 -
> > > >  fs/smb/server/unicode.h      | 325 +---------------------------------
> > > >  fs/smb/server/uniupr.h       | 268 ----------------------------
> > > >  17 files changed, 467 insertions(+), 1293 deletions(-)
> > > >  delete mode 100644 fs/jfs/jfs_uniupr.c
> > > >  create mode 100644 fs/nls/nls_ucs2_data.h
> > > >  create mode 100644 fs/nls/nls_ucs2_utils.c
> > > >  create mode 100644 fs/nls/nls_ucs2_utils.h
> > > >  delete mode 100644 fs/smb/client/cifs_uniupr.h
> > > >  delete mode 100644 fs/smb/server/uniupr.h
> > > >
> > > > --
> > > > 2.41.0
> > > >
> > > --
> > >  -----Open up your eyes, open up your mind, open up your code -------
> > > / Dr. David Alan Gilbert    |       Running GNU/Linux       | Happy  \
> > > \        dave @ treblig.org |                               | In Hex /
> > >  \ _________________________|_____ http://www.treblig.org   |_______/
> >
> >
> >
> > --
> > Thanks,
> >
> > Steve
> 
> 
> 
> --
> Thanks,
> 
> Steve
Dave Kleikamp July 19, 2023, 10:06 p.m. UTC | #5
On 7/19/23 4:58PM, Dr. David Alan Gilbert wrote:
> * Steve French (smfrench@gmail.com) wrote:
>> The related question is which tree to send it from, if no problems
>> reported (presumably mine since it mostly affect cifs.ko and ksmbd.ko,
>> and because there hasn't been activity in fs/nls for years)
> 
> That was my hope, given that ~half of the patches are directly on that
> code, and it's the only very active tree this touches as far as I can
> tell.
> 
>> On Wed, Jul 19, 2023 at 12:56 PM Steve French <smfrench@gmail.com> wrote:
>>>
>>> No objections to this on my part.  If Shaggy is ok with the JFS
>>> change, we could target it for 6.6-rc1 if it tests out ok

For the series:
Reviewed-by: Dave Kleikamp <dave.kleikamp@oracle.com>

Steve,
Feel free to pull in even the 4th patch into your tree with my consent. 
Or if you're more comfortable, I could submit it after yours hits mainline.

Shaggy

> 
> Thanks.
> 
> Dave
> 
>>> On Wed, Jul 12, 2023 at 6:28 PM Dr. David Alan Gilbert <dave@treblig.org> wrote:
>>>>
>>>> * linux@treblig.org (linux@treblig.org) wrote:
>>>>> From: "Dr. David Alan Gilbert" <linux@treblig.org>
>>>>>
>>>>> The smb client and server code have (mostly) duplicated code
>>>>> for unicode manipulation, in particular upper case handling.
>>>>>
>>>>> Flatten this lot into shared code.
>>>>
>>>> Gentle two week ping on this please.
>>>>
>>>> Dave
>>>>
>>>> (Apologies to the 3 of you who already got a copy of this ping,
>>>> recent due to a missing header ',' )
>>>>
>>>>> There's some code that's slightly different between the two, and
>>>>> I've not attempted to share that - this should be strictly a no
>>>>> behaviour change set.
>>>>>
>>>>> In addition, the same tables and code are shared in jfs, however
>>>>> there's very little testing available for the unicode in there,
>>>>> so just share the raw data tables.
>>>>>
>>>>> I suspect there's more UCS-2 code that can be shared, in the NLS code
>>>>> and in the UCS-2 code used by the EFI interfaces.
>>>>>
>>>>> Lightly tested with a module and a monolithic build, and just mounting
>>>>> itself.
>>>>>
>>>>> This dupe was found using PMD:
>>>>>    https://pmd.github.io/pmd/pmd_userdocs_cpd.html
>>>>>
>>>>> Dave
>>>>>
>>>>> Version 2
>>>>>    Moved the shared code to fs/nls after v1 feedback.
>>>>>    Renamed shared tables from Smb to Nls prefix
>>>>>    Move UniStrcat as well
>>>>>    Share the JFS tables
>>>>>
>>>>> Dr. David Alan Gilbert (4):
>>>>>    fs/smb: Remove unicode 'lower' tables
>>>>>    fs/smb: Swing unicode common code from smb->NLS
>>>>>    fs/smb/client: Use common code in client
>>>>>    fs/jfs: Use common ucs2 upper case table
>>>>>
>>>>>   fs/jfs/Kconfig               |   1 +
>>>>>   fs/jfs/Makefile              |   2 +-
>>>>>   fs/jfs/jfs_unicode.h         |  17 +-
>>>>>   fs/jfs/jfs_uniupr.c          | 121 -------------
>>>>>   fs/nls/Kconfig               |   8 +
>>>>>   fs/nls/Makefile              |   1 +
>>>>>   fs/nls/nls_ucs2_data.h       |  15 ++
>>>>>   fs/nls/nls_ucs2_utils.c      | 144 +++++++++++++++
>>>>>   fs/nls/nls_ucs2_utils.h      | 285 ++++++++++++++++++++++++++++++
>>>>>   fs/smb/client/Kconfig        |   1 +
>>>>>   fs/smb/client/cifs_unicode.c |   1 -
>>>>>   fs/smb/client/cifs_unicode.h | 330 +----------------------------------
>>>>>   fs/smb/client/cifs_uniupr.h  | 239 -------------------------
>>>>>   fs/smb/server/Kconfig        |   1 +
>>>>>   fs/smb/server/unicode.c      |   1 -
>>>>>   fs/smb/server/unicode.h      | 325 +---------------------------------
>>>>>   fs/smb/server/uniupr.h       | 268 ----------------------------
>>>>>   17 files changed, 467 insertions(+), 1293 deletions(-)
>>>>>   delete mode 100644 fs/jfs/jfs_uniupr.c
>>>>>   create mode 100644 fs/nls/nls_ucs2_data.h
>>>>>   create mode 100644 fs/nls/nls_ucs2_utils.c
>>>>>   create mode 100644 fs/nls/nls_ucs2_utils.h
>>>>>   delete mode 100644 fs/smb/client/cifs_uniupr.h
>>>>>   delete mode 100644 fs/smb/server/uniupr.h
>>>>>
>>>>> --
>>>>> 2.41.0
>>>>>
>>>> --
>>>>   -----Open up your eyes, open up your mind, open up your code -------
>>>> / Dr. David Alan Gilbert    |       Running GNU/Linux       | Happy  \
>>>> \        dave @ treblig.org |                               | In Hex /
>>>>   \ _________________________|_____ http://www.treblig.org   |_______/
>>>
>>>
>>>
>>> --
>>> Thanks,
>>>
>>> Steve
>>
>>
>>
>> --
>> Thanks,
>>
>> Steve
Tom Talpey July 20, 2023, 2:25 p.m. UTC | #6
On 7/19/2023 6:06 PM, Dave Kleikamp wrote:
> On 7/19/23 4:58PM, Dr. David Alan Gilbert wrote:
>> * Steve French (smfrench@gmail.com) wrote:
>>> The related question is which tree to send it from, if no problems
>>> reported (presumably mine since it mostly affect cifs.ko and ksmbd.ko,
>>> and because there hasn't been activity in fs/nls for years)
>>
>> That was my hope, given that ~half of the patches are directly on that
>> code, and it's the only very active tree this touches as far as I can
>> tell.
>>
>>> On Wed, Jul 19, 2023 at 12:56 PM Steve French <smfrench@gmail.com> 
>>> wrote:
>>>>
>>>> No objections to this on my part.  If Shaggy is ok with the JFS
>>>> change, we could target it for 6.6-rc1 if it tests out ok
> 
> For the series:
> Reviewed-by: Dave Kleikamp <dave.kleikamp@oracle.com>
> 
> Steve,
> Feel free to pull in even the 4th patch into your tree with my consent. 
> Or if you're more comfortable, I could submit it after yours hits mainline.
> 
> Shaggy

The changes look good to me but there is one quirk with the
copyrights and SPDX in patch 2.

In the new fs/nls/nls_ucs2_utils.c, the SPDX line changes from
a "/* ... */" form to "// ...", which may be a proper update, but
then partway down, adds the same SPDX in "/* ... */ form. These
should at least be consistent.

> +++ b/fs/nls/nls_ucs2_utils.c
> @@ -1,19 +1,25 @@
> -/* SPDX-License-Identifier: GPL-2.0-or-later */
> +// SPDX-License-Identifier: GPL-2.0-or-later

vs

> +++ b/fs/nls/nls_ucs2_utils.h
> @@ -0,0 +1,297 @@
> +/* SPDX-License-Identifier: GPL-2.0-or-later */

Second, the copyright in fs/nls/nls_ucs2_utils.c is a bit of
a mash-up (adding 2009 especially).

I think it's better to keep the exact text of both copyrights,
perhaps with a note as to which files had them previously, and
adding some new note/blank line to separate the recent contributions
from Namjae and you from the ancient history.

> +++ b/fs/nls/nls_ucs2_utils.c
> ...
> - *   Some of the source code in this file came from fs/cifs/uniupr.h
> - *   Copyright (c) International Business Machines  Corp., 2000,2002
> - *
> - * uniupr.h - Unicode compressed case ranges
> + *   Some of the source code in this file came from fs/cifs/cifs_unicode.c
> + *   via fs/smb/unicode.c and fs/smb/uniupr.h and fs/cifs/uniupr.h
> + *   Copyright (c) International Business Machines  Corp., 2000,2002,2009
> + *   Modified by Steve French (sfrench@us.ibm.com)
> + *   Modified by Namjae Jeon (linkinjeon@kernel.org)
> + *   Modified by Dr. David Alan Gilbert <linux@treblig.org>

Apart from considering these:

Reviewed-by: Tom Talpey <tom@talpey.com>

Nice work!

>>
>> Thanks.
>>
>> Dave
>>
>>>> On Wed, Jul 12, 2023 at 6:28 PM Dr. David Alan Gilbert 
>>>> <dave@treblig.org> wrote:
>>>>>
>>>>> * linux@treblig.org (linux@treblig.org) wrote:
>>>>>> From: "Dr. David Alan Gilbert" <linux@treblig.org>
>>>>>>
>>>>>> The smb client and server code have (mostly) duplicated code
>>>>>> for unicode manipulation, in particular upper case handling.
>>>>>>
>>>>>> Flatten this lot into shared code.
>>>>>
>>>>> Gentle two week ping on this please.
>>>>>
>>>>> Dave
>>>>>
>>>>> (Apologies to the 3 of you who already got a copy of this ping,
>>>>> recent due to a missing header ',' )
>>>>>
>>>>>> There's some code that's slightly different between the two, and
>>>>>> I've not attempted to share that - this should be strictly a no
>>>>>> behaviour change set.
>>>>>>
>>>>>> In addition, the same tables and code are shared in jfs, however
>>>>>> there's very little testing available for the unicode in there,
>>>>>> so just share the raw data tables.
>>>>>>
>>>>>> I suspect there's more UCS-2 code that can be shared, in the NLS code
>>>>>> and in the UCS-2 code used by the EFI interfaces.
>>>>>>
>>>>>> Lightly tested with a module and a monolithic build, and just 
>>>>>> mounting
>>>>>> itself.
>>>>>>
>>>>>> This dupe was found using PMD:
>>>>>>    https://pmd.github.io/pmd/pmd_userdocs_cpd.html
>>>>>>
>>>>>> Dave
>>>>>>
>>>>>> Version 2
>>>>>>    Moved the shared code to fs/nls after v1 feedback.
>>>>>>    Renamed shared tables from Smb to Nls prefix
>>>>>>    Move UniStrcat as well
>>>>>>    Share the JFS tables
>>>>>>
>>>>>> Dr. David Alan Gilbert (4):
>>>>>>    fs/smb: Remove unicode 'lower' tables
>>>>>>    fs/smb: Swing unicode common code from smb->NLS
>>>>>>    fs/smb/client: Use common code in client
>>>>>>    fs/jfs: Use common ucs2 upper case table
>>>>>>
>>>>>>   fs/jfs/Kconfig               |   1 +
>>>>>>   fs/jfs/Makefile              |   2 +-
>>>>>>   fs/jfs/jfs_unicode.h         |  17 +-
>>>>>>   fs/jfs/jfs_uniupr.c          | 121 -------------
>>>>>>   fs/nls/Kconfig               |   8 +
>>>>>>   fs/nls/Makefile              |   1 +
>>>>>>   fs/nls/nls_ucs2_data.h       |  15 ++
>>>>>>   fs/nls/nls_ucs2_utils.c      | 144 +++++++++++++++
>>>>>>   fs/nls/nls_ucs2_utils.h      | 285 ++++++++++++++++++++++++++++++
>>>>>>   fs/smb/client/Kconfig        |   1 +
>>>>>>   fs/smb/client/cifs_unicode.c |   1 -
>>>>>>   fs/smb/client/cifs_unicode.h | 330 
>>>>>> +----------------------------------
>>>>>>   fs/smb/client/cifs_uniupr.h  | 239 -------------------------
>>>>>>   fs/smb/server/Kconfig        |   1 +
>>>>>>   fs/smb/server/unicode.c      |   1 -
>>>>>>   fs/smb/server/unicode.h      | 325 
>>>>>> +---------------------------------
>>>>>>   fs/smb/server/uniupr.h       | 268 ----------------------------
>>>>>>   17 files changed, 467 insertions(+), 1293 deletions(-)
>>>>>>   delete mode 100644 fs/jfs/jfs_uniupr.c
>>>>>>   create mode 100644 fs/nls/nls_ucs2_data.h
>>>>>>   create mode 100644 fs/nls/nls_ucs2_utils.c
>>>>>>   create mode 100644 fs/nls/nls_ucs2_utils.h
>>>>>>   delete mode 100644 fs/smb/client/cifs_uniupr.h
>>>>>>   delete mode 100644 fs/smb/server/uniupr.h
>>>>>>
>>>>>> -- 
>>>>>> 2.41.0
>>>>>>
>>>>> -- 
>>>>>   -----Open up your eyes, open up your mind, open up your code -------
>>>>> / Dr. David Alan Gilbert    |       Running GNU/Linux       | Happy  \
>>>>> \        dave @ treblig.org |                               | In Hex /
>>>>>   \ _________________________|_____ http://www.treblig.org   |_______/
>>>>
>>>>
>>>>
>>>> -- 
>>>> Thanks,
>>>>
>>>> Steve
>>>
>>>
>>>
>>> -- 
>>> Thanks,
>>>
>>> Steve
>
Dr. David Alan Gilbert July 20, 2023, 11:57 p.m. UTC | #7
* Tom Talpey (tom@talpey.com) wrote:
> On 7/19/2023 6:06 PM, Dave Kleikamp wrote:
> > On 7/19/23 4:58PM, Dr. David Alan Gilbert wrote:
> > > * Steve French (smfrench@gmail.com) wrote:
> > > > The related question is which tree to send it from, if no problems
> > > > reported (presumably mine since it mostly affect cifs.ko and ksmbd.ko,
> > > > and because there hasn't been activity in fs/nls for years)
> > > 
> > > That was my hope, given that ~half of the patches are directly on that
> > > code, and it's the only very active tree this touches as far as I can
> > > tell.
> > > 
> > > > On Wed, Jul 19, 2023 at 12:56 PM Steve French
> > > > <smfrench@gmail.com> wrote:
> > > > > 
> > > > > No objections to this on my part.  If Shaggy is ok with the JFS
> > > > > change, we could target it for 6.6-rc1 if it tests out ok
> > 
> > For the series:
> > Reviewed-by: Dave Kleikamp <dave.kleikamp@oracle.com>
> > 
> > Steve,
> > Feel free to pull in even the 4th patch into your tree with my consent.
> > Or if you're more comfortable, I could submit it after yours hits
> > mainline.
> > 
> > Shaggy
> 
> The changes look good to me but there is one quirk with the
> copyrights and SPDX in patch 2.
> 
> In the new fs/nls/nls_ucs2_utils.c, the SPDX line changes from
> a "/* ... */" form to "// ...", which may be a proper update, but
> then partway down, adds the same SPDX in "/* ... */ form. These
> should at least be consistent.
> 
> > +++ b/fs/nls/nls_ucs2_utils.c
> > @@ -1,19 +1,25 @@
> > -/* SPDX-License-Identifier: GPL-2.0-or-later */
> > +// SPDX-License-Identifier: GPL-2.0-or-later
> 
> vs
> 
> > +++ b/fs/nls/nls_ucs2_utils.h
> > @@ -0,0 +1,297 @@
> > +/* SPDX-License-Identifier: GPL-2.0-or-later */

Yeh that's an easy fix - so that's just the fact the .h has
the older /* where I'd fixed up the .c ?

> Second, the copyright in fs/nls/nls_ucs2_utils.c is a bit of
> a mash-up (adding 2009 especially).
> 
> I think it's better to keep the exact text of both copyrights,
> perhaps with a note as to which files had them previously, and
> adding some new note/blank line to separate the recent contributions
> from Namjae and you from the ancient history.

How about the following;

 * This file has taken chunks from a few other files
 * smb/server/uniupr.h had the declaration:
 *
 *   Some of the source code in this file came from fs/cifs/uniupr.h
 *   Copyright (c) International Business Machines  Corp., 2000,2002
 *
 * fs/smb/server/unicode.c had the declaration:
 *
 *   Some of the source code in this file came from fs/cifs/cifs_unicode.c
 *
 *   Copyright (c) International Business Machines  Corp., 2000,2009
 *   Modified by Steve French (sfrench@us.ibm.com)
 *   Modified by Namjae Jeon (linkinjeon@kernel.org)
 *

I haven't added the extra line above Namjae's line, since it's now
a straight copy from the unicode.c entry.
I'm not particularly fussed about adding my own line unless you think
it's needed; git keeps better history!

> > +++ b/fs/nls/nls_ucs2_utils.c
> > ...
> > - *   Some of the source code in this file came from fs/cifs/uniupr.h
> > - *   Copyright (c) International Business Machines  Corp., 2000,2002
> > - *
> > - * uniupr.h - Unicode compressed case ranges
> > + *   Some of the source code in this file came from fs/cifs/cifs_unicode.c
> > + *   via fs/smb/unicode.c and fs/smb/uniupr.h and fs/cifs/uniupr.h
> > + *   Copyright (c) International Business Machines  Corp., 2000,2002,2009
> > + *   Modified by Steve French (sfrench@us.ibm.com)
> > + *   Modified by Namjae Jeon (linkinjeon@kernel.org)
> > + *   Modified by Dr. David Alan Gilbert <linux@treblig.org>
> 
> Apart from considering these:
> 
> Reviewed-by: Tom Talpey <tom@talpey.com>

Thanks!

Dave

> Nice work!
> 
> > > 
> > > Thanks.
> > > 
> > > Dave
> > > 
> > > > > On Wed, Jul 12, 2023 at 6:28 PM Dr. David Alan Gilbert
> > > > > <dave@treblig.org> wrote:
> > > > > > 
> > > > > > * linux@treblig.org (linux@treblig.org) wrote:
> > > > > > > From: "Dr. David Alan Gilbert" <linux@treblig.org>
> > > > > > > 
> > > > > > > The smb client and server code have (mostly) duplicated code
> > > > > > > for unicode manipulation, in particular upper case handling.
> > > > > > > 
> > > > > > > Flatten this lot into shared code.
> > > > > > 
> > > > > > Gentle two week ping on this please.
> > > > > > 
> > > > > > Dave
> > > > > > 
> > > > > > (Apologies to the 3 of you who already got a copy of this ping,
> > > > > > recent due to a missing header ',' )
> > > > > > 
> > > > > > > There's some code that's slightly different between the two, and
> > > > > > > I've not attempted to share that - this should be strictly a no
> > > > > > > behaviour change set.
> > > > > > > 
> > > > > > > In addition, the same tables and code are shared in jfs, however
> > > > > > > there's very little testing available for the unicode in there,
> > > > > > > so just share the raw data tables.
> > > > > > > 
> > > > > > > I suspect there's more UCS-2 code that can be shared, in the NLS code
> > > > > > > and in the UCS-2 code used by the EFI interfaces.
> > > > > > > 
> > > > > > > Lightly tested with a module and a monolithic build,
> > > > > > > and just mounting
> > > > > > > itself.
> > > > > > > 
> > > > > > > This dupe was found using PMD:
> > > > > > >    https://pmd.github.io/pmd/pmd_userdocs_cpd.html
> > > > > > > 
> > > > > > > Dave
> > > > > > > 
> > > > > > > Version 2
> > > > > > >    Moved the shared code to fs/nls after v1 feedback.
> > > > > > >    Renamed shared tables from Smb to Nls prefix
> > > > > > >    Move UniStrcat as well
> > > > > > >    Share the JFS tables
> > > > > > > 
> > > > > > > Dr. David Alan Gilbert (4):
> > > > > > >    fs/smb: Remove unicode 'lower' tables
> > > > > > >    fs/smb: Swing unicode common code from smb->NLS
> > > > > > >    fs/smb/client: Use common code in client
> > > > > > >    fs/jfs: Use common ucs2 upper case table
> > > > > > > 
> > > > > > >   fs/jfs/Kconfig               |   1 +
> > > > > > >   fs/jfs/Makefile              |   2 +-
> > > > > > >   fs/jfs/jfs_unicode.h         |  17 +-
> > > > > > >   fs/jfs/jfs_uniupr.c          | 121 -------------
> > > > > > >   fs/nls/Kconfig               |   8 +
> > > > > > >   fs/nls/Makefile              |   1 +
> > > > > > >   fs/nls/nls_ucs2_data.h       |  15 ++
> > > > > > >   fs/nls/nls_ucs2_utils.c      | 144 +++++++++++++++
> > > > > > >   fs/nls/nls_ucs2_utils.h      | 285 ++++++++++++++++++++++++++++++
> > > > > > >   fs/smb/client/Kconfig        |   1 +
> > > > > > >   fs/smb/client/cifs_unicode.c |   1 -
> > > > > > >   fs/smb/client/cifs_unicode.h | 330
> > > > > > > +----------------------------------
> > > > > > >   fs/smb/client/cifs_uniupr.h  | 239 -------------------------
> > > > > > >   fs/smb/server/Kconfig        |   1 +
> > > > > > >   fs/smb/server/unicode.c      |   1 -
> > > > > > >   fs/smb/server/unicode.h      | 325
> > > > > > > +---------------------------------
> > > > > > >   fs/smb/server/uniupr.h       | 268 ----------------------------
> > > > > > >   17 files changed, 467 insertions(+), 1293 deletions(-)
> > > > > > >   delete mode 100644 fs/jfs/jfs_uniupr.c
> > > > > > >   create mode 100644 fs/nls/nls_ucs2_data.h
> > > > > > >   create mode 100644 fs/nls/nls_ucs2_utils.c
> > > > > > >   create mode 100644 fs/nls/nls_ucs2_utils.h
> > > > > > >   delete mode 100644 fs/smb/client/cifs_uniupr.h
> > > > > > >   delete mode 100644 fs/smb/server/uniupr.h
> > > > > > > 
> > > > > > > -- 
> > > > > > > 2.41.0
> > > > > > > 
> > > > > > -- 
> > > > > >   -----Open up your eyes, open up your mind, open up your code -------
> > > > > > / Dr. David Alan Gilbert    |       Running GNU/Linux       | Happy  \
> > > > > > \        dave @ treblig.org |                               | In Hex /
> > > > > >   \ _________________________|_____ http://www.treblig.org   |_______/
> > > > > 
> > > > > 
> > > > > 
> > > > > -- 
> > > > > Thanks,
> > > > > 
> > > > > Steve
> > > > 
> > > > 
> > > > 
> > > > -- 
> > > > Thanks,
> > > > 
> > > > Steve
> >
Tom Talpey July 21, 2023, 1:19 p.m. UTC | #8
On 7/20/2023 7:57 PM, Dr. David Alan Gilbert wrote:
> * Tom Talpey (tom@talpey.com) wrote:
>> On 7/19/2023 6:06 PM, Dave Kleikamp wrote:
>>> On 7/19/23 4:58PM, Dr. David Alan Gilbert wrote:
>>>> * Steve French (smfrench@gmail.com) wrote:
>>>>> The related question is which tree to send it from, if no problems
>>>>> reported (presumably mine since it mostly affect cifs.ko and ksmbd.ko,
>>>>> and because there hasn't been activity in fs/nls for years)
>>>>
>>>> That was my hope, given that ~half of the patches are directly on that
>>>> code, and it's the only very active tree this touches as far as I can
>>>> tell.
>>>>
>>>>> On Wed, Jul 19, 2023 at 12:56 PM Steve French
>>>>> <smfrench@gmail.com> wrote:
>>>>>>
>>>>>> No objections to this on my part.  If Shaggy is ok with the JFS
>>>>>> change, we could target it for 6.6-rc1 if it tests out ok
>>>
>>> For the series:
>>> Reviewed-by: Dave Kleikamp <dave.kleikamp@oracle.com>
>>>
>>> Steve,
>>> Feel free to pull in even the 4th patch into your tree with my consent.
>>> Or if you're more comfortable, I could submit it after yours hits
>>> mainline.
>>>
>>> Shaggy
>>
>> The changes look good to me but there is one quirk with the
>> copyrights and SPDX in patch 2.
>>
>> In the new fs/nls/nls_ucs2_utils.c, the SPDX line changes from
>> a "/* ... */" form to "// ...", which may be a proper update, but
>> then partway down, adds the same SPDX in "/* ... */ form. These
>> should at least be consistent.
>>
>>> +++ b/fs/nls/nls_ucs2_utils.c
>>> @@ -1,19 +1,25 @@
>>> -/* SPDX-License-Identifier: GPL-2.0-or-later */
>>> +// SPDX-License-Identifier: GPL-2.0-or-later
>>
>> vs
>>
>>> +++ b/fs/nls/nls_ucs2_utils.h
>>> @@ -0,0 +1,297 @@
>>> +/* SPDX-License-Identifier: GPL-2.0-or-later */
> 
> Yeh that's an easy fix - so that's just the fact the .h has
> the older /* where I'd fixed up the .c ?

Yep, for consistency that sounds good.

>> Second, the copyright in fs/nls/nls_ucs2_utils.c is a bit of
>> a mash-up (adding 2009 especially).
>>
>> I think it's better to keep the exact text of both copyrights,
>> perhaps with a note as to which files had them previously, and
>> adding some new note/blank line to separate the recent contributions
>> from Namjae and you from the ancient history.
> 
> How about the following;
> 
>   * This file has taken chunks from a few other files
>   * smb/server/uniupr.h had the declaration:

These two lines above aren't needed, because the lines below
contain the copyright and where they originated. So just omit
the two above.

>   *
>   *   Some of the source code in this file came from fs/cifs/uniupr.h
>   *   Copyright (c) International Business Machines  Corp., 2000,2002
>   *
>   * fs/smb/server/unicode.c had the declaration:

And this one above - not needed.

>   *
>   *   Some of the source code in this file came from fs/cifs/cifs_unicode.c
>   *
>   *   Copyright (c) International Business Machines  Corp., 2000,2009
>   *   Modified by Steve French (sfrench@us.ibm.com)
>   *   Modified by Namjae Jeon (linkinjeon@kernel.org)
>   *
> 
> I haven't added the extra line above Namjae's line, since it's now
> a straight copy from the unicode.c entry.

Straight copy is what's important. No deletion, no edit in a copyright.
So, ok.

> I'm not particularly fussed about adding my own line unless you think
> it's needed; git keeps better history!

In fact, since you technically didn't add any code, just deleted,
moved or renamed, I think it might be best to leave yourself out.
But, totally your choice.

Tom.

>>> +++ b/fs/nls/nls_ucs2_utils.c
>>> ...
>>> - *   Some of the source code in this file came from fs/cifs/uniupr.h
>>> - *   Copyright (c) International Business Machines  Corp., 2000,2002
>>> - *
>>> - * uniupr.h - Unicode compressed case ranges
>>> + *   Some of the source code in this file came from fs/cifs/cifs_unicode.c
>>> + *   via fs/smb/unicode.c and fs/smb/uniupr.h and fs/cifs/uniupr.h
>>> + *   Copyright (c) International Business Machines  Corp., 2000,2002,2009
>>> + *   Modified by Steve French (sfrench@us.ibm.com)
>>> + *   Modified by Namjae Jeon (linkinjeon@kernel.org)
>>> + *   Modified by Dr. David Alan Gilbert <linux@treblig.org>
>>
>> Apart from considering these:
>>
>> Reviewed-by: Tom Talpey <tom@talpey.com>
> 
> Thanks!
> 
> Dave
> 
>> Nice work!
>>
>>>>
>>>> Thanks.
>>>>
>>>> Dave
>>>>
>>>>>> On Wed, Jul 12, 2023 at 6:28 PM Dr. David Alan Gilbert
>>>>>> <dave@treblig.org> wrote:
>>>>>>>
>>>>>>> * linux@treblig.org (linux@treblig.org) wrote:
>>>>>>>> From: "Dr. David Alan Gilbert" <linux@treblig.org>
>>>>>>>>
>>>>>>>> The smb client and server code have (mostly) duplicated code
>>>>>>>> for unicode manipulation, in particular upper case handling.
>>>>>>>>
>>>>>>>> Flatten this lot into shared code.
>>>>>>>
>>>>>>> Gentle two week ping on this please.
>>>>>>>
>>>>>>> Dave
>>>>>>>
>>>>>>> (Apologies to the 3 of you who already got a copy of this ping,
>>>>>>> recent due to a missing header ',' )
>>>>>>>
>>>>>>>> There's some code that's slightly different between the two, and
>>>>>>>> I've not attempted to share that - this should be strictly a no
>>>>>>>> behaviour change set.
>>>>>>>>
>>>>>>>> In addition, the same tables and code are shared in jfs, however
>>>>>>>> there's very little testing available for the unicode in there,
>>>>>>>> so just share the raw data tables.
>>>>>>>>
>>>>>>>> I suspect there's more UCS-2 code that can be shared, in the NLS code
>>>>>>>> and in the UCS-2 code used by the EFI interfaces.
>>>>>>>>
>>>>>>>> Lightly tested with a module and a monolithic build,
>>>>>>>> and just mounting
>>>>>>>> itself.
>>>>>>>>
>>>>>>>> This dupe was found using PMD:
>>>>>>>>     https://pmd.github.io/pmd/pmd_userdocs_cpd.html
>>>>>>>>
>>>>>>>> Dave
>>>>>>>>
>>>>>>>> Version 2
>>>>>>>>     Moved the shared code to fs/nls after v1 feedback.
>>>>>>>>     Renamed shared tables from Smb to Nls prefix
>>>>>>>>     Move UniStrcat as well
>>>>>>>>     Share the JFS tables
>>>>>>>>
>>>>>>>> Dr. David Alan Gilbert (4):
>>>>>>>>     fs/smb: Remove unicode 'lower' tables
>>>>>>>>     fs/smb: Swing unicode common code from smb->NLS
>>>>>>>>     fs/smb/client: Use common code in client
>>>>>>>>     fs/jfs: Use common ucs2 upper case table
>>>>>>>>
>>>>>>>>    fs/jfs/Kconfig               |   1 +
>>>>>>>>    fs/jfs/Makefile              |   2 +-
>>>>>>>>    fs/jfs/jfs_unicode.h         |  17 +-
>>>>>>>>    fs/jfs/jfs_uniupr.c          | 121 -------------
>>>>>>>>    fs/nls/Kconfig               |   8 +
>>>>>>>>    fs/nls/Makefile              |   1 +
>>>>>>>>    fs/nls/nls_ucs2_data.h       |  15 ++
>>>>>>>>    fs/nls/nls_ucs2_utils.c      | 144 +++++++++++++++
>>>>>>>>    fs/nls/nls_ucs2_utils.h      | 285 ++++++++++++++++++++++++++++++
>>>>>>>>    fs/smb/client/Kconfig        |   1 +
>>>>>>>>    fs/smb/client/cifs_unicode.c |   1 -
>>>>>>>>    fs/smb/client/cifs_unicode.h | 330
>>>>>>>> +----------------------------------
>>>>>>>>    fs/smb/client/cifs_uniupr.h  | 239 -------------------------
>>>>>>>>    fs/smb/server/Kconfig        |   1 +
>>>>>>>>    fs/smb/server/unicode.c      |   1 -
>>>>>>>>    fs/smb/server/unicode.h      | 325
>>>>>>>> +---------------------------------
>>>>>>>>    fs/smb/server/uniupr.h       | 268 ----------------------------
>>>>>>>>    17 files changed, 467 insertions(+), 1293 deletions(-)
>>>>>>>>    delete mode 100644 fs/jfs/jfs_uniupr.c
>>>>>>>>    create mode 100644 fs/nls/nls_ucs2_data.h
>>>>>>>>    create mode 100644 fs/nls/nls_ucs2_utils.c
>>>>>>>>    create mode 100644 fs/nls/nls_ucs2_utils.h
>>>>>>>>    delete mode 100644 fs/smb/client/cifs_uniupr.h
>>>>>>>>    delete mode 100644 fs/smb/server/uniupr.h
>>>>>>>>
>>>>>>>> -- 
>>>>>>>> 2.41.0
>>>>>>>>
>>>>>>> -- 
>>>>>>>    -----Open up your eyes, open up your mind, open up your code -------
>>>>>>> / Dr. David Alan Gilbert    |       Running GNU/Linux       | Happy  \
>>>>>>> \        dave @ treblig.org |                               | In Hex /
>>>>>>>    \ _________________________|_____ http://www.treblig.org   |_______/
>>>>>>
>>>>>>
>>>>>>
>>>>>> -- 
>>>>>> Thanks,
>>>>>>
>>>>>> Steve
>>>>>
>>>>>
>>>>>
>>>>> -- 
>>>>> Thanks,
>>>>>
>>>>> Steve
>>>
Dr. David Alan Gilbert July 21, 2023, 1:25 p.m. UTC | #9
* Tom Talpey (tom@talpey.com) wrote:
> On 7/20/2023 7:57 PM, Dr. David Alan Gilbert wrote:
> > * Tom Talpey (tom@talpey.com) wrote:
> > > On 7/19/2023 6:06 PM, Dave Kleikamp wrote:
> > > > On 7/19/23 4:58PM, Dr. David Alan Gilbert wrote:
> > > > > * Steve French (smfrench@gmail.com) wrote:
> > > > > > The related question is which tree to send it from, if no problems
> > > > > > reported (presumably mine since it mostly affect cifs.ko and ksmbd.ko,
> > > > > > and because there hasn't been activity in fs/nls for years)
> > > > > 
> > > > > That was my hope, given that ~half of the patches are directly on that
> > > > > code, and it's the only very active tree this touches as far as I can
> > > > > tell.
> > > > > 
> > > > > > On Wed, Jul 19, 2023 at 12:56 PM Steve French
> > > > > > <smfrench@gmail.com> wrote:
> > > > > > > 
> > > > > > > No objections to this on my part.  If Shaggy is ok with the JFS
> > > > > > > change, we could target it for 6.6-rc1 if it tests out ok
> > > > 
> > > > For the series:
> > > > Reviewed-by: Dave Kleikamp <dave.kleikamp@oracle.com>
> > > > 
> > > > Steve,
> > > > Feel free to pull in even the 4th patch into your tree with my consent.
> > > > Or if you're more comfortable, I could submit it after yours hits
> > > > mainline.
> > > > 
> > > > Shaggy
> > > 
> > > The changes look good to me but there is one quirk with the
> > > copyrights and SPDX in patch 2.
> > > 
> > > In the new fs/nls/nls_ucs2_utils.c, the SPDX line changes from
> > > a "/* ... */" form to "// ...", which may be a proper update, but
> > > then partway down, adds the same SPDX in "/* ... */ form. These
> > > should at least be consistent.
> > > 
> > > > +++ b/fs/nls/nls_ucs2_utils.c
> > > > @@ -1,19 +1,25 @@
> > > > -/* SPDX-License-Identifier: GPL-2.0-or-later */
> > > > +// SPDX-License-Identifier: GPL-2.0-or-later
> > > 
> > > vs
> > > 
> > > > +++ b/fs/nls/nls_ucs2_utils.h
> > > > @@ -0,0 +1,297 @@
> > > > +/* SPDX-License-Identifier: GPL-2.0-or-later */
> > 
> > Yeh that's an easy fix - so that's just the fact the .h has
> > the older /* where I'd fixed up the .c ?
> 
> Yep, for consistency that sounds good.
> 
> > > Second, the copyright in fs/nls/nls_ucs2_utils.c is a bit of
> > > a mash-up (adding 2009 especially).
> > > 
> > > I think it's better to keep the exact text of both copyrights,
> > > perhaps with a note as to which files had them previously, and
> > > adding some new note/blank line to separate the recent contributions
> > > from Namjae and you from the ancient history.
> > 
> > How about the following;
> > 
> >   * This file has taken chunks from a few other files
> >   * smb/server/uniupr.h had the declaration:
> 
> These two lines above aren't needed, because the lines below
> contain the copyright and where they originated. So just omit
> the two above.

OK, will do; although the reason I included them was because the
path included in the declaration isn't the file the declaration is
currently in.

> >   *
> >   *   Some of the source code in this file came from fs/cifs/uniupr.h
> >   *   Copyright (c) International Business Machines  Corp., 2000,2002
> >   *
> >   * fs/smb/server/unicode.c had the declaration:
> 
> And this one above - not needed.
> 
> >   *
> >   *   Some of the source code in this file came from fs/cifs/cifs_unicode.c
> >   *
> >   *   Copyright (c) International Business Machines  Corp., 2000,2009
> >   *   Modified by Steve French (sfrench@us.ibm.com)
> >   *   Modified by Namjae Jeon (linkinjeon@kernel.org)
> >   *
> > 
> > I haven't added the extra line above Namjae's line, since it's now
> > a straight copy from the unicode.c entry.
> 
> Straight copy is what's important. No deletion, no edit in a copyright.
> So, ok.
> 
> > I'm not particularly fussed about adding my own line unless you think
> > it's needed; git keeps better history!
> 
> In fact, since you technically didn't add any code, just deleted,
> moved or renamed, I think it might be best to leave yourself out.

Oh that question could keep copyright lawyers occupied for years :-)

> But, totally your choice.

Thanks

I'll post a modified version of this patch in a few hours.

Dave

> Tom.
> 
> > > > +++ b/fs/nls/nls_ucs2_utils.c
> > > > ...
> > > > - *   Some of the source code in this file came from fs/cifs/uniupr.h
> > > > - *   Copyright (c) International Business Machines  Corp., 2000,2002
> > > > - *
> > > > - * uniupr.h - Unicode compressed case ranges
> > > > + *   Some of the source code in this file came from fs/cifs/cifs_unicode.c
> > > > + *   via fs/smb/unicode.c and fs/smb/uniupr.h and fs/cifs/uniupr.h
> > > > + *   Copyright (c) International Business Machines  Corp., 2000,2002,2009
> > > > + *   Modified by Steve French (sfrench@us.ibm.com)
> > > > + *   Modified by Namjae Jeon (linkinjeon@kernel.org)
> > > > + *   Modified by Dr. David Alan Gilbert <linux@treblig.org>
> > > 
> > > Apart from considering these:
> > > 
> > > Reviewed-by: Tom Talpey <tom@talpey.com>
> > 
> > Thanks!
> > 
> > Dave
> > 
> > > Nice work!
> > > 
> > > > > 
> > > > > Thanks.
> > > > > 
> > > > > Dave
> > > > > 
> > > > > > > On Wed, Jul 12, 2023 at 6:28 PM Dr. David Alan Gilbert
> > > > > > > <dave@treblig.org> wrote:
> > > > > > > > 
> > > > > > > > * linux@treblig.org (linux@treblig.org) wrote:
> > > > > > > > > From: "Dr. David Alan Gilbert" <linux@treblig.org>
> > > > > > > > > 
> > > > > > > > > The smb client and server code have (mostly) duplicated code
> > > > > > > > > for unicode manipulation, in particular upper case handling.
> > > > > > > > > 
> > > > > > > > > Flatten this lot into shared code.
> > > > > > > > 
> > > > > > > > Gentle two week ping on this please.
> > > > > > > > 
> > > > > > > > Dave
> > > > > > > > 
> > > > > > > > (Apologies to the 3 of you who already got a copy of this ping,
> > > > > > > > recent due to a missing header ',' )
> > > > > > > > 
> > > > > > > > > There's some code that's slightly different between the two, and
> > > > > > > > > I've not attempted to share that - this should be strictly a no
> > > > > > > > > behaviour change set.
> > > > > > > > > 
> > > > > > > > > In addition, the same tables and code are shared in jfs, however
> > > > > > > > > there's very little testing available for the unicode in there,
> > > > > > > > > so just share the raw data tables.
> > > > > > > > > 
> > > > > > > > > I suspect there's more UCS-2 code that can be shared, in the NLS code
> > > > > > > > > and in the UCS-2 code used by the EFI interfaces.
> > > > > > > > > 
> > > > > > > > > Lightly tested with a module and a monolithic build,
> > > > > > > > > and just mounting
> > > > > > > > > itself.
> > > > > > > > > 
> > > > > > > > > This dupe was found using PMD:
> > > > > > > > >     https://pmd.github.io/pmd/pmd_userdocs_cpd.html
> > > > > > > > > 
> > > > > > > > > Dave
> > > > > > > > > 
> > > > > > > > > Version 2
> > > > > > > > >     Moved the shared code to fs/nls after v1 feedback.
> > > > > > > > >     Renamed shared tables from Smb to Nls prefix
> > > > > > > > >     Move UniStrcat as well
> > > > > > > > >     Share the JFS tables
> > > > > > > > > 
> > > > > > > > > Dr. David Alan Gilbert (4):
> > > > > > > > >     fs/smb: Remove unicode 'lower' tables
> > > > > > > > >     fs/smb: Swing unicode common code from smb->NLS
> > > > > > > > >     fs/smb/client: Use common code in client
> > > > > > > > >     fs/jfs: Use common ucs2 upper case table
> > > > > > > > > 
> > > > > > > > >    fs/jfs/Kconfig               |   1 +
> > > > > > > > >    fs/jfs/Makefile              |   2 +-
> > > > > > > > >    fs/jfs/jfs_unicode.h         |  17 +-
> > > > > > > > >    fs/jfs/jfs_uniupr.c          | 121 -------------
> > > > > > > > >    fs/nls/Kconfig               |   8 +
> > > > > > > > >    fs/nls/Makefile              |   1 +
> > > > > > > > >    fs/nls/nls_ucs2_data.h       |  15 ++
> > > > > > > > >    fs/nls/nls_ucs2_utils.c      | 144 +++++++++++++++
> > > > > > > > >    fs/nls/nls_ucs2_utils.h      | 285 ++++++++++++++++++++++++++++++
> > > > > > > > >    fs/smb/client/Kconfig        |   1 +
> > > > > > > > >    fs/smb/client/cifs_unicode.c |   1 -
> > > > > > > > >    fs/smb/client/cifs_unicode.h | 330
> > > > > > > > > +----------------------------------
> > > > > > > > >    fs/smb/client/cifs_uniupr.h  | 239 -------------------------
> > > > > > > > >    fs/smb/server/Kconfig        |   1 +
> > > > > > > > >    fs/smb/server/unicode.c      |   1 -
> > > > > > > > >    fs/smb/server/unicode.h      | 325
> > > > > > > > > +---------------------------------
> > > > > > > > >    fs/smb/server/uniupr.h       | 268 ----------------------------
> > > > > > > > >    17 files changed, 467 insertions(+), 1293 deletions(-)
> > > > > > > > >    delete mode 100644 fs/jfs/jfs_uniupr.c
> > > > > > > > >    create mode 100644 fs/nls/nls_ucs2_data.h
> > > > > > > > >    create mode 100644 fs/nls/nls_ucs2_utils.c
> > > > > > > > >    create mode 100644 fs/nls/nls_ucs2_utils.h
> > > > > > > > >    delete mode 100644 fs/smb/client/cifs_uniupr.h
> > > > > > > > >    delete mode 100644 fs/smb/server/uniupr.h
> > > > > > > > > 
> > > > > > > > > -- 
> > > > > > > > > 2.41.0
> > > > > > > > > 
> > > > > > > > -- 
> > > > > > > >    -----Open up your eyes, open up your mind, open up your code -------
> > > > > > > > / Dr. David Alan Gilbert    |       Running GNU/Linux       | Happy  \
> > > > > > > > \        dave @ treblig.org |                               | In Hex /
> > > > > > > >    \ _________________________|_____ http://www.treblig.org   |_______/
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > -- 
> > > > > > > Thanks,
> > > > > > > 
> > > > > > > Steve
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > -- 
> > > > > > Thanks,
> > > > > > 
> > > > > > Steve
> > > >
Dr. David Alan Gilbert July 21, 2023, 8:58 p.m. UTC | #10
* Tom Talpey (tom@talpey.com) wrote:
> On 7/20/2023 7:57 PM, Dr. David Alan Gilbert wrote:
> > * Tom Talpey (tom@talpey.com) wrote:
> > > On 7/19/2023 6:06 PM, Dave Kleikamp wrote:
> > > > On 7/19/23 4:58PM, Dr. David Alan Gilbert wrote:
> > > > > * Steve French (smfrench@gmail.com) wrote:
> > > > > > The related question is which tree to send it from, if no problems
> > > > > > reported (presumably mine since it mostly affect cifs.ko and ksmbd.ko,
> > > > > > and because there hasn't been activity in fs/nls for years)
> > > > > 
> > > > > That was my hope, given that ~half of the patches are directly on that
> > > > > code, and it's the only very active tree this touches as far as I can
> > > > > tell.
> > > > > 
> > > > > > On Wed, Jul 19, 2023 at 12:56 PM Steve French
> > > > > > <smfrench@gmail.com> wrote:
> > > > > > > 
> > > > > > > No objections to this on my part.  If Shaggy is ok with the JFS
> > > > > > > change, we could target it for 6.6-rc1 if it tests out ok
> > > > 
> > > > For the series:
> > > > Reviewed-by: Dave Kleikamp <dave.kleikamp@oracle.com>
> > > > 
> > > > Steve,
> > > > Feel free to pull in even the 4th patch into your tree with my consent.
> > > > Or if you're more comfortable, I could submit it after yours hits
> > > > mainline.
> > > > 
> > > > Shaggy
> > > 
> > > The changes look good to me but there is one quirk with the
> > > copyrights and SPDX in patch 2.
> > > 
> > > In the new fs/nls/nls_ucs2_utils.c, the SPDX line changes from
> > > a "/* ... */" form to "// ...", which may be a proper update, but
> > > then partway down, adds the same SPDX in "/* ... */ form. These
> > > should at least be consistent.
> > > 
> > > > +++ b/fs/nls/nls_ucs2_utils.c
> > > > @@ -1,19 +1,25 @@
> > > > -/* SPDX-License-Identifier: GPL-2.0-or-later */
> > > > +// SPDX-License-Identifier: GPL-2.0-or-later
> > > 
> > > vs
> > > 
> > > > +++ b/fs/nls/nls_ucs2_utils.h
> > > > @@ -0,0 +1,297 @@
> > > > +/* SPDX-License-Identifier: GPL-2.0-or-later */
> > 
> > Yeh that's an easy fix - so that's just the fact the .h has
> > the older /* where I'd fixed up the .c ?
> 
> Yep, for consistency that sounds good.

It does.... and I just fixed up my patches for it, and checkpatch
moans;

https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/scripts/checkpatch.pl#n3737
	if ($realfile =~ /\.(h|s|S)$/) {
		$comment = '/*';
	} elsif ($realfile =~ /\.(c|rs|dts|dtsi)$/) {
		$comment = '//';

I don't get where that idea came from.

Dave

> > > Second, the copyright in fs/nls/nls_ucs2_utils.c is a bit of
> > > a mash-up (adding 2009 especially).
> > > 
> > > I think it's better to keep the exact text of both copyrights,
> > > perhaps with a note as to which files had them previously, and
> > > adding some new note/blank line to separate the recent contributions
> > > from Namjae and you from the ancient history.
> > 
> > How about the following;
> > 
> >   * This file has taken chunks from a few other files
> >   * smb/server/uniupr.h had the declaration:
> 
> These two lines above aren't needed, because the lines below
> contain the copyright and where they originated. So just omit
> the two above.
> 
> >   *
> >   *   Some of the source code in this file came from fs/cifs/uniupr.h
> >   *   Copyright (c) International Business Machines  Corp., 2000,2002
> >   *
> >   * fs/smb/server/unicode.c had the declaration:
> 
> And this one above - not needed.
> 
> >   *
> >   *   Some of the source code in this file came from fs/cifs/cifs_unicode.c
> >   *
> >   *   Copyright (c) International Business Machines  Corp., 2000,2009
> >   *   Modified by Steve French (sfrench@us.ibm.com)
> >   *   Modified by Namjae Jeon (linkinjeon@kernel.org)
> >   *
> > 
> > I haven't added the extra line above Namjae's line, since it's now
> > a straight copy from the unicode.c entry.
> 
> Straight copy is what's important. No deletion, no edit in a copyright.
> So, ok.
> 
> > I'm not particularly fussed about adding my own line unless you think
> > it's needed; git keeps better history!
> 
> In fact, since you technically didn't add any code, just deleted,
> moved or renamed, I think it might be best to leave yourself out.
> But, totally your choice.
> 
> Tom.
> 
> > > > +++ b/fs/nls/nls_ucs2_utils.c
> > > > ...
> > > > - *   Some of the source code in this file came from fs/cifs/uniupr.h
> > > > - *   Copyright (c) International Business Machines  Corp., 2000,2002
> > > > - *
> > > > - * uniupr.h - Unicode compressed case ranges
> > > > + *   Some of the source code in this file came from fs/cifs/cifs_unicode.c
> > > > + *   via fs/smb/unicode.c and fs/smb/uniupr.h and fs/cifs/uniupr.h
> > > > + *   Copyright (c) International Business Machines  Corp., 2000,2002,2009
> > > > + *   Modified by Steve French (sfrench@us.ibm.com)
> > > > + *   Modified by Namjae Jeon (linkinjeon@kernel.org)
> > > > + *   Modified by Dr. David Alan Gilbert <linux@treblig.org>
> > > 
> > > Apart from considering these:
> > > 
> > > Reviewed-by: Tom Talpey <tom@talpey.com>
> > 
> > Thanks!
> > 
> > Dave
> > 
> > > Nice work!
> > > 
> > > > > 
> > > > > Thanks.
> > > > > 
> > > > > Dave
> > > > > 
> > > > > > > On Wed, Jul 12, 2023 at 6:28 PM Dr. David Alan Gilbert
> > > > > > > <dave@treblig.org> wrote:
> > > > > > > > 
> > > > > > > > * linux@treblig.org (linux@treblig.org) wrote:
> > > > > > > > > From: "Dr. David Alan Gilbert" <linux@treblig.org>
> > > > > > > > > 
> > > > > > > > > The smb client and server code have (mostly) duplicated code
> > > > > > > > > for unicode manipulation, in particular upper case handling.
> > > > > > > > > 
> > > > > > > > > Flatten this lot into shared code.
> > > > > > > > 
> > > > > > > > Gentle two week ping on this please.
> > > > > > > > 
> > > > > > > > Dave
> > > > > > > > 
> > > > > > > > (Apologies to the 3 of you who already got a copy of this ping,
> > > > > > > > recent due to a missing header ',' )
> > > > > > > > 
> > > > > > > > > There's some code that's slightly different between the two, and
> > > > > > > > > I've not attempted to share that - this should be strictly a no
> > > > > > > > > behaviour change set.
> > > > > > > > > 
> > > > > > > > > In addition, the same tables and code are shared in jfs, however
> > > > > > > > > there's very little testing available for the unicode in there,
> > > > > > > > > so just share the raw data tables.
> > > > > > > > > 
> > > > > > > > > I suspect there's more UCS-2 code that can be shared, in the NLS code
> > > > > > > > > and in the UCS-2 code used by the EFI interfaces.
> > > > > > > > > 
> > > > > > > > > Lightly tested with a module and a monolithic build,
> > > > > > > > > and just mounting
> > > > > > > > > itself.
> > > > > > > > > 
> > > > > > > > > This dupe was found using PMD:
> > > > > > > > >     https://pmd.github.io/pmd/pmd_userdocs_cpd.html
> > > > > > > > > 
> > > > > > > > > Dave
> > > > > > > > > 
> > > > > > > > > Version 2
> > > > > > > > >     Moved the shared code to fs/nls after v1 feedback.
> > > > > > > > >     Renamed shared tables from Smb to Nls prefix
> > > > > > > > >     Move UniStrcat as well
> > > > > > > > >     Share the JFS tables
> > > > > > > > > 
> > > > > > > > > Dr. David Alan Gilbert (4):
> > > > > > > > >     fs/smb: Remove unicode 'lower' tables
> > > > > > > > >     fs/smb: Swing unicode common code from smb->NLS
> > > > > > > > >     fs/smb/client: Use common code in client
> > > > > > > > >     fs/jfs: Use common ucs2 upper case table
> > > > > > > > > 
> > > > > > > > >    fs/jfs/Kconfig               |   1 +
> > > > > > > > >    fs/jfs/Makefile              |   2 +-
> > > > > > > > >    fs/jfs/jfs_unicode.h         |  17 +-
> > > > > > > > >    fs/jfs/jfs_uniupr.c          | 121 -------------
> > > > > > > > >    fs/nls/Kconfig               |   8 +
> > > > > > > > >    fs/nls/Makefile              |   1 +
> > > > > > > > >    fs/nls/nls_ucs2_data.h       |  15 ++
> > > > > > > > >    fs/nls/nls_ucs2_utils.c      | 144 +++++++++++++++
> > > > > > > > >    fs/nls/nls_ucs2_utils.h      | 285 ++++++++++++++++++++++++++++++
> > > > > > > > >    fs/smb/client/Kconfig        |   1 +
> > > > > > > > >    fs/smb/client/cifs_unicode.c |   1 -
> > > > > > > > >    fs/smb/client/cifs_unicode.h | 330
> > > > > > > > > +----------------------------------
> > > > > > > > >    fs/smb/client/cifs_uniupr.h  | 239 -------------------------
> > > > > > > > >    fs/smb/server/Kconfig        |   1 +
> > > > > > > > >    fs/smb/server/unicode.c      |   1 -
> > > > > > > > >    fs/smb/server/unicode.h      | 325
> > > > > > > > > +---------------------------------
> > > > > > > > >    fs/smb/server/uniupr.h       | 268 ----------------------------
> > > > > > > > >    17 files changed, 467 insertions(+), 1293 deletions(-)
> > > > > > > > >    delete mode 100644 fs/jfs/jfs_uniupr.c
> > > > > > > > >    create mode 100644 fs/nls/nls_ucs2_data.h
> > > > > > > > >    create mode 100644 fs/nls/nls_ucs2_utils.c
> > > > > > > > >    create mode 100644 fs/nls/nls_ucs2_utils.h
> > > > > > > > >    delete mode 100644 fs/smb/client/cifs_uniupr.h
> > > > > > > > >    delete mode 100644 fs/smb/server/uniupr.h
> > > > > > > > > 
> > > > > > > > > -- 
> > > > > > > > > 2.41.0
> > > > > > > > > 
> > > > > > > > -- 
> > > > > > > >    -----Open up your eyes, open up your mind, open up your code -------
> > > > > > > > / Dr. David Alan Gilbert    |       Running GNU/Linux       | Happy  \
> > > > > > > > \        dave @ treblig.org |                               | In Hex /
> > > > > > > >    \ _________________________|_____ http://www.treblig.org   |_______/
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > -- 
> > > > > > > Thanks,
> > > > > > > 
> > > > > > > Steve
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > -- 
> > > > > > Thanks,
> > > > > > 
> > > > > > Steve
> > > >
Paulo Alcantara July 21, 2023, 9:06 p.m. UTC | #11
"Dr. David Alan Gilbert" <linux@treblig.org> writes:

> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/scripts/checkpatch.pl#n3737
> 	if ($realfile =~ /\.(h|s|S)$/) {
> 		$comment = '/*';
> 	} elsif ($realfile =~ /\.(c|rs|dts|dtsi)$/) {
> 		$comment = '//';
>
> I don't get where that idea came from.

Check Documentation/process/license-rules.rst.
Tom Talpey July 21, 2023, 9:12 p.m. UTC | #12
On 7/21/2023 5:06 PM, Paulo Alcantara wrote:
> "Dr. David Alan Gilbert" <linux@treblig.org> writes:
> 
>> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/scripts/checkpatch.pl#n3737
>> 	if ($realfile =~ /\.(h|s|S)$/) {
>> 		$comment = '/*';
>> 	} elsif ($realfile =~ /\.(c|rs|dts|dtsi)$/) {
>> 		$comment = '//';
>>
>> I don't get where that idea came from.
> 
> Check Documentation/process/license-rules.rst.

Ok, header files require a different SPDX comment syntax.
I withdraw the consistency comment!

Did I give it my R-B?

Reviewed-by: Tom Talpey <tom@talpey.com>
Dr. David Alan Gilbert July 21, 2023, 9:12 p.m. UTC | #13
* Paulo Alcantara (pc@manguebit.com) wrote:
> "Dr. David Alan Gilbert" <linux@treblig.org> writes:
> 
> > https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/scripts/checkpatch.pl#n3737
> > 	if ($realfile =~ /\.(h|s|S)$/) {
> > 		$comment = '/*';
> > 	} elsif ($realfile =~ /\.(c|rs|dts|dtsi)$/) {
> > 		$comment = '//';
> >
> > I don't get where that idea came from.
> 
> Check Documentation/process/license-rules.rst.

Oh, that's a painful history!
Hmm that landed just after I posted a v3 (of just this patch)

Steve: Your call, do you want me to post a v4 with that comment
back and but with the copyright lineas as in v3?

Dave
Dr. David Alan Gilbert Aug. 13, 2023, 12:57 a.m. UTC | #14
* Dr. David Alan Gilbert (dave@treblig.org) wrote:
> * Paulo Alcantara (pc@manguebit.com) wrote:
> > "Dr. David Alan Gilbert" <linux@treblig.org> writes:
> > 
> > > https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/scripts/checkpatch.pl#n3737
> > > 	if ($realfile =~ /\.(h|s|S)$/) {
> > > 		$comment = '/*';
> > > 	} elsif ($realfile =~ /\.(c|rs|dts|dtsi)$/) {
> > > 		$comment = '//';
> > >
> > > I don't get where that idea came from.
> > 
> > Check Documentation/process/license-rules.rst.
> 
> Oh, that's a painful history!
> Hmm that landed just after I posted a v3 (of just this patch)
> 
> Steve: Your call, do you want me to post a v4 with that comment
> back and but with the copyright lineas as in v3?

I've posted the v4.

Dave

> Dave
> 
> -- 
>  -----Open up your eyes, open up your mind, open up your code -------   
> / Dr. David Alan Gilbert    |       Running GNU/Linux       | Happy  \ 
> \        dave @ treblig.org |                               | In Hex /
>  \ _________________________|_____ http://www.treblig.org   |_______/
Steve French Aug. 13, 2023, 3:11 a.m. UTC | #15
thx - should be doable to put in for-next soon unless we find objections

On Sat, Aug 12, 2023 at 7:57 PM Dr. David Alan Gilbert <dave@treblig.org> wrote:
>
> * Dr. David Alan Gilbert (dave@treblig.org) wrote:
> > * Paulo Alcantara (pc@manguebit.com) wrote:
> > > "Dr. David Alan Gilbert" <linux@treblig.org> writes:
> > >
> > > > https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/scripts/checkpatch.pl#n3737
> > > >   if ($realfile =~ /\.(h|s|S)$/) {
> > > >           $comment = '/*';
> > > >   } elsif ($realfile =~ /\.(c|rs|dts|dtsi)$/) {
> > > >           $comment = '//';
> > > >
> > > > I don't get where that idea came from.
> > >
> > > Check Documentation/process/license-rules.rst.
> >
> > Oh, that's a painful history!
> > Hmm that landed just after I posted a v3 (of just this patch)
> >
> > Steve: Your call, do you want me to post a v4 with that comment
> > back and but with the copyright lineas as in v3?
>
> I've posted the v4.
>
> Dave
>
> > Dave
> >
> > --
> >  -----Open up your eyes, open up your mind, open up your code -------
> > / Dr. David Alan Gilbert    |       Running GNU/Linux       | Happy  \
> > \        dave @ treblig.org |                               | In Hex /
> >  \ _________________________|_____ http://www.treblig.org   |_______/
> --
>  -----Open up your eyes, open up your mind, open up your code -------
> / Dr. David Alan Gilbert    |       Running GNU/Linux       | Happy  \
> \        dave @ treblig.org |                               | In Hex /
>  \ _________________________|_____ http://www.treblig.org   |_______/
Steve French Aug. 27, 2023, 11:14 p.m. UTC | #16
Shaggy,
I can add these - am updating the series to include your RB

On Wed, Jul 19, 2023 at 5:06 PM Dave Kleikamp <dave.kleikamp@oracle.com> wrote:
>
> On 7/19/23 4:58PM, Dr. David Alan Gilbert wrote:
> > * Steve French (smfrench@gmail.com) wrote:
> >> The related question is which tree to send it from, if no problems
> >> reported (presumably mine since it mostly affect cifs.ko and ksmbd.ko,
> >> and because there hasn't been activity in fs/nls for years)
> >
> > That was my hope, given that ~half of the patches are directly on that
> > code, and it's the only very active tree this touches as far as I can
> > tell.
> >
> >> On Wed, Jul 19, 2023 at 12:56 PM Steve French <smfrench@gmail.com> wrote:
> >>>
> >>> No objections to this on my part.  If Shaggy is ok with the JFS
> >>> change, we could target it for 6.6-rc1 if it tests out ok
>
> For the series:
> Reviewed-by: Dave Kleikamp <dave.kleikamp@oracle.com>
>
> Steve,
> Feel free to pull in even the 4th patch into your tree with my consent.
> Or if you're more comfortable, I could submit it after yours hits mainline.
>
> Shaggy
>
> >
> > Thanks.
> >
> > Dave
> >
> >>> On Wed, Jul 12, 2023 at 6:28 PM Dr. David Alan Gilbert <dave@treblig.org> wrote:
> >>>>
> >>>> * linux@treblig.org (linux@treblig.org) wrote:
> >>>>> From: "Dr. David Alan Gilbert" <linux@treblig.org>
> >>>>>
> >>>>> The smb client and server code have (mostly) duplicated code
> >>>>> for unicode manipulation, in particular upper case handling.
> >>>>>
> >>>>> Flatten this lot into shared code.
> >>>>
> >>>> Gentle two week ping on this please.
> >>>>
> >>>> Dave
> >>>>
> >>>> (Apologies to the 3 of you who already got a copy of this ping,
> >>>> recent due to a missing header ',' )
> >>>>
> >>>>> There's some code that's slightly different between the two, and
> >>>>> I've not attempted to share that - this should be strictly a no
> >>>>> behaviour change set.
> >>>>>
> >>>>> In addition, the same tables and code are shared in jfs, however
> >>>>> there's very little testing available for the unicode in there,
> >>>>> so just share the raw data tables.
> >>>>>
> >>>>> I suspect there's more UCS-2 code that can be shared, in the NLS code
> >>>>> and in the UCS-2 code used by the EFI interfaces.
> >>>>>
> >>>>> Lightly tested with a module and a monolithic build, and just mounting
> >>>>> itself.
> >>>>>
> >>>>> This dupe was found using PMD:
> >>>>>    https://pmd.github.io/pmd/pmd_userdocs_cpd.html
> >>>>>
> >>>>> Dave
> >>>>>
> >>>>> Version 2
> >>>>>    Moved the shared code to fs/nls after v1 feedback.
> >>>>>    Renamed shared tables from Smb to Nls prefix
> >>>>>    Move UniStrcat as well
> >>>>>    Share the JFS tables
> >>>>>
> >>>>> Dr. David Alan Gilbert (4):
> >>>>>    fs/smb: Remove unicode 'lower' tables
> >>>>>    fs/smb: Swing unicode common code from smb->NLS
> >>>>>    fs/smb/client: Use common code in client
> >>>>>    fs/jfs: Use common ucs2 upper case table
> >>>>>
> >>>>>   fs/jfs/Kconfig               |   1 +
> >>>>>   fs/jfs/Makefile              |   2 +-
> >>>>>   fs/jfs/jfs_unicode.h         |  17 +-
> >>>>>   fs/jfs/jfs_uniupr.c          | 121 -------------
> >>>>>   fs/nls/Kconfig               |   8 +
> >>>>>   fs/nls/Makefile              |   1 +
> >>>>>   fs/nls/nls_ucs2_data.h       |  15 ++
> >>>>>   fs/nls/nls_ucs2_utils.c      | 144 +++++++++++++++
> >>>>>   fs/nls/nls_ucs2_utils.h      | 285 ++++++++++++++++++++++++++++++
> >>>>>   fs/smb/client/Kconfig        |   1 +
> >>>>>   fs/smb/client/cifs_unicode.c |   1 -
> >>>>>   fs/smb/client/cifs_unicode.h | 330 +----------------------------------
> >>>>>   fs/smb/client/cifs_uniupr.h  | 239 -------------------------
> >>>>>   fs/smb/server/Kconfig        |   1 +
> >>>>>   fs/smb/server/unicode.c      |   1 -
> >>>>>   fs/smb/server/unicode.h      | 325 +---------------------------------
> >>>>>   fs/smb/server/uniupr.h       | 268 ----------------------------
> >>>>>   17 files changed, 467 insertions(+), 1293 deletions(-)
> >>>>>   delete mode 100644 fs/jfs/jfs_uniupr.c
> >>>>>   create mode 100644 fs/nls/nls_ucs2_data.h
> >>>>>   create mode 100644 fs/nls/nls_ucs2_utils.c
> >>>>>   create mode 100644 fs/nls/nls_ucs2_utils.h
> >>>>>   delete mode 100644 fs/smb/client/cifs_uniupr.h
> >>>>>   delete mode 100644 fs/smb/server/uniupr.h
> >>>>>
> >>>>> --
> >>>>> 2.41.0
> >>>>>
> >>>> --
> >>>>   -----Open up your eyes, open up your mind, open up your code -------
> >>>> / Dr. David Alan Gilbert    |       Running GNU/Linux       | Happy  \
> >>>> \        dave @ treblig.org |                               | In Hex /
> >>>>   \ _________________________|_____ http://www.treblig.org   |_______/
> >>>
> >>>
> >>>
> >>> --
> >>> Thanks,
> >>>
> >>> Steve
> >>
> >>
> >>
> >> --
> >> Thanks,
> >>
> >> Steve