Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/tests/fs/puffs PR/55102: Kamil Rytarowski: Duplicate fifo_vn...



details:   https://anonhg.NetBSD.org/src/rev/c0e1a270c182
branches:  trunk
changeset: 932789:c0e1a270c182
user:      christos <christos%NetBSD.org@localhost>
date:      Fri May 15 23:32:27 2020 +0000

description:
PR/55102: Kamil Rytarowski: Duplicate fifo_vnodeop_entries,
fifo_vnodeop_opv_desc symbols.

Many filesystems ffs, lfs, ulfs, chfs, ext2fs etc. use fifofs
internally for their fifo vnops. NFS does too, but it also needs
networking anyway.  Unfortunately fifofs brings in a lot of the
networking code so that the rumpkernel is not well partition. In
addition the fifo code is rarely used.

The existing hack depended on duplicating the above symbols and
adding minimal functionality for the majority of the the tests
(except the ffs and the puffs one). In these two cases both symbols
were loaded and the symbol sizes clashed which broke the sanitizers.
While this can be fixed with weak symbols and other kinds of
indirection, it is more straight forward to select between the
minimal and the full fifofs implementation by introducing a new
shared library librumpvfs_nofifofs.

diffstat:

 distrib/sets/lists/base/shl.mi    |   5 ++++-
 distrib/sets/lists/comp/mi        |   4 +++-
 distrib/sets/lists/comp/shl.mi    |   3 ++-
 distrib/sets/lists/debug/mi       |   3 ++-
 distrib/sets/lists/debug/shl.mi   |   3 ++-
 sys/rump/fs/Makefile.rumpfscomp   |   4 ++--
 sys/rump/librump/rumpvfs/rumpfs.c |  14 ++------------
 tests/Makefile.inc                |   9 +++++++--
 tests/fs/ffs/Makefile             |   4 ++--
 tests/fs/puffs/Makefile           |   6 +++---
 10 files changed, 29 insertions(+), 26 deletions(-)

diffs (208 lines):

diff -r 83adfb39bf54 -r c0e1a270c182 distrib/sets/lists/base/shl.mi
--- a/distrib/sets/lists/base/shl.mi    Fri May 15 22:39:54 2020 +0000
+++ b/distrib/sets/lists/base/shl.mi    Fri May 15 23:32:27 2020 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: shl.mi,v 1.885 2020/05/15 14:57:33 joerg Exp $
+# $NetBSD: shl.mi,v 1.886 2020/05/15 23:32:27 christos Exp $
 #
 # Note:        Don't delete entries from here - mark them as "obsolete" instead,
 #      unless otherwise stated below.
@@ -844,6 +844,9 @@
 ./usr/lib/librumpvfs_layerfs.so                        base-rump-shlib         rump
 ./usr/lib/librumpvfs_layerfs.so.0              base-rump-shlib         rump
 ./usr/lib/librumpvfs_layerfs.so.0.0            base-rump-shlib         rump
+./usr/lib/librumpvfs_nofifofs.so               base-rump-shlib         rump
+./usr/lib/librumpvfs_nofifofs.so.0             base-rump-shlib         rump
+./usr/lib/librumpvfs_nofifofs.so.0.0           base-rump-shlib         rump
 ./usr/lib/libsaslc.so                          base-sys-shlib          compatfile
 ./usr/lib/libsaslc.so.0                                base-sys-shlib          compatfile
 ./usr/lib/libsaslc.so.0.0                      base-sys-shlib          compatfile
diff -r 83adfb39bf54 -r c0e1a270c182 distrib/sets/lists/comp/mi
--- a/distrib/sets/lists/comp/mi        Fri May 15 22:39:54 2020 +0000
+++ b/distrib/sets/lists/comp/mi        Fri May 15 23:32:27 2020 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: mi,v 1.2325 2020/05/06 16:17:36 nia Exp $
+#      $NetBSD: mi,v 1.2326 2020/05/15 23:32:27 christos Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 ./etc/mtree/set.comp                           comp-sys-root
@@ -3863,6 +3863,8 @@
 ./usr/lib/librumpvfs_fifofs_p.a                        comp-c-proflib          rump,profile
 ./usr/lib/librumpvfs_layerfs.a                 comp-c-lib              rump
 ./usr/lib/librumpvfs_layerfs_p.a               comp-c-proflib          rump,profile
