Received: by 2002:a05:6358:701b:b0:131:369:b2a3 with SMTP id 27csp420810rwo; Fri, 21 Jul 2023 14:13:50 -0700 (PDT) X-Google-Smtp-Source: APBJJlGligj/WZrB9TVddNnzGMWf3Jl2XsZcgG4SscLa2M4fo2kJZysOm4qUHlLV3RmZUspGXNdS X-Received: by 2002:a17:906:74d6:b0:993:e695:b589 with SMTP id z22-20020a17090674d600b00993e695b589mr2556399ejl.20.1689974029986; Fri, 21 Jul 2023 14:13:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689974029; cv=none; d=google.com; s=arc-20160816; b=roLeik5bd2fH/QgHR9ajdKfHtmnWfoEl89+v8t6xJ6vs0s8O7j94yFCp3FVextKG8g ihPeKnZvB21+Le1/yiumXsenubRNv7hz3WjflfQyDs18dVy5TS7CfyY+SLX8kWskyRWf taKPodBIWejl3nkQ2C+3/1L3HGwbfSHQ58j8UEVVN9wJbDAHlRu07OXk7/h8w/kYgaT1 hL9j72GyRqBj4K9/oHhvTroncxORRq0h/sPHZc/ZlZaXbYIAaxgKMYVc7NeIMtxRO9px z38COWHAbJO5FvO9QDNIPw2zxnYI99H1D20e5tQ2U4+dKKMHHsom0ln9cfB6QxrBloA9 0s7Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=iPT7bUJUv+LkTmcOfbsPCo4EaIDTV5G6zktQKLjq8hg=; fh=SQBerSHyqxO5h5Byg3ue2KhXVKYetsG/YdfoyJnBXJE=; b=k7zetUkQXHw5D6jXINW0Kxb6osztvl6ZLjuEHMyo+OklgfR4z5NjgFULhhsmRj9+E1 whq/or4B2SsZ23pE+NPsIws61iJ/skNNvhYQQm0wToUe521dxDd1djzk47q8qG1n9Xi7 /k5y81OJcM1w2Vmrp8+f6WetGrITHclbhhyvjllcEq8iQB4MGKVI3NAGdm24PMa5zENj smXrTQStr7PiuiIOHsvymtwTS/H7RG30HDwU/3kR4YBHkgJlT41N8ryfvC4sHIv05PeF UWocMtbRwR71hwU/1efbuRCj5YAmK3M4pBrz9WbjS7gKN8h7CZ/USz2ORW8wYeMpcoo0 H8FA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@treblig.org header.s=bytemarkmx header.b=L6FuFsia; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id lz27-20020a170906fb1b00b0099364d9f0ebsi2716741ejb.559.2023.07.21.14.13.25; Fri, 21 Jul 2023 14:13:49 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=fail header.i=@treblig.org header.s=bytemarkmx header.b=L6FuFsia; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230406AbjGUU60 (ORCPT + 99 others); Fri, 21 Jul 2023 16:58:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59762 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230403AbjGUU6Z (ORCPT ); Fri, 21 Jul 2023 16:58:25 -0400 Received: from mx.treblig.org (unknown [IPv6:2a00:1098:5b::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D497D30E1; Fri, 21 Jul 2023 13:58:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=treblig.org ; s=bytemarkmx; h=In-Reply-To:Content-Transfer-Encoding:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=iPT7bUJUv+LkTmcOfbsPCo4EaIDTV5G6zktQKLjq8hg=; b=L6FuFsiarFCR0FP89J++B/EsYO Qe/CL36wu38ovPdRWh7nE3gKY4nizQFMnUtMkavqPBu1nS5i2FgLoToFqejbd7rsKI3Idbfr+bP2j ujfCqILKiGyXBrXfNyCcrOI6HzoVIE7mjPXm3JTmjbju34uH7/bPZqqS2YbrQqm4W6wEUzLJjV20T ArS2fuWEcWMj9eMqXGdtaa9gGp8CuP9YnhSTiDk/ubFH0ty/aSZfw3f/CKrjGkAvDivrWrup0iseX W4e8xH486AuI7FfGQQp/JkH6Ky+jVDCSQ0pxk/8xyu7b7nqFGJ8p4alp9muTxkfG27OZaY3fU983K Ute2mFfw==; Received: from dg by mx.treblig.org with local (Exim 4.94.2) (envelope-from ) id 1qMxCV-002dPe-W8; Fri, 21 Jul 2023 20:58:12 +0000 Date: Fri, 21 Jul 2023 20:58:11 +0000 From: "Dr. David Alan Gilbert" To: Tom Talpey Cc: Dave Kleikamp , Steve French , linkinjeon@kernel.org, shaggy@kernel.org, linux-cifs@vger.kernel.org, krisman@collabora.com, jfs-discussion@lists.sourceforge.net, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 0/4] dedupe smb unicode files Message-ID: References: <20230628232417.120844-1-linux@treblig.org> <79bbb44c-f3b1-5c5c-1ad4-bcaab0069666@oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Chocolate: 70 percent or better cocoa solids preferably X-Operating-System: Linux/5.10.0-23-amd64 (x86_64) X-Uptime: 20:56:38 up 15 days, 6:28, 1 user, load average: 0.17, 0.04, 0.01 User-Agent: Mutt/2.0.5 (2021-01-21) X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED,RDNS_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org * 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 > > > > > > 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 > > > > > > > > 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 > > > > > > Apart from considering these: > > > > > > Reviewed-by: Tom Talpey > > > > Thanks! > > > > Dave > > > > > Nice work! > > > > > > > > > > > > > Thanks. > > > > > > > > > > Dave > > > > > > > > > > > > On Wed, Jul 12, 2023 at 6:28 PM Dr. David Alan Gilbert > > > > > > > wrote: > > > > > > > > > > > > > > > > * linux@treblig.org (linux@treblig.org) wrote: > > > > > > > > > From: "Dr. David Alan Gilbert" > > > > > > > > > > > > > > > > > > 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 > > > > -- -----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 |_______/