[ENBD] fixup_slot failed to find slot....

Peter T. Breuer ptb at inv.it.uc3m.es
Thu Mar 9 15:14:52 MST 2006


"Also sprach scunacc:"
> Dear Peter,
> 
> Well, for reasons that I won't get into, I am now trying the thing on a
> different server (I've moved to an FC2 server with a custom kernel:
> 2.6.5-1.358custom #1 SMP). Unconnected to enbd issues directly.
> 
> Your new code compiled cleanly with two small exceptions.
> 
> The inline declarations in enbd_base.c are still there - so I moved them
> up, and there is a scripts/fix-includes line in the Makefile for the

Hmm ... I see two forward declarations that can be moved up:


    /* PTB forward decls
     */
       static int enbd_clr_sock (struct enbd_slot *slot);
       static int enbd_soft_reset (struct enbd_device*);

Are those them? I've now moved those up.


> 2.6.X series kernels that should be:
> 
>     FIXDEP        := scripts/basic/fixdep
>     SPLIT_INCLUDE = scripts/basic/split-include
> 
> [basically, the ifneq isn't working and I was being lazy so I commented
> out the ifneq and hard coded those two lines in immediately below it]

OOOOOOOOH.  You mean the copy of the kernel's Makefile in the
kernel/linux-2.6.x subdir of the archive?  It looks the same as a
2.6.3 Makefile  with very minor differences:

  -       $(Q)$(MAKE) -rR -f $(srctree)/scripts/Makefile.modinst
  +       $(Q)$(MAKE) -rR -f $(srctree)/scripts/Makefile.modinst VPATH=$(VPATH)

That sort of change. It's been assumed that $(KBUILD_SRC) is set too.

  -clean := -f $(if $(KBUILD_SRC),$(srctree)/)scripts/Makefile.clean obj
  +clean := -f $(srctree)/scripts/Makefile.clean obj


The first ifneq is

  # Helpers built in scripts/

  ifneq ($(shell test $(SUBLEVEL) -ge 8 && echo "yes"),)
      FIXDEP        := scripts/basic/fixdep
      SPLIT_INCLUDE = scripts/basic/split-include
  else
      FIXDEP        := scripts/fixdep
      SPLIT_INCLUDE := scripts/split-include
  endif

You want the first one? But SUBLEVEL is defined, so it must work :-). 
The definition is in the call line:


  make -C /lib/modules/2.6.15.4-SMP/build CC="gcc -I$VPATH/include" -f "$VPATH/Makefile" SUBDIRS="/tmp/linux-2.6.x/drivers/block/enbd" KBUILD_VERBOSE=1 CONFIG_BLK_DEV_ENBD=m CONFIG_BLK_DEV_ENBD_IOCTL=m CFLAGS_MODULE='-DMODULE -I"$VPATH/include"' MODVERDIR="/tmp/linux-2.6.x/.tmp_versions" VERSION="2" PATCHLEVEL="6" SUBLEVEL="15" EXTRAVERSION=".4-SMP" modules 


  



> OK. With those minor problems out of the way, now, out of 14
> connections, I get only 4 that make it and for the rest enbd-client dies
> with a segmentation fault.

Well, probably a development code update problem. Here it all works
fine.