+./usr/lib/librumpvfs_nofifofs.a                        comp-c-lib              rump
+./usr/lib/librumpvfs_nofifofs_p.a              comp-c-proflib          rump,profile
 ./usr/lib/librumpvfs_p.a                       comp-c-proflib          compatfile,rump,profile
 ./usr/lib/libsaslc.a                           comp-c-clib             compatfile
 ./usr/lib/libsaslc_p.a                         comp-c-proflib          compatfile,profile
diff -r 83adfb39bf54 -r c0e1a270c182 distrib/sets/lists/comp/shl.mi
--- a/distrib/sets/lists/comp/shl.mi    Fri May 15 22:39:54 2020 +0000
+++ b/distrib/sets/lists/comp/shl.mi    Fri May 15 23:32:27 2020 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: shl.mi,v 1.331 2020/04/04 19:26:51 christos Exp $
+# $NetBSD: shl.mi,v 1.332 2020/05/15 23:32:28 christos Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 #
@@ -252,6 +252,7 @@
 ./usr/lib/librumpvfs_aio_pic.a                 comp-c-piclib           picinstall,rump
 ./usr/lib/librumpvfs_fifofs_pic.a              comp-c-piclib           picinstall,rump
 ./usr/lib/librumpvfs_layerfs_pic.a             comp-c-piclib           picinstall,rump
+./usr/lib/librumpvfs_nofifofs_pic.a            comp-c-piclib           picinstall,rump
 ./usr/lib/librumpvfs_pic.a                     comp-c-piclib           compatfile,picinstall,rump
 ./usr/lib/libsaslc_pic.a                       comp-c-piclib           compatfile,picinstall
 ./usr/lib/libsdp_pic.a                         comp-obsolete           obsolete
diff -r 83adfb39bf54 -r c0e1a270c182 distrib/sets/lists/debug/mi
--- a/distrib/sets/lists/debug/mi       Fri May 15 22:39:54 2020 +0000
+++ b/distrib/sets/lists/debug/mi       Fri May 15 23:32:27 2020 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.309 2020/05/01 17:14:28 christos Exp $
+# $NetBSD: mi,v 1.310 2020/05/15 23:32:28 christos Exp $
 ./etc/mtree/set.debug                           comp-sys-root
 ./usr/lib                                      comp-sys-usr            compatdir
 ./usr/lib/i18n/libBIG5_g.a                     comp-c-debuglib         debuglib,compatfile
@@ -242,6 +242,7 @@
 ./usr/lib/librumpvfs_fifofs_g.a                        comp-c-debuglib         debuglib,rump
 ./usr/lib/librumpvfs_g.a                       comp-c-debuglib         debuglib,compatfile,rump
 ./usr/lib/librumpvfs_layerfs_g.a               comp-c-debuglib         debuglib,rump
+./usr/lib/librumpvfs_nofifofs_g.a              comp-c-debuglib         debuglib,rump
 ./usr/lib/libsaslc_g.a                         comp-c-debuglib         debuglib,compatfile
 ./usr/lib/libsdp_g.a                           comp-obsolete           obsolete,compatfile
 ./usr/lib/libskey_g.a                          comp-c-debuglib         debuglib,compatfile,skey
diff -r 83adfb39bf54 -r c0e1a270c182 distrib/sets/lists/debug/shl.mi
--- a/distrib/sets/lists/debug/shl.mi   Fri May 15 22:39:54 2020 +0000
+++ b/distrib/sets/lists/debug/shl.mi   Fri May 15 23:32:27 2020 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: shl.mi,v 1.246 2020/05/15 14:57:33 joerg Exp $
+# $NetBSD: shl.mi,v 1.247 2020/05/15 23:32:28 christos Exp $
 ./usr/lib/libbfd_g.a                                           comp-c-debuglib debuglib,compatfile,binutils
 ./usr/libdata/debug/lib                                                base-sys-usr    debug,dynamicroot,compatdir
 ./usr/libdata/debug/lib/libavl.so.0.0.debug                    comp-zfs-debug  debug,dynamicroot,zfs
