Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp17493035rwd; Tue, 27 Jun 2023 03:59:09 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ68jOQ4keiGNROqUjEGhhJ4qyF+sNge3bkb6VYu2e0Vl+XS+NTAF/xSco9xS+MyjPv6tLe+ X-Received: by 2002:a17:907:3f87:b0:982:84c9:96c4 with SMTP id hr7-20020a1709073f8700b0098284c996c4mr27330609ejc.10.1687863548949; Tue, 27 Jun 2023 03:59:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687863548; cv=none; d=google.com; s=arc-20160816; b=HC/NsbuYSewUwxfbHDNfHjXyI6XYCKQBrLztA7uFSuSuzfgvsgMsFRNrRO/UuKFnC0 T03rREFnb2HCNYfV1Wi1pJeR07PB++SxJ1mcK8FPTd1ujkHTVPd5UYAONHxLOGx723Ds elGcCUplibkZvJBa4VAGsv3b9MPuIZiR+DvPExOY7SmlXoK96REvNxwtRWZ/IVqZOSjX uM5lHKe0F/fSKCa649KRACuH1oV+fnfkRupdlKuaW9sdNIfQseuyDlhm4WVk7wJIKJHn tGnV3e8Ez8dN0AQ6uOQLEb1a+u31ouOavjXBcDzk/DPKvomgQpQP+vczTj26Wh8ixe9h S4nw== 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=b6mr6IUj1sLKRFPC3AWOY5M8vnn/8M/C9oYU60Dvbts=; fh=w+/sSBtLHC8uh4Bzv5sdjAKPf+ZkNJyt8g4kUw0fAVc=; b=dutH1xCTbQWV9JNaec5atcBG6RB1xwo+Sysj7fMMzE3gFo/tlKkVnCWoQL2WHN/EwS fg2mB6H/SOQaPQqXasdj/EFssCYCzVVPddoEMRrrolx+9JyKgiI2CUaCfWCSqGVIH2GO 5GCV80/aX4r9m9P30stBsCzUhD1r+0XhV0YDIrN3WyInuWQcPzDrng/lt3ONBglaOmrD 9/FxnV6IcrbEbt/+dYUz1pU+xZkKVd4+udYHgXSAtnrWkc0cjBro+Cu41eUEFwg5ZVS/ 10S+5/MByOaVN944idHZsPgOTTq6+r0EvaGugpiRwfV5R3kU+jlJF/LbX+mFdeMORdpE MCQA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@treblig.org header.s=bytemarkmx header.b=dR9ol1QS; 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 cb9-20020a170906a44900b009888e294b10si3860127ejb.413.2023.06.27.03.58.44; Tue, 27 Jun 2023 03:59:08 -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=dR9ol1QS; 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 S230268AbjF0Kmw (ORCPT + 99 others); Tue, 27 Jun 2023 06:42:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51472 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229647AbjF0Kmv (ORCPT ); Tue, 27 Jun 2023 06:42:51 -0400 Received: from mx.treblig.org (unknown [IPv6:2a00:1098:5b::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BD6ED10CB; Tue, 27 Jun 2023 03:42:49 -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=b6mr6IUj1sLKRFPC3AWOY5M8vnn/8M/C9oYU60Dvbts=; b=dR9ol1QSKJfK37McjDOz41Gsv0 neGIJPSNJah6e0ntbkCkVhdo+dfy5MXj/zjGGmjB2fyUvBM9b/AMTEKfA8Pt+7XLM/XzB6zWCReeP uyIxa/yfYC4zQTIAsvKh0chKBxbXcFI+vdnleBudNHab8ZNbAdX1So/1EdquIwvaAcZcrLHASDFFH Bgx22cUwiPmM6M0cg9q1wInlsxibkDPYsMFFGB/z+HEly1KdnZVd3ZP6Yz2mXhxHZfdDWFlJGn6EX 3jXcNSCSDRg9f4x6763Kx6/okBhfM5G3J6hcvHZzNMQt7CrwB0oYOe8j5rO31GiAgYFnLFKHGzP9q yE0NBpmA==; Received: from dg by mx.treblig.org with local (Exim 4.94.2) (envelope-from ) id 1qE69V-00GFnB-4Y; Tue, 27 Jun 2023 10:42:29 +0000 Date: Tue, 27 Jun 2023 10:42:29 +0000 From: "Dr. David Alan Gilbert" To: Steve French Cc: Dave Kleikamp , sfrench@samba.org, linkinjeon@kernel.org, jfs-discussion@lists.sourceforge.net, linux-cifs@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: Duplicate unicode tables in smb/cifs/jfs Message-ID: References: <25821273-d391-1502-ff8a-07ea7a59c8f3@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-21-amd64 (x86_64) X-Uptime: 10:42:00 up 99 days, 21:16, 1 user, load average: 0.08, 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,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 * Steve French (smfrench@gmail.com) wrote: > On Mon, Jun 26, 2023 at 7:40 PM Dr. David Alan Gilbert > wrote: > > > * Steve French (smfrench@gmail.com) wrote: > > > probably is low risk to make the ksmbd/cifs (server and client) code > > common > > > for this > > > > I'm up for trying to do that mod; do you have a feel of the best way? > > I guess this is two copies to avoid symbol clashes if both the server > > and clients are built/loaded on the same kernel? > > > > First step would be to move common Unicode/UCS-2 header definitions from > fs/smb/client > and fs/smb/server to fs/smb/common > > Second stuff could be having a common helper module in fs/smb/common > similar to > fs/smb/common/cifs_md4.ko OK, let me have a crack at that and see where I get to. Dave > > > > I guess the clean way is to make this a separate .c/module that the > > others depend on and hten you have a nice single copy in the binary > > as well as the source. > > > > The shorter hack that at least avoids the source dupe would be to > > change the declarations in the uniupr.h files to a #define that then > > instantiates it with different names in the place those are #included. > > You'd want to move the uniupr.h up somewhere, to hmm fs/uniupr.h ? > > > > (Incidentally, I think the UNIUPR_NOLOWER is always defined > > so that whole chunk can go in both of them). > > > > I guess the next level would be trying to merge parts of server/client > > unicode.[ch] - but I was just eyeing up this particularly simple dupe in > > that odd uniupr.h. > > > > > (and leave the JFS code alone as Dave Kleikamp suggests) > > > > Well hmm; my reading is the tables that JFS uses are *identical* > > to these; so if this header was somewhere outside of fs/smb it could > > probably #include it and just use the same table, with a > > no-binary-change. > > > > Dave > > > > > On Mon, Jun 26, 2023 at 12:03 PM Dave Kleikamp > > > > > wrote: > > > > > > > On 6/25/23 9:28AM, Dr. David Alan Gilbert wrote: > > > > > Hi All, > > > > > I just tripped over three sets of duplicated unicode tables and > > > > > wondered if anyone had tried to rationalise them: > > > > > > > > > > The pair of: > > > > > ./fs/smb/server/uniupr.h > > > > > ./fs/smb/client/cifs_uniupr.h > > > > > > > > > > are identical except for formatting. > > > > > > > > > > ./fs/jfs/jfs_uniupr.c, > > > > > and I think this is the same with some change in variable name. > > > > > > > > From JFS's point of view, I wonder how relevant any of this code is. > > > > The Linux port of JFS originally was interested in compatibility with > > > > OS/2, which had case-insensitive file names. (Case-preserving, if I > > > > remember correctly, but names would match in a case-insensitive > > manner.) > > > > > > > > I would be surprised if anyone cares about this feature anymore. > > Without > > > > a JFS_OS2 flag set in the superblock, none of the case-conversion code > > > > comes into play. > > > > > > > > I assume SMB cares more about this and if Steve has an opinion on how > > to > > > > address this, I'd be happy to follow his lead. Probably better than > > > > ripping function out of JFS that could break some user that I'm not > > > > aware of. > > > > > > > > Shaggy > > > > > > > > > > > > > > (I'm guessing the same thing is implemented in a bunch of > > > > > other places as well in a different way) > > > > > > > > > > Would it make sense to swing fs/smb/server/uniupr.h up to > > > > > hmm, maybe fs/uniupr.h, remove any of the cifs_ prefixes > > > > > and then use the same include in all 3 places? > > > > > > > > > > Maybe then later look at using some of the nls code? > > > > > > > > > > Dave (who just tripped over this stuff) > > > > > > > > > > > > > > > > > > -- > > > 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 |_______/ > > > > > -- > 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 |_______/