Message ID | 20241111163634.1022-1-egyszeregy@freemail.hu (mailing list archive) |
---|---|
State | Awaiting Upstream |
Delegated to: | Netdev Maintainers |
Headers | show |
Series | netfilter: uapi: Fix file names for case-insensitive filesystem. | expand |
egyszeregy@freemail.hu <egyszeregy@freemail.hu> wrote: > rename net/ipv4/netfilter/{ipt_ECN.c => ipt_ECN_TARGET.c} (98%) > rename net/netfilter/{xt_DSCP.c => xt_DSCP_TARGET.c} (98%) > rename net/netfilter/{xt_HL.c => xt_HL_TARGET.c} (100%) > rename net/netfilter/{xt_RATEEST.c => xt_RATEEST_TARGET.c} (99%) > rename net/netfilter/{xt_TCPMSS.c => xt_TCPMSS_TARGET.c} (99%) No, please, if we have to do this, then lets merge the targets (uppercase name) into the match (lowercase), i.e. most of the contents of xt_DSCP.c go into xt_dscp.c. Same for tcpmss and others where applicable. Renaming ip6t_ECN to ip6t_ECN_TARGET makes no sense to me, there is no ip6t_ecn.c, so no collision exists for case-insensitive file systems. > --- a/include/uapi/linux/netfilter_ipv4/ipt_ECN.h > +++ b/include/uapi/linux/netfilter_ipv4/ipt_ECN_TARGET.h > @@ -11,7 +11,7 @@ > #define _IPT_ECN_TARGET_H I don't think this can be done, for any of these files, as this is UAPI code. Best you can do is follow what include/uapi/linux/netfilter/xt_MARK.h does (did).
On Mon, Nov 11, 2024 at 05:56:06PM +0100, Florian Westphal wrote: > egyszeregy@freemail.hu <egyszeregy@freemail.hu> wrote: > > rename net/ipv4/netfilter/{ipt_ECN.c => ipt_ECN_TARGET.c} (98%) > > rename net/netfilter/{xt_DSCP.c => xt_DSCP_TARGET.c} (98%) > > rename net/netfilter/{xt_HL.c => xt_HL_TARGET.c} (100%) > > rename net/netfilter/{xt_RATEEST.c => xt_RATEEST_TARGET.c} (99%) > > rename net/netfilter/{xt_TCPMSS.c => xt_TCPMSS_TARGET.c} (99%) > > No, please, if we have to do this, then lets merge the targets > (uppercase name) into the match (lowercase), i.e. most of the contents > of xt_DSCP.c go into xt_dscp.c. Agreed, please don't do this. We have seen people sending patches like this one for several years, this breaks stuff.
On Monday 2024-11-11 19:34, Pablo Neira Ayuso wrote: >On Mon, Nov 11, 2024 at 05:56:06PM +0100, Florian Westphal wrote: >> egyszeregy@freemail.hu <egyszeregy@freemail.hu> wrote: >> > rename net/ipv4/netfilter/{ipt_ECN.c => ipt_ECN_TARGET.c} (98%) >> > rename net/netfilter/{xt_DSCP.c => xt_DSCP_TARGET.c} (98%) >> > rename net/netfilter/{xt_HL.c => xt_HL_TARGET.c} (100%) >> > rename net/netfilter/{xt_RATEEST.c => xt_RATEEST_TARGET.c} (99%) >> > rename net/netfilter/{xt_TCPMSS.c => xt_TCPMSS_TARGET.c} (99%) >> >> No, please, if we have to do this, then lets merge the targets >> (uppercase name) into the match (lowercase), i.e. most of the contents >> of xt_DSCP.c go into xt_dscp.c. > >Agreed, please don't do this. > >We have seen people sending patches like this one for several years, >this breaks stuff. Because all those submissions renamed (e.g.) xt_DSCP.h to something else. It's kinda obvious that #include <xt_dscp.h> and <xt_DSCP.h> must produce the same declarations as previously available. Which seems doable with a layout like so: xt_DSCP.h: #include "xt_dscp_1.h" xt_dscp.h: #include "xt_dscp_1.h" xt_dscp_1.h: <the usual contents> That way, xt_DSCP.h overwriting xt_dscp.h as a result of `make install` (or some other file creation action) becomes inconsequential since they have the same content under that model.
2024. 11. 11. 19:34 keltezéssel, Pablo Neira Ayuso írta: > On Mon, Nov 11, 2024 at 05:56:06PM +0100, Florian Westphal wrote: >> egyszeregy@freemail.hu <egyszeregy@freemail.hu> wrote: >>> rename net/ipv4/netfilter/{ipt_ECN.c => ipt_ECN_TARGET.c} (98%) >>> rename net/netfilter/{xt_DSCP.c => xt_DSCP_TARGET.c} (98%) >>> rename net/netfilter/{xt_HL.c => xt_HL_TARGET.c} (100%) >>> rename net/netfilter/{xt_RATEEST.c => xt_RATEEST_TARGET.c} (99%) >>> rename net/netfilter/{xt_TCPMSS.c => xt_TCPMSS_TARGET.c} (99%) >> >> No, please, if we have to do this, then lets merge the targets >> (uppercase name) into the match (lowercase), i.e. most of the contents >> of xt_DSCP.c go into xt_dscp.c. > > Agreed, please don't do this. > > We have seen people sending patches like this one for several years, > this breaks stuff. These all files are broken in case-insensitive filesystem. warning: the following paths have collided (e.g. case-sensitive paths on a case-insensitive filesystem) and only one from the same colliding group is in the working tree: 'include/uapi/linux/netfilter/xt_CONNMARK.h' 'include/uapi/linux/netfilter/xt_connmark.h' 'include/uapi/linux/netfilter/xt_DSCP.h' 'include/uapi/linux/netfilter/xt_dscp.h' 'include/uapi/linux/netfilter/xt_MARK.h' 'include/uapi/linux/netfilter/xt_mark.h' 'include/uapi/linux/netfilter/xt_RATEEST.h' 'include/uapi/linux/netfilter/xt_rateest.h' 'include/uapi/linux/netfilter/xt_TCPMSS.h' 'include/uapi/linux/netfilter/xt_tcpmss.h' 'include/uapi/linux/netfilter_ipv4/ipt_ECN.h' 'include/uapi/linux/netfilter_ipv4/ipt_ecn.h' 'include/uapi/linux/netfilter_ipv4/ipt_TTL.h' 'include/uapi/linux/netfilter_ipv4/ipt_ttl.h' 'include/uapi/linux/netfilter_ipv6/ip6t_HL.h' 'include/uapi/linux/netfilter_ipv6/ip6t_hl.h' 'net/netfilter/xt_DSCP.c' 'net/netfilter/xt_dscp.c' 'net/netfilter/xt_HL.c' 'net/netfilter/xt_hl.c' 'net/netfilter/xt_RATEEST.c' 'net/netfilter/xt_rateest.c' 'net/netfilter/xt_TCPMSS.c' 'net/netfilter/xt_tcpmss.c' What is your detailed plans to solve it? Maybe the contents of both upper and lower case *.h files can be merged to a common header files like "xt_dscp_common.h" but what about the *.c sources? For example if xt_DSCP.c removed and its content merged to xt_dscp.c before, what is the plan with kernel config options of CONFIG_NETFILTER_XT_TARGET_DSCP which was made for only xt_DSCP.c source to use in Makefile? Can we remove all of CONFIG_NETFILTER_XT_TARGET* config in the future which will lost their *.c source files? obj-$(CONFIG_NETFILTER_XT_TARGET_DSCP) += xt_DSCP.o ... obj-$(CONFIG_NETFILTER_XT_MATCH_DSCP) += xt_dscp.o
On Monday 2024-11-11 21:28, Szőke Benjamin wrote: > What is your detailed plans to solve it? Maybe the contents of both upper and > lower case *.h files can be merged to a common header files like > "xt_dscp_common.h" but what about the *.c sources? For example if xt_DSCP.c > removed and its content merged to xt_dscp.c before, what is the plan with > kernel config options of CONFIG_NETFILTER_XT_TARGET_DSCP which was made for > only xt_DSCP.c source to use in Makefile? Can we remove all of > CONFIG_NETFILTER_XT_TARGET* config in the future which will lost their *.c > source files? > > obj-$(CONFIG_NETFILTER_XT_TARGET_DSCP) += xt_DSCP.o > ... > obj-$(CONFIG_NETFILTER_XT_MATCH_DSCP) += xt_dscp.o This issue you would approach by unconditionally building a .c file and using #ifdef IS_ENABLED(...) inside the .c file. Truth to be told, the overhead for a module (12288 bytes on on x86_64) completely dwarfs the code inside it (xt_dscp.o: 765 bytes), so combining modules should provide some decent memory savings.
diff --git a/include/uapi/linux/netfilter/xt_CONNMARK.h b/include/uapi/linux/netfilter/xt_CONNMARK_TARGET.h similarity index 100% rename from include/uapi/linux/netfilter/xt_CONNMARK.h rename to include/uapi/linux/netfilter/xt_CONNMARK_TARGET.h diff --git a/include/uapi/linux/netfilter/xt_DSCP.h b/include/uapi/linux/netfilter/xt_DSCP_TARGET.h similarity index 100% rename from include/uapi/linux/netfilter/xt_DSCP.h rename to include/uapi/linux/netfilter/xt_DSCP_TARGET.h diff --git a/include/uapi/linux/netfilter/xt_MARK.h b/include/uapi/linux/netfilter/xt_MARK_TARGET.h similarity index 100% rename from include/uapi/linux/netfilter/xt_MARK.h rename to include/uapi/linux/netfilter/xt_MARK_TARGET.h diff --git a/include/uapi/linux/netfilter/xt_RATEEST.h b/include/uapi/linux/netfilter/xt_RATEEST_TARGET.h similarity index 100% rename from include/uapi/linux/netfilter/xt_RATEEST.h rename to include/uapi/linux/netfilter/xt_RATEEST_TARGET.h diff --git a/include/uapi/linux/netfilter/xt_TCPMSS.h b/include/uapi/linux/netfilter/xt_TCPMSS_TARGET.h similarity index 100% rename from include/uapi/linux/netfilter/xt_TCPMSS.h rename to include/uapi/linux/netfilter/xt_TCPMSS_TARGET.h diff --git a/include/uapi/linux/netfilter_ipv4/ipt_ECN.h b/include/uapi/linux/netfilter_ipv4/ipt_ECN_TARGET.h similarity index 95% rename from include/uapi/linux/netfilter_ipv4/ipt_ECN.h rename to include/uapi/linux/netfilter_ipv4/ipt_ECN_TARGET.h index e3630fd045b8..195a124f9bfa 100644 --- a/include/uapi/linux/netfilter_ipv4/ipt_ECN.h +++ b/include/uapi/linux/netfilter_ipv4/ipt_ECN_TARGET.h @@ -11,7 +11,7 @@ #define _IPT_ECN_TARGET_H #include <linux/types.h> -#include <linux/netfilter/xt_DSCP.h> +#include <linux/netfilter/xt_DSCP_TARGET.h> #define IPT_ECN_IP_MASK (~XT_DSCP_MASK) diff --git a/include/uapi/linux/netfilter_ipv4/ipt_TTL.h b/include/uapi/linux/netfilter_ipv4/ipt_TTL_TARGET.h similarity index 100% rename from include/uapi/linux/netfilter_ipv4/ipt_TTL.h rename to include/uapi/linux/netfilter_ipv4/ipt_TTL_TARGET.h diff --git a/include/uapi/linux/netfilter_ipv6/ip6t_HL.h b/include/uapi/linux/netfilter_ipv6/ip6t_HL_TARGET.h similarity index 100% rename from include/uapi/linux/netfilter_ipv6/ip6t_HL.h rename to include/uapi/linux/netfilter_ipv6/ip6t_HL_TARGET.h diff --git a/net/ipv4/netfilter/Makefile b/net/ipv4/netfilter/Makefile index 85502d4dfbb4..5bdb9dedcd63 100644 --- a/net/ipv4/netfilter/Makefile +++ b/net/ipv4/netfilter/Makefile @@ -39,7 +39,7 @@ obj-$(CONFIG_IP_NF_MATCH_AH) += ipt_ah.o obj-$(CONFIG_IP_NF_MATCH_RPFILTER) += ipt_rpfilter.o # targets -obj-$(CONFIG_IP_NF_TARGET_ECN) += ipt_ECN.o +obj-$(CONFIG_IP_NF_TARGET_ECN) += ipt_ECN_TARGET.o obj-$(CONFIG_IP_NF_TARGET_REJECT) += ipt_REJECT.o obj-$(CONFIG_IP_NF_TARGET_SYNPROXY) += ipt_SYNPROXY.o diff --git a/net/ipv4/netfilter/ipt_ECN.c b/net/ipv4/netfilter/ipt_ECN_TARGET.c similarity index 98% rename from net/ipv4/netfilter/ipt_ECN.c rename to net/ipv4/netfilter/ipt_ECN_TARGET.c index 5930d3b02555..5a18103a29b2 100644 --- a/net/ipv4/netfilter/ipt_ECN.c +++ b/net/ipv4/netfilter/ipt_ECN_TARGET.c @@ -14,7 +14,7 @@ #include <linux/netfilter/x_tables.h> #include <linux/netfilter_ipv4/ip_tables.h> -#include <linux/netfilter_ipv4/ipt_ECN.h> +#include <linux/netfilter_ipv4/ipt_ECN_TARGET.h> MODULE_LICENSE("GPL"); MODULE_AUTHOR("Harald Welte <laforge@netfilter.org>"); diff --git a/net/netfilter/Makefile b/net/netfilter/Makefile index f0aa4d7ef499..277befb4d1e9 100644 --- a/net/netfilter/Makefile +++ b/net/netfilter/Makefile @@ -167,20 +167,20 @@ obj-$(CONFIG_NETFILTER_XT_TARGET_CHECKSUM) += xt_CHECKSUM.o obj-$(CONFIG_NETFILTER_XT_TARGET_CLASSIFY) += xt_CLASSIFY.o obj-$(CONFIG_NETFILTER_XT_TARGET_CONNSECMARK) += xt_CONNSECMARK.o obj-$(CONFIG_NETFILTER_XT_TARGET_CT) += xt_CT.o -obj-$(CONFIG_NETFILTER_XT_TARGET_DSCP) += xt_DSCP.o -obj-$(CONFIG_NETFILTER_XT_TARGET_HL) += xt_HL.o +obj-$(CONFIG_NETFILTER_XT_TARGET_DSCP) += xt_DSCP_TARGET.o +obj-$(CONFIG_NETFILTER_XT_TARGET_HL) += xt_HL_TARGET.o obj-$(CONFIG_NETFILTER_XT_TARGET_HMARK) += xt_HMARK.o obj-$(CONFIG_NETFILTER_XT_TARGET_LED) += xt_LED.o obj-$(CONFIG_NETFILTER_XT_TARGET_LOG) += xt_LOG.o obj-$(CONFIG_NETFILTER_XT_TARGET_NETMAP) += xt_NETMAP.o obj-$(CONFIG_NETFILTER_XT_TARGET_NFLOG) += xt_NFLOG.o obj-$(CONFIG_NETFILTER_XT_TARGET_NFQUEUE) += xt_NFQUEUE.o -obj-$(CONFIG_NETFILTER_XT_TARGET_RATEEST) += xt_RATEEST.o +obj-$(CONFIG_NETFILTER_XT_TARGET_RATEEST) += xt_RATEEST_TARGET.o obj-$(CONFIG_NETFILTER_XT_TARGET_REDIRECT) += xt_REDIRECT.o obj-$(CONFIG_NETFILTER_XT_TARGET_MASQUERADE) += xt_MASQUERADE.o obj-$(CONFIG_NETFILTER_XT_TARGET_SECMARK) += xt_SECMARK.o obj-$(CONFIG_NETFILTER_XT_TARGET_TPROXY) += xt_TPROXY.o -obj-$(CONFIG_NETFILTER_XT_TARGET_TCPMSS) += xt_TCPMSS.o +obj-$(CONFIG_NETFILTER_XT_TARGET_TCPMSS) += xt_TCPMSS_TARGET.o obj-$(CONFIG_NETFILTER_XT_TARGET_TCPOPTSTRIP) += xt_TCPOPTSTRIP.o obj-$(CONFIG_NETFILTER_XT_TARGET_TEE) += xt_TEE.o obj-$(CONFIG_NETFILTER_XT_TARGET_TRACE) += xt_TRACE.o diff --git a/net/netfilter/xt_DSCP.c b/net/netfilter/xt_DSCP_TARGET.c similarity index 98% rename from net/netfilter/xt_DSCP.c rename to net/netfilter/xt_DSCP_TARGET.c index cfa44515ab72..347335b0d69a 100644 --- a/net/netfilter/xt_DSCP.c +++ b/net/netfilter/xt_DSCP_TARGET.c @@ -14,7 +14,7 @@ #include <net/dsfield.h> #include <linux/netfilter/x_tables.h> -#include <linux/netfilter/xt_DSCP.h> +#include <linux/netfilter/xt_DSCP_TARGET.h> MODULE_AUTHOR("Harald Welte <laforge@netfilter.org>"); MODULE_DESCRIPTION("Xtables: DSCP/TOS field modification"); diff --git a/net/netfilter/xt_HL.c b/net/netfilter/xt_HL_TARGET.c similarity index 100% rename from net/netfilter/xt_HL.c rename to net/netfilter/xt_HL_TARGET.c diff --git a/net/netfilter/xt_RATEEST.c b/net/netfilter/xt_RATEEST_TARGET.c similarity index 99% rename from net/netfilter/xt_RATEEST.c rename to net/netfilter/xt_RATEEST_TARGET.c index 4f49cfc27831..ca21d5da6833 100644 --- a/net/netfilter/xt_RATEEST.c +++ b/net/netfilter/xt_RATEEST_TARGET.c @@ -14,7 +14,7 @@ #include <net/netns/generic.h> #include <linux/netfilter/x_tables.h> -#include <linux/netfilter/xt_RATEEST.h> +#include <linux/netfilter/xt_RATEEST_TARGET.h> #include <net/netfilter/xt_rateest.h> #define RATEEST_HSIZE 16 diff --git a/net/netfilter/xt_TCPMSS.c b/net/netfilter/xt_TCPMSS_TARGET.c similarity index 99% rename from net/netfilter/xt_TCPMSS.c rename to net/netfilter/xt_TCPMSS_TARGET.c index 116a885adb3c..fec2f0942fc6 100644 --- a/net/netfilter/xt_TCPMSS.c +++ b/net/netfilter/xt_TCPMSS_TARGET.c @@ -22,7 +22,7 @@ #include <linux/netfilter_ipv6/ip6_tables.h> #include <linux/netfilter/x_tables.h> #include <linux/netfilter/xt_tcpudp.h> -#include <linux/netfilter/xt_TCPMSS.h> +#include <linux/netfilter/xt_TCPMSS_TARGET.h> MODULE_LICENSE("GPL"); MODULE_AUTHOR("Marc Boucher <marc@mbsi.ca>");