@@ -297,6 +297,7 @@
 ./usr/libdata/debug/usr/lib/librumpvfs_aio.so.0.0.debug                comp-rump-debug debug,rump
 ./usr/libdata/debug/usr/lib/librumpvfs_fifofs.so.0.0.debug     comp-rump-debug debug,rump
 ./usr/libdata/debug/usr/lib/librumpvfs_layerfs.so.0.0.debug    comp-rump-debug debug,rump
+./usr/libdata/debug/usr/lib/librumpvfs_nofifofs.so.0.0.debug   comp-rump-debug debug,rump
 ./usr/libdata/debug/usr/lib/libsaslc.so.0.0.debug              comp-sys-debug  debug,compatfile
 ./usr/libdata/debug/usr/lib/libskey.so.2.0.debug               comp-sys-debug  debug,compatfile,skey
 ./usr/libdata/debug/usr/lib/libsl.so.6.0.debug                 comp-krb5-debug debug,compatfile,kerberos
diff -r 83adfb39bf54 -r c0e1a270c182 sys/rump/fs/Makefile.rumpfscomp
--- a/sys/rump/fs/Makefile.rumpfscomp   Fri May 15 22:39:54 2020 +0000
+++ b/sys/rump/fs/Makefile.rumpfscomp   Fri May 15 23:32:27 2020 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: Makefile.rumpfscomp,v 1.7 2020/04/04 15:43:21 jdolecek Exp $
+#      $NetBSD: Makefile.rumpfscomp,v 1.8 2020/05/15 23:32:28 christos Exp $
 #
 
 .include <bsd.own.mk>
@@ -13,7 +13,7 @@
 
 RUMPFSCOMP+=   nfsserver
 
-RUMPVFSCOMP+=  fifo layer
+RUMPVFSCOMP+=  fifo layer nofifo
 
 RUMPFSSYSCOMP+=        aio
 
