[ENBD] diskless enbd-client/enbd on initrd
Peter T. Breuer
ptb at inv.it.uc3m.es
Mon Apr 10 04:17:06 MDT 2006
"Also sprach Rudolph Bott:"
> Ok, this is what dmesg' spitted out after a successful boot (with the
> previously described setup):
>
> ENBD #5427[0]: enbd_init Network Block Device originally by
> ENBD #4696[3]: enbd_media_changed REMOTE CHECK still has REMOTE VALID on nda
> ENBD #875[4]: enbd_open DISK CHECK wanted in open on device nda
> ENBD #4640[4]: enbd_media_changed MEDIA CHANGED called
> ENBD #4696[4]: enbd_media_changed REMOTE CHECK still has REMOTE VALID on nda
There's no message here. Hence this is not from the test you ran
before, where the client reported that it has incorrect signature.
> Now I switched over to the binaries you provided on the ftp-site and I'm
> stuck way before (at least with unchanged cmd line): the client is not
> able to negotiate a connection and dies
That is false - It DOES "negotiate a connection" because it does so
here! Since tcp is universal, it does so there also. You must have
another, different, error, not related to "negotiating a connection".
Please show the kernel and log messages from such a situation.
> The signature is set to 'xenoo'
> with -i on both sides, so I don't see any error here.
Please don't _assume_! It's a little annoying and I suspect is behind
why you are having trouble ... what you have to do is _observe_ - your
thoughts are irrelevant. Either the signature is correct or it isn't, and
you must observe it, one way or the other. But removing the check would
remove the necessity, so you should do that.
> Both enbd-related
> modules are loaded. And where am I suppose to add that 'return 0;'-line?
> It appears quite often:
I don't understand! I gave you a precise location, and it is quite
clear where "it appears". I said:
But just set my_nbd_set_sig to always return 0.
static int
my_nbd_set_sig (struct enbd_slot *slot, int *sig)
{
int err = 0;
int buf[ENBD_SIGLEN / sizeof (int)];
int islot = slot->i;
struct enbd_device *lo = slot->lo;
+ return 0;
and I cannot see how you can mistake the position given the function
name, context of the line that is to be changed, and the position of the
new insertion relative to that context.
> I tried to change the function declared in
> kernel/linux-2.6.x/drivers/block/enbd/enbd_base.c, but that didn't
I don't know what function you mean here;, but if it is the one I indicated
above, then it DOES "change anything". It makes signatures always
succeed. Please don't state these false things. You can see from the
below that it worked ...
> enbd-client 593: client (-1) got signature [xenoo], had []
> enbd-client 593: client (-1) negotiated blksize 512
> enbd-client 593: client (-1) negotiated pulse_intvl 10
> enbd-client 593: client (-1) got session port 1113 ok
> enbd-client 593: client (-1) introduction sequence ends ok
> ENBD #3931[0]: fixup_slot failed to find slot for pid 593 ioctl
> MY_NBD_SET_SIG arg (user 6f6e6578) in user addr bfb1aa1c
> enbd-client 593: client (-1) set sig or passed sigchk OK
Here! It changed the signature set to be successful. I don't know why
you say nothing changed.
> ENBD #4424[0]: enbd_ioctl unauthorized ioctl 0xc008ab30
That's interesting. I wonder what that is. AB30. Hmm. AB. Who would use
AB as a type indicator ... je, je ... I really don't know!
> enbd-client 593: #2087 setdevicesize: client (-1) failed to set size
> 21474836480
Well, that's different! So it fails ...
if (err < 0) {
PERR ("client (%d) failed to set size %Ld\n", self->i,
(unsigned long long) size64);
return -EINVAL;
}
Would you mind finding the ioctl that failed? If that is my executable,
it would have been
err = self->ioctl (self, ENBD_SET_SECTORS64, (char *) §ors64);
so I'll work on that assumption.
> enbd-client 593: #2498 setkernelnbd: Failed set size 21474836480 on fd
> 3: No such file or directory
Well, the client says that the fd it has tried to open does not exist.
What are you opening? What errno does it return? "No such file or
directory" is not listed in errno.h, yet that is what the errno
is set to. The KERNEL MESSAGES would say. I suspect the errno is
EBADF
coming from
static int
enbd_set_size (struct enbd_device *lo, __u64 arg)
{
lo->bytesize = arg;
lo->size = arg >> 10;
lo->sectors = arg >> 9;
if (lo->inode && lo->inode->i_bdev && lo->inode->i_bdev->bd_inode) {
lo->inode->i_bdev->bd_inode->i_size = lo->bytesize;
} else {
ENBD_ERROR(
"cannot set size on device %p with inode %p\n",
lo->inode?lo->inode->i_bdev:NULL, lo->inode);
return -EBADF;
}
which indicates that there is no device associated with that inode. The kernel
messages would tell us. Please let me see them.
> enbd-client 593: #3403 introduction: Failed/5: No such file or directory
Well, we know. You don't have a device.
> nbd/time 593: # 187 uptime: bad /proc/uptime format (fd -1)
> nbd/time 593: # 187 uptime: bad /proc/uptime format (fd -1)
> nbd/time 593: # 187 uptime: bad /proc/uptime format (fd -1)
And you also have a strange kernel. Where is /proc?
> enbd-client 593: client (-1) introduction sequence ends ok
> ENBD #3931[1]: fixup_slot failed to find slot for pid 593 ioctl
> MY_NBD_SET_SIG arg (user 6f6e6578) in user addr bfb1aa1c
> enbd-client 593: client (-1) set sig or passed sigchk OK
> ENBD #4424[1]: enbd_ioctl unauthorized ioctl 0xc008ab30
ab30 again!
It says you don't have a device.
What device are you opening? WOuld you mind telling me what is
strange about your setup, rather than leaving me to guess?
Peter
More information about the ENBD
mailing list