betty:/usr/oboe/ptb/lang/c/nbd/nbd-2.4.33% sudo make
mkdir -p /tmp
cp nbd/configure /tmp/configure && chmod +x /tmp/configure
make config
make[1]: Entering directory `/home/oboe/ptb/lang/c/nbd/nbd-2.4.33'
export CONFIG_SITE=/home/oboe/ptb/lang/c/nbd/nbd-2.4.33/conf/config.Linux; \
cd /tmp;  ./configure --srcdir=/home/oboe/ptb/lang/c/nbd/nbd-2.4.33/nbd  \
                                  --with-kernel-srcdir=/usr; \

creating cache ./config.cache
checking for gcc... gcc
checking whether the C compiler (gcc -D_LARGEFILE64_SOURCE=1 -D_LARGEFILE_SOURCE=1 -D_GNU_SOURCE=1 -D_XOPEN_SOURCE=1 -D_FILE_OFFSET_BITS=64 -Wall -Winline -O2 -I/usr/include ) works... yes
checking whether the C compiler (gcc -D_LARGEFILE64_SOURCE=1 -D_LARGEFILE_SOURCE=1 -D_GNU_SOURCE=1 -D_XOPEN_SOURCE=1 -D_FILE_OFFSET_BITS=64 -Wall -Winline -O2 -I/usr/include ) is a cross-compiler... no
checking whether we are using GNU C... yes
checking whether gcc accepts -g... yes
checking whether warnings should be enabled... yes
checking for install... /usr/bin/install
...
gcc -D_LARGEFILE64_SOURCE=1 -D_LARGEFILE_SOURCE=1 -D_GNU_SOURCE=1 -D_XOPEN_SOURCE=1 -D_FILE_OFFSET_BITS=64 -Wall -Winline -O2  -I/tmp  -I/home/oboe/ptb/lang/c/nbd/nbd-2.4.33/kernel/linux-2.6.x/include  -I/usr/include   -DDEBUG=0 -o enbd-test.o -c /home/oboe/ptb/lang/c/nbd/nbd-2.4.33/nbd/enbd-test.c
gcc  -o enbd-test enbd-test.o -lwrap -lpub 
cp /home/oboe/ptb/lang/c/nbd/nbd-2.4.33/nbd/enbd-maketest /tmp/
make[1]: Leaving directory `/var/tmp'
make[1]: Entering directory `/usr/local/src/linux-2.6.15.4'
  SPLIT   include/linux/autoconf.h -> include/config/*
*** Warning: Overriding SUBDIRS on the command line can cause
***          inconsistencies
mkdir -p /tmp/linux-2.6.x/.tmp_versions
make -f /usr/local/src/linux-2.6.15.4/scripts/Makefile.build obj=/tmp/linux-2.6.x/drivers/block/enbd
  gcc -I/home/oboe/ptb/lang/c/nbd/nbd-2.4.33/kernel/linux-2.6.x/include -Wp,-MD,/tmp/linux-2.6.x/drivers/block/enbd/.enbd_base.o.d -nostdinc -iwithprefix include -D__KERNEL__ -Iinclude  -D__KERNEL__ -Iinclude  -Wall -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -pipe -msoft-float   -march=i686  -Iinclude/asm-i386/mach-default -O2 -fomit-frame-pointer    -DMODULE -I"/home/oboe/ptb/lang/c/nbd/nbd-2.4.33/kernel/linux-2.6.x/include" -DKBUILD_BASENAME=enbd_base -DKBUILD_MODNAME=enbd -c -o /tmp/linux-2.6.x/drivers/block/enbd/enbd_base.o /tmp/linux-2.6.x/drivers/block/enbd/enbd_base.c
...
  gcc -I/home/oboe/ptb/lang/c/nbd/nbd-2.4.33/kernel/linux-2.6.x/include -Wp,-MD,/tmp/linux-2.6.x/drivers/block/enbd/.enbd_ioctl.o.d -nostdinc -iwithprefix include -D__KERNEL__ -Iinclude  -D__KERNEL__ -Iinclude  -Wall -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -pipe -msoft-float   -march=i686  -Iinclude/asm-i386/mach-default -O2 -fomit-frame-pointer    -DMODULE -I"/home/oboe/ptb/lang/c/nbd/nbd-2.4.33/kernel/linux-2.6.x/include" -DKBUILD_BASENAME=enbd_ioctl -DKBUILD_MODNAME=enbd_ioctl -c -o /tmp/linux-2.6.x/drivers/block/enbd/enbd_ioctl.o /tmp/linux-2.6.x/drivers/block/enbd/enbd_ioctl.c
  Building modules, stage 2.
make -rR -f /usr/local/src/linux-2.6.15.4/scripts/Makefile.modpost VPATH=/usr/local/src/linux-2.6.15.4
  scripts/mod/modpost   -o /usr/local/src/linux-2.6.15.4/Module.symvers /tmp/linux-2.6.x/drivers/block/enbd/enbd.o /tmp/linux-2.6.x/drivers/block/enbd/enbd_ioctl.o
  ld -m elf_i386 -r -o /tmp/linux-2.6.x/drivers/block/enbd/enbd.ko /tmp/linux-2.6.x/drivers/block/enbd/enbd.o /tmp/linux-2.6.x/drivers/block/enbd/enbd.mod.o
  ld -m elf_i386 -r -o /tmp/linux-2.6.x/drivers/block/enbd/enbd_ioctl.ko /tmp/linux-2.6.x/drivers/block/enbd/enbd_ioctl.o /tmp/linux-2.6.x/drivers/block/enbd/enbd_ioctl.mod.o
make[1]: Leaving directory `/usr/local/src/linux-2.6.15.4'


and that is against 2.6.15.4 !
  

When I run make test I get ...


...
enbd-server 23822: server (1) sent sig [NBDabcdefNBD] ok
enbd-client 23827: client (2) got a signature ok from localhost:3034
enbd-client 23827: client (2) enters setsig
enbd-client 23827: client (2) set sig uses whole disk, wants slot 3
enbd-client 23827: client (2) set sig or passed sigchk OK
enbd-client 23827: client (2) sig matched OK
enbd-client 23827: client (2) begins main loop
enbd-server 23822: server (1) set new signal handlers
/dev/nda has 1048576 bytes in 1024 blocks of 1024 bytes each
flushing buffers..done
writing....5%....10%....15%....20%....25%....30%....35%....40%....45%....50%....55%....60%....65%....70%....75%....80%....85%....90%....95%....done
test 1 success:  0 incorrect blocks
flushing buffers..
...



> In /var/log/messages I get:
> 
> Mar  9 13:17:48 localhost kernel: ENBD #3931[2]: fixup_slot failed to
> find slot for pid 4151 ioctl MY_NBD_SET_SIG arg (user 776f6562) in user
> addr fef468d0

It doesn't matter. That's normal. Look at your segfaulting client, not
the log.

> for each failed connection.
> 
> Thoughts?


What's this segfault?

> Oh, BTW, I am also trying out Jumbo frames - just to complicate life.
> Does your code react in any way badly in that context? (MTU 9000)

I have no idea why it should! It's not dependent on transport.


Tell me about this segfault please!!!!

Peter


More information about the ENBD mailing list