diff -r 83adfb39bf54 -r c0e1a270c182 sys/rump/librump/rumpvfs/rumpfs.c
--- a/sys/rump/librump/rumpvfs/rumpfs.c Fri May 15 22:39:54 2020 +0000
+++ b/sys/rump/librump/rumpvfs/rumpfs.c Fri May 15 23:32:27 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: rumpfs.c,v 1.160 2020/05/15 00:04:02 christos Exp $    */
+/*     $NetBSD: rumpfs.c,v 1.161 2020/05/15 23:32:28 christos Exp $    */
 
 /*
  * Copyright (c) 2009, 2010, 2011 Antti Kantee.  All Rights Reserved.
@@ -26,7 +26,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: rumpfs.c,v 1.160 2020/05/15 00:04:02 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rumpfs.c,v 1.161 2020/05/15 23:32:28 christos Exp $");
 
 #include <sys/param.h>
 #include <sys/atomic.h>
@@ -49,7 +49,6 @@
 #include <sys/fstrans.h>
 #include <sys/unistd.h>
 
-#include <miscfs/fifofs/fifo.h>
 #include <miscfs/specfs/specdev.h>
 #include <miscfs/genfs/genfs.h>
 #include <miscfs/genfs/genfs_node.h>
@@ -88,15 +87,6 @@
 static int rump_vop_access(void *);
 static int rump_vop_fcntl(void *);
 
-int (**fifo_vnodeop_p)(void *);
-const struct vnodeopv_entry_desc fifo_vnodeop_entries[] = {
-       { &vop_default_desc, vn_default_error },
-       { &vop_putpages_desc, genfs_null_putpages },
-       { NULL, NULL }
-};
-const struct vnodeopv_desc fifo_vnodeop_opv_desc =
-       { &fifo_vnodeop_p, fifo_vnodeop_entries };
-
 int (**rump_vnodeop_p)(void *);
 const struct vnodeopv_entry_desc rump_vnodeop_entries[] = {
        { &vop_default_desc, vn_default_error },
diff -r 83adfb39bf54 -r c0e1a270c182 tests/Makefile.inc
--- a/tests/Makefile.inc        Fri May 15 22:39:54 2020 +0000
+++ b/tests/Makefile.inc        Fri May 15 23:32:27 2020 +0000
@@ -1,7 +1,12 @@
-# $NetBSD: Makefile.inc,v 1.6 2020/03/01 18:08:12 christos Exp $
+# $NetBSD: Makefile.inc,v 1.7 2020/05/15 23:32:28 christos Exp $
 WARNS ?= 4
 CWARNFLAGS+= -Wno-missing-noreturn
 TOOLSSRCDIR:= ${.PARSEDIR}
 CPPFLAGS+= -I${TOOLSSRCDIR}
-LIBRUMPBASE = -lrumpvfs -lrump -lrumpvfs -lrumpuser -lrump -lpthread
+.if ${RUMPFIFO:Uno} == "yes"
+LIBRUMPFIFO = -lrumpvfs_fifofs -lrumpnet_local -lrumpnet_net -lrumpnet
+.else
+LIBRUMPFIFO = -lrumpvfs_nofifofs 
+.endif
+LIBRUMPBASE = -lrumpvfs -lrump ${LIBRUMPFIFO} -lrumpvfs -lrumpuser -lrump -lpthread
 
diff -r 83adfb39bf54 -r c0e1a270c182 tests/fs/ffs/Makefile
--- a/tests/fs/ffs/Makefile     Fri May 15 22:39:54 2020 +0000
+++ b/tests/fs/ffs/Makefile     Fri May 15 23:32:27 2020 +0000
@@ -1,6 +1,7 @@
-#      $NetBSD: Makefile,v 1.21 2020/04/10 22:58:47 christos Exp $
+#      $NetBSD: Makefile,v 1.22 2020/05/15 23:32:28 christos Exp $
 #
 
+RUMPFIFO=yes   # use the real rump fifofs
 .include <bsd.own.mk>
 
 TESTSDIR=      ${TESTSBASE}/fs/ffs
@@ -33,7 +34,6 @@
 LDADD+=-lrumpfs_ffs                                            # ffs
 LDADD+=-lrumpdev_fss                                           # snapshot dev
 LDADD+=-lrumpdev_disk -lrumpdev                                        # disk device
-LDADD+=-lrumpvfs_fifofs -lrumpnet_local -lrumpnet_net -lrumpnet        # fifos
 VFSTESTDIR != cd ${.CURDIR}/../common && ${PRINTOBJDIR}
 LDADD+=-L${VFSTESTDIR} -lvfstest
 LDADD+=-lrumpkern_sysproxy ${LIBRUMPBASE}
diff -r 83adfb39bf54 -r c0e1a270c182 tests/fs/puffs/Makefile
--- a/tests/fs/puffs/Makefile   Fri May 15 22:39:54 2020 +0000
+++ b/tests/fs/puffs/Makefile   Fri May 15 23:32:27 2020 +0000
@@ -1,6 +1,7 @@
-#      $NetBSD: Makefile,v 1.15 2020/03/01 18:08:14 christos Exp $
+#      $NetBSD: Makefile,v 1.16 2020/05/15 23:32:28 christos Exp $
 #
 
+RUMPFIFO=yes   # Use the real rump fifo
 .include <bsd.own.mk>
 
 SUBDIR+=       h_dtfs
@@ -15,8 +16,7 @@
 LDADD+=-L${VFSTESTDIR} -lvfstest
 
 LDADD+=                -lrumpdev_putter -lrumpdev
-LDADD+=                -lrumpfs_syspuffs -lrumpvfs_fifofs
-LDADD+=                -lrumpnet_local -lrumpnet_net -lrumpnet
+LDADD+=                -lrumpfs_syspuffs 
 LDADD+=                ${LIBRUMPBASE}
 
 # required by -DPUFFSDUMP



Home | Main Index | Thread Index | Old Index