2002-01-07 15:24:49

by Luc Robalo Marques

[permalink] [raw]
Subject: nbd request too big

hi,

i would like to setup a nbd but when I try to mke2fs
the device on the client side, the connection hangs
and /log/messages contains a entry for mthe server
telling that the request was too big.
Any idea what caused it.

Thanks you

Luc robalo Marques

___________________________________________________________
Do You Yahoo!? -- Une adresse @yahoo.fr gratuite et en fran?ais !
Yahoo! Courrier : http://courrier.yahoo.fr


2002-01-07 15:37:10

by Steven Whitehouse

[permalink] [raw]
Subject: Re: nbd request too big

Hi,

I presume you are using Pavel's server from his web page ? You need to increase
the buffer size that the server uses. This happens as a result of the change
a little while ago of nbd to use the elevator to merge requests at the nbd
client end. If memory serves the maximum size of request is sizeof(header) +
128 * block_size, so you need to alter the server to use that size.

You'll find the buffer size in the main loop of the mainloop() function
char buf[20480]; needs increasing (to (131072 + 28) for 1k blocks for example)
and also you'll need to increase the value here (to 131072 in this example):

if (len > 10240)
err("Request too big!");

Then it should work fine.

Steve.

>
> hi,
>
> i would like to setup a nbd but when I try to mke2fs
> the device on the client side, the connection hangs
> and /log/messages contains a entry for mthe server
> telling that the request was too big.
> Any idea what caused it.
>
> Thanks you
>
> Luc robalo Marques
>
> ___________________________________________________________
> Do You Yahoo!? -- Une adresse @yahoo.fr gratuite et en fran?ais !
> Yahoo! Courrier : http://courrier.yahoo.fr
> -
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to [email protected]
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/
>

2002-01-07 17:54:58

by Paul Clements

[permalink] [raw]
Subject: Re: nbd request too big

Hi,

If you're using the nbd-server from Pavel Machek's web site, you'll need to patch
nbd-server.c to make it work on ~2.4.3+ kernels. My patched version of nbd-server.c
and cliserv.h are attached. The patched files make the server's request buffer be
dynamically allocated, so any size request can be handled by the server.
The patched version also fixes some other outdated code (e.g., llseek -> lseek64).


--
Paul Clements
[email protected]



On Mon, 7 Jan 2002, [iso-8859-1] Luc Robalo Marques wrote:

> hi,
>
> i would like to setup a nbd but when I try to mke2fs
> the device on the client side, the connection hangs
> and /log/messages contains a entry for mthe server
> telling that the request was too big.
> Any idea what caused it.
>
> Thanks you
>
> Luc robalo Marques
>
> ___________________________________________________________
> Do You Yahoo!? -- Une adresse @yahoo.fr gratuite et en fran?ais !
> Yahoo! Courrier : http://courrier.yahoo.fr
> -
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to [email protected]
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/
>


Attachments:
nbd-server.c (9.01 kB)
cliserv.h (2.36 kB)
Download all attachments

2002-01-11 22:56:20

by Pavel Machek

[permalink] [raw]
Subject: Re: nbd request too big

Hi!

> If you're using the nbd-server from Pavel Machek's web site, you'll need to patch
> nbd-server.c to make it work on ~2.4.3+ kernels. My patched version of nbd-server.c
> and cliserv.h are attached. The patched files make the server's request buffer be
> dynamically allocated, so any size request can be handled by the server.
> The patched version also fixes some other outdated code (e.g., llseek -> lseek64).

You seem to be have used old version of nbd-server to do the
patch. Could you port it to new version (at nbd.sourceforge.net) and
mail me a patch?

Pavel
--
(about SSSCA) "I don't say this lightly. However, I really think that the U.S.
no longer is classifiable as a democracy, but rather as a plutocracy." --hpa

2002-01-18 16:47:11

by Pavel Machek

[permalink] [raw]
Subject: Re: nbd request too big

Hi!

> I presume you are using Pavel's server from his web page ? You need to increase
> the buffer size that the server uses. This happens as a result of the change
> a little while ago of nbd to use the elevator to merge requests at the nbd
> client end. If memory serves the maximum size of request is sizeof(header) +
> 128 * block_size, so you need to alter the server to use that size.
>
> You'll find the buffer size in the main loop of the mainloop() function
> char buf[20480]; needs increasing (to (131072 + 28) for 1k blocks for example)
> and also you'll need to increase the value here (to 131072 in this example):
>
> if (len > 10240)
> err("Request too big!");

Thanx for explanation and would-be patch. I'll apply it into CVS.

Perhaps have acount on sourceforge and you want write access to the CVS?

Pavel
--
Philips Velo 1: 1"x4"x8", 300gram, 60, 12MB, 40bogomips, linux, mutt,
details at http://atrey.karlin.mff.cuni.cz/~pavel/velo/index.html.