Re: [Nbd] Probs compiling nbd-2.9.24 on CentOS 6.0, 64bit - undefined reference to `g_key_file_get_int64'

2011-11-03 Thread Wouter Verhelst
On Thu, Nov 03, 2011 at 09:07:31PM +0100, Daniel Schwager wrote: > Hi Wouter, > > I tried to compile the current nbd 2.9.24 on > a centos 6.0, 64bit system and get the following error: > > [root@kvm23 /opt/nbd-2.9.24/src/nbd-2.9.24]$ make install > > make[1]: Entering directory `/opt/nbd-2.9

[Nbd] 2.9.25 released

2011-11-29 Thread Wouter Verhelst
Hi all, I just released 2.9.25. The main change is that TRIM now uses FALLOCATE_FL_PUNCH_HOLE, but there were also a number of minor bugfixes waiting to be released. Get at the usual place. Regards, -- The volume of a pizza of thickness a and radius z can be described by the following formula:

Re: [Nbd] 2.9.25 released

2011-12-01 Thread Wouter Verhelst
On Wed, Nov 30, 2011 at 07:16:36PM +0100, Goswin von Brederlow wrote: > Wouter Verhelst writes: > > > Hi all, > > > > I just released 2.9.25. The main change is that TRIM now uses > > FALLOCATE_FL_PUNCH_HOLE, but there were also a number of minor bugfixes > >

Re: [Nbd] [PATCH] lfs.h: fix !LFS builds

2011-12-06 Thread Wouter Verhelst
On Mon, Dec 05, 2011 at 11:32:56PM +0100, Peter Korsgaard wrote: > Commit 448637fba4 (Fix 32/64 bit confusion) broke !LFS builds as it > added the PARAM_OFFT defines inside the wrong conditional. > > Signed-off-by: Peter Korsgaard Eww, that was pretty silly of me. I've applied this, plus also i

Re: [Nbd] [PATCH] nbd-server: use modern alternative to legacy index() function

2011-12-06 Thread Wouter Verhelst
On Mon, Dec 05, 2011 at 11:40:42PM +0100, Peter Korsgaard wrote: > index() was marked as obsolete by susv3, and isn't available on uClibc > in some configurations, so use the equivalent strchr() instead: > > http://pubs.opengroup.org/onlinepubs/009695399/functions/index.html > > Signed-off-by: Pe

Re: [Nbd] history about nbd

2012-02-07 Thread Wouter Verhelst
Hi, On Mon, Feb 06, 2012 at 12:59:36PM +0800, harryxiyou wrote: > Hello list and maintainers, > > I am a student in Chinese, which developed a project named cloudxy. > The website is > http://code.google.com/p/cloudxy/ . We also use the nbd as part of > our project. > In these days, i just wann

Re: [Nbd] history about nbd

2012-02-07 Thread Wouter Verhelst
On Wed, Feb 08, 2012 at 12:13:15AM +0800, harryxiyou wrote: > On Tue, Feb 7, 2012 at 11:28 PM, Wouter Verhelst wrote: > > Hi, > > > > On Mon, Feb 06, 2012 at 12:59:36PM +0800, harryxiyou wrote: > >> Hello list and maintainers, > >> > >> I am a stu

Re: [Nbd] nbd 2.9.25 compile error on systems without FALLOC_FL_PUNCH_HOLE support

2012-02-08 Thread Wouter Verhelst
On Tue, Feb 07, 2012 at 08:47:55PM +0100, Peter Simons wrote: > The 2.9.25 release contains a bug that leads to the following compile > error when building on Linux systems without FALLOC_FL_PUNCH_HOLE > support: > > nbd-server.c:1477:28: error: 'FALLOC_FL_PUNCH_HOLE' undeclared (first use > in

Re: [Nbd] history about nbd

2012-02-10 Thread Wouter Verhelst
On Fri, Feb 10, 2012 at 05:45:09PM +0800, harryxiyou wrote: > Hi Wouter, > > On Wed, Feb 8, 2012 at 1:40 AM, Wouter Verhelst wrote: > > On Wed, Feb 08, 2012 at 12:13:15AM +0800, harryxiyou wrote: > > > > > Pavel Machek, I think around the late nineties (it w

Re: [Nbd] history about nbd

2012-02-10 Thread Wouter Verhelst
On Fri, Feb 10, 2012 at 08:48:57PM +0800, harryxiyou wrote: > Do you have some articles for describing the nbd user space codes and > realizing mechanism? What about Paul? Give me some methods to read > the codes easily. Thanks ;-) Some. If you run './configure' on the source code, that generates

Re: [Nbd] [RFC]Some questions about NBD

2012-02-11 Thread Wouter Verhelst
[Paul and I both read the list; no need to add Cc] On Sat, Feb 11, 2012 at 12:50:19AM +0800, harryxiyou wrote: > Hi Wouter, > > I have some questions to ask you, which are like following. > > 1, Pavel said "Unlike NFS, it is possible to put any file system on it. But >(also unlike NFS), if s

Re: [Nbd] [NBD]A problem about nbd-client

2012-02-15 Thread Wouter Verhelst
On Wed, Feb 15, 2012 at 11:41:12AM +0800, harryxiyou wrote: > nbd-client.c > > > int opennet(char *name, int port, int sdp) { > int sock; > char portstr[6]; > struct addrinfo hints; > struct addrinfo *ai = NULL; > struct addrinfo *rp = NULL; > int e; > >

Re: [Nbd] [patch] manpages generation fixes

2012-02-19 Thread Wouter Verhelst
On Fri, Feb 17, 2012 at 04:06:44PM +1100, Alex 'AdUser' Z wrote: > Hi all. > > I decided to share a set of patches to fix the generation of manpages. > > It fixes build failure with this message:. > 8<--- > nbd-server.5.in.sgml:1: parser error : StartTag: invalid element name > ^ >

[Nbd] New nbd release

2012-02-21 Thread Wouter Verhelst
Hi, I just did a new release of nbd, containing some accumulated fixes. I also pulled a Linus on this one, in that I think the version number scheme no longer made sense. Rather than sticking with 2.9 forever, I switched to a 3.0 version number. Get it at the usual place. -- The volume of a pi

Re: [Nbd] OCFS2 cluster, HA and nbd-server

2012-03-01 Thread Wouter Verhelst
On Thu, Mar 01, 2012 at 10:35:38AM +0100, Daniel Schwager wrote: > Hi, > > we would like to setup a OCFS2 (Oracle Cluster File System 2) > cluster with 2 nodes, using a SAN as a shared storage. > Each of the nodes has access to the cluster filesystem. > > Now the question: Can we setup the run

Re: [Nbd] Design concept for async/multithreaded nbd-server

2012-03-05 Thread Wouter Verhelst
On Sat, Mar 03, 2012 at 12:46:47AM +0100, Goswin von Brederlow wrote: > Hi, > > I kind of want to just gather my thoughts on this and maybe use you as a > sounding board. Hopefully this might also come in handy if you rewrite > the nbd-server with threads. > > The story so far: > > The Linux ker

Re: [Nbd] NBD kernel module, client and server with support for TRIM

2012-03-15 Thread Wouter Verhelst
On Wed, Mar 14, 2012 at 04:15:47PM -0700, katon goukakyuuno wrote: > Hi all, > > I am working on Linux kernel 3.0 (vanilla) and have 2.9.23 version of the > nbd-client and nbd-server installed. Looking at the kernel sources, I find > that > NBD_CMD_TRIM is not supported in this version of the ke

Re: [Nbd] NBD kernel module, client and server with support for TRIM

2012-03-16 Thread Wouter Verhelst
On Fri, Mar 16, 2012 at 10:42:03AM -0700, katon goukakyuuno wrote: > Hi Wouter, > > Thank you very much for replying! I have patched my kernel to support only > TRIM. I hope I need not apply the patch for FLUSH/FUA as well to just use > TRIM? > I hope all patches are added to the latest Linux ker

Re: [Nbd] nbd-client can't connect to named export from initramfs

2012-03-19 Thread Wouter Verhelst
On Sat, Mar 17, 2012 at 09:45:39PM +0100, Wim Muskee wrote: > I'm experiencing an odd nbd-client problem, I can't connect to a named > export from inside an initramfs. > > On the server runs nbd-server (3.0) as a service, the > /etc/nbd-server/config is as follows: > [generic] > [ltsp] > exportnam

Re: [Nbd] nbd-client can't connect to named export from initramfs

2012-03-20 Thread Wouter Verhelst
On Mon, Mar 19, 2012 at 05:56:13PM +0100, Wim Muskee wrote: > On Mon, Mar 19, 2012 at 12:06 PM, Wouter Verhelst wrote: > > On Sat, Mar 17, 2012 at 09:45:39PM +0100, Wim Muskee wrote: > >> I'm experiencing an odd nbd-client problem, I can't connect to a named > >

Re: [Nbd] 3TB disk ... Exported device is too big for me. Get 64-bit machine

2012-04-25 Thread Wouter Verhelst
On Wed, Apr 11, 2012 at 12:58:59PM -0300, Salatiel Filho wrote: > I am trying to connect to a 3TB nbd exported disk from a MIPS machine > in to a debian ARM machine. > When i try to connect i get 'Exported device is too big for me. Get > 64-bit machine'. > Is there a way to make this connection wor

Re: [Nbd] local mounted readonly and exported read write

2012-04-25 Thread Wouter Verhelst
On Tue, Apr 10, 2012 at 11:18:05AM -0300, Salatiel Filho wrote: > Hi guys , i have a doubt. > If i have a device , let's say /dev/sdb2 which is mounted locally read > only, and this same device is exported using nbd , and mounted > readwrite by the client. If the client writes to the Filesystem , t

Re: [Nbd] distributed, fault-tolerant network block device

2012-04-25 Thread Wouter Verhelst
On Sat, Mar 31, 2012 at 10:43:02PM +0200, Corin Langosch wrote: > Hi, > > I'm looking for a distributed, fault-tolerant network storage system which > exposes block devices (not filesystems) on the clients. Matching my > requirements I only found ceph's rdb, but it's still very experimental as far

Re: [Nbd] nbd-client - Problem with disconnect

2012-05-02 Thread Wouter Verhelst
Hi Jean, On Wed, May 02, 2012 at 04:36:58PM +0200, Jean Wolter wrote: > Hello, > > I played around with nbd and stumbled across a problem when > disconnecting an nbd block device via nbd-client -d . The > nbd-client expects a return value of EBADR after a disconnect: > > if (ioctl(nbd, NBD_D

[Nbd] "list exports" implemented, request for review

2012-05-05 Thread Wouter Verhelst
Hi list, I've just implemented a "list exports" command for nbd-client, which allows clients to list available exports on a server. Usage: wouter@carillon:~/code/c/nbd$ cat /tmp/tmp.04gPZ0eJFQ/nbd.conf [generic] allowlist = true [export1] exportname = /tmp/tmp.04gPZ0eJFQ/nbd.dd

Re: [Nbd] client-server via non TCP socket

2012-05-06 Thread Wouter Verhelst
On Sun, May 06, 2012 at 01:17:43AM -0400, Paul Clements wrote: > On Sat, May 5, 2012 at 8:04 AM, Goswin von Brederlow > wrote: > > > You will have to patch the nbd-client to initiate the ssh connection to > > start the server instead of using socat or use some LD_PRELOAD lib that > > changes soc

[Nbd] 3.1 released

2012-05-15 Thread Wouter Verhelst
Hi folks, So, since there wasn't much response on my request for review, I've assumed that I did everything right... we'll see. I've just released NBD 3.1 "alexander" for your downloading pleasure; it's available at the usual places. Regards, -- The volume of a pizza of thickness a and radius

Re: [Nbd] 3.1 released

2012-05-19 Thread Wouter Verhelst
On Tue, May 15, 2012 at 10:20:10AM +0200, Wouter Verhelst wrote: > Hi folks, > > So, since there wasn't much response on my request for review, I've > assumed that I did everything right... we'll see. Okay, so that didn't turn out to be the case: diff --git a/n

Re: [Nbd] [PATCH] compat: Define AI_NUMERICSERV as `0' if necessary

2012-05-20 Thread Wouter Verhelst
On Sun, May 20, 2012 at 09:27:57AM -, Michael Witten wrote: > Date: Sat, 19 May 2012 11:00:00 - > > AI_NUMERICSERV as a value for the `ai_flags' member > of `struct addrinfo' of header has only > been available since: > > POSIX 1003.1-2008, Issue 7 > glibc 2.3.4 > Mac OS X 10.6 >

Re: [Nbd] 3.1 released

2012-05-25 Thread Wouter Verhelst
On Tue, May 22, 2012 at 09:40:08PM +0200, Peter Simons wrote: > Hi Wouter, > > > diff --git a/nbd-client.c b/nbd-client.c > > index 4338bf5..0e62821 100644 > > --- a/nbd-client.c > > +++ b/nbd-client.c > > [...] > > > > I didn't notice, since on my system that needed_flags variable just >

Re: [Nbd] [PATCH] nbd-client: do not leave child processes in the zombie state

2012-06-21 Thread Wouter Verhelst
On Sat, Jun 16, 2012 at 03:43:23AM +0400, Dmitry V. Levin wrote: > Change SIGCHLD handler to SIG_DFL with SA_NOCLDWAIT flag set, to avoid > transforming child processes into zombies when they terminate. Since > the main process is inevitably blocked in NBD_DO_IT ioctl at the time > when child proc

Re: [Nbd] [PATCH] nbd-client: adjust the oom-killer score in swap mode

2012-06-23 Thread Wouter Verhelst
On Fri, Jun 22, 2012 at 12:59:22AM +0400, Dmitry V. Levin wrote: > In swap mode, it is highly desirable to take all available measures that > could help nbd-client survival in low memory conditions. One of such > measures is to disable oom killing of nbd-client by adjusting the > oom-killer score.

Re: [Nbd] [PATCH 05/11] nbd-server: treat accept errors as non-fatal

2012-06-23 Thread Wouter Verhelst
On Fri, Jun 22, 2012 at 01:40:48AM +0400, Dmitry V. Levin wrote: > In most cases, an error returned by accept system call is a network > error, which should not terminate the whole nbd-server. Yes, that's a leftover from the days when nbd-server ran in one-process-per-export mode (i.e., the 2.7 da

Re: [Nbd] [PATCH 07/11] nbd-server: do not lose connections

2012-06-23 Thread Wouter Verhelst
On Fri, Jun 22, 2012 at 01:42:19AM +0400, Dmitry V. Levin wrote: > When select reports that more than one connection is ready to be > accepted, handle them all instead of losing all of them but one. Mm. I might be mistaken, but I was under the impression that if you do it that way, select() will j

Re: [Nbd] [PATCH 11/11] nbd-server: fix signal handling

2012-06-23 Thread Wouter Verhelst
On Fri, Jun 22, 2012 at 01:46:04AM +0400, Dmitry V. Levin wrote: > Reset SIGCHLD and SIGTERM handlers to SIG_DFL in child processes because > it is not their business to handle these signals. Block SIGCHLD and > SIGTERM for the short time of fork, changing signal handlers and > changing "children"

Re: [Nbd] [PATCH] nbd-server: add -D/-dont-daemonize option

2012-06-27 Thread Wouter Verhelst
On Mon, Jun 25, 2012 at 03:22:06PM +0400, Dmitry V. Levin wrote: > On Mon, Jun 25, 2012 at 11:59:44AM +0200, Goswin von Brederlow wrote: > > What I would like to see is socket activation in nbd-server. That way > > the service can be started as needed without performance loss (other > > than the in

Re: [Nbd] [PATCH] nbd-server: add setproctitle support

2012-06-27 Thread Wouter Verhelst
On Mon, Jun 25, 2012 at 03:08:06AM +0400, Dmitry V. Levin wrote: > +#if USE_SETPROCTITLE > +# ifdef HAVE_SETPROCTITLE_H > +# include > +# endif > +#endif This means is only included if we have it, and the user asked us to compile it in. > /** Default position of the config file */ > #ifndef

Re: [Nbd] [RFC PATCH] nbd-server: set supplementary groups by default when changing UID/GID

2012-06-27 Thread Wouter Verhelst
On Mon, Jun 25, 2012 at 03:32:55AM +0400, Dmitry V. Levin wrote: > Before this change, there was no way to clear or change supplementary > groups at all, which is usually required to be done along with changing > UID and GID. This change introduces a new global config boolean option > "setgroups"

Re: [Nbd] [PATCH 05/11] nbd-server: treat accept errors as non-fatal

2012-07-03 Thread Wouter Verhelst
On Mon, Jun 25, 2012 at 02:47:20AM +0400, Dmitry V. Levin wrote: > On Sun, Jun 24, 2012 at 01:31:28AM +0200, Wouter Verhelst wrote: > > On Fri, Jun 22, 2012 at 01:40:48AM +0400, Dmitry V. Levin wrote: > > > In most cases, an error returned by accept system call is a network

Re: [Nbd] [RFC PATCH] nbd-server: set supplementary groups by default when changing UID/GID

2012-07-03 Thread Wouter Verhelst
On Thu, Jun 28, 2012 at 04:19:17AM +0400, Dmitry V. Levin wrote: > On Thu, Jun 28, 2012 at 01:15:52AM +0200, Wouter Verhelst wrote: > > On Mon, Jun 25, 2012 at 03:32:55AM +0400, Dmitry V. Levin wrote: > > > Before this change, there was no way to clear or change supplementary &

Re: [Nbd] [PATCH] nbd-server: add setproctitle support

2012-07-03 Thread Wouter Verhelst
On Thu, Jun 28, 2012 at 03:42:56AM +0400, Dmitry V. Levin wrote: > On Thu, Jun 28, 2012 at 01:08:30AM +0200, Wouter Verhelst wrote: > > On Mon, Jun 25, 2012 at 03:08:06AM +0400, Dmitry V. Levin wrote: > > > +#if USE_SETPROCTITLE > > > +# ifdef HAVE_SETPROCTITLE_H > &

[Nbd] 3.2 released

2012-07-03 Thread Wouter Verhelst
Hi folks, I just released nbd-3.2, on the usual place. It consists mostly of Dmitry's patches, plus a few of my own. Go find it in the usual place. -- The volume of a pizza of thickness a and radius z can be described by the following formula: pi zz a -

Re: [Nbd] [RFC PATCH] nbd-server: set supplementary groups by default when changing UID/GID

2012-07-03 Thread Wouter Verhelst
On Wed, Jul 04, 2012 at 02:32:11AM +0400, Dmitry V. Levin wrote: > Unfortunately, in situations where nbd-server processes are running with a > privileged group id and a full set of supplementary groups, these > processes usually would have write access to many more files than one > would like to a

Re: [Nbd] 3.2 released

2012-07-06 Thread Wouter Verhelst
On Wed, Jul 04, 2012 at 05:53:27PM +0400, Dmitry V. Levin wrote: > On Tue, Jul 03, 2012 at 04:24:22PM -0600, Wouter Verhelst wrote: > > Hi folks, > > > > I just released nbd-3.2, on the usual place. It consists mostly of > > Dmitry's patches, plus a few of my own.

Re: [Nbd] nbd & discard/trim

2012-08-09 Thread Wouter Verhelst
On Thu, Aug 09, 2012 at 12:57:53PM +0200, folkert wrote: > Hi, > > What is the current way to enable discard/trim on an nbd block device? > My nbd server sends the appropriate flags: > int flags = 1 + 4 + 8 + 32; // FLAGS, FLUSH, FUA, TRIM > nbd-client package is of version: 1:3.2-1 > connec

Re: [Nbd] nbd & discard/trim

2012-08-28 Thread Wouter Verhelst
Hi Paul, On Thu, Aug 23, 2012 at 09:57:13AM -0400, Paul Clements wrote: > OK, attached are the two patches that I have queued. The first adds > the SET_FLAGS ioctl. The second adds the TRIM/DISCARD support. Once > people have had a chance to review and (ideally) test the patches I'll > push to mai

Re: [Nbd] nbd & discard/trim

2012-08-28 Thread Wouter Verhelst
On Tue, Aug 28, 2012 at 03:06:02PM +0200, Wouter Verhelst wrote: > Hi Paul, > > On Thu, Aug 23, 2012 at 09:57:13AM -0400, Paul Clements wrote: > > OK, attached are the two patches that I have queued. The first adds > > the SET_FLAGS ioctl. The second adds the TRIM/DISCARD sup

Re: [Nbd] nbd not working with xinetd anymore

2012-09-10 Thread Wouter Verhelst
Hi, Sorry, looks like I forgot to reply to this one: On Fri, Aug 17, 2012 at 11:49:46AM +0530, Jigish Gohil wrote: > Hi > > Newer NBD does not work when using xinetd, last one that works is > 2.9.20, tested 3.1 and 3.2, haven't tested anything between 2.9.20 and > 3.1 so not sure when exactly it

Re: [Nbd] ubuntu 12.04.1 can't mount /dev/nbd

2012-10-20 Thread Wouter Verhelst
On Fri, Oct 19, 2012 at 04:16:45PM +, 念红志 wrote: > hi,all! > my server is ubuntu 12.04.1,kernel version is 3.2.0-32-generic. nbd module is > loading, but i can’t mount an nbd device to a directory. > > > root@lxc:~# mount /dev/nbd15 /tmp > mount: you must specify the filesystem type Is th

Re: [Nbd] multiple exports

2012-11-11 Thread Wouter Verhelst
On Sat, Nov 10, 2012 at 12:02:24AM -0500, Chas M Carr wrote: > Trying to set up multiple exports for a nbd-server in order to share 2 > versions of a linux distro to pxe clients. I can successfully set up > one in the config file for nbd-server but if I add the second one in it > won't work. >

Re: [Nbd] multiple exports

2012-11-11 Thread Wouter Verhelst
On Sun, Nov 11, 2012 at 10:47:03PM -0500, Chas Carr wrote: > Yes I am trying to do the same thing as what is listed in the post. If I set > up > two named exports without using ports only one is exported, if I try using > ports for two items to be exported then only one port shows up. Please post

Re: [Nbd] nbd-server: about adding new exports dynamically

2012-12-23 Thread Wouter Verhelst
On Sun, Dec 23, 2012 at 03:30:36PM -0500, Michael Richardson wrote: > > "nen" == nen writes: > nen> We are using NBD server in a LTSP-environment to serve terminal > nen> images. However, we'd like to add new images/exports dynamically, but > nen> currently NBD server does not sup

Re: [Nbd] nbd-server: about adding new exports dynamically

2012-12-23 Thread Wouter Verhelst
On Sat, Dec 22, 2012 at 09:34:21PM +0200, Tuomas Jorma Juhani Räsänen wrote: > Hi > > We are using NBD server in a LTSP-environment to serve terminal > images. However, we'd like to add new images/exports dynamically, but > currently NBD server does not support it without full restart and > breaki

Re: [Nbd] [PATCH] nbd-server: fix server socket initialization

2012-12-27 Thread Wouter Verhelst
Thanks, all three are applied. On Fri, Dec 28, 2012 at 12:22:41AM +0200, =?UTF-8?q?Tuomas=20Jorma=20Juhani=20R=C3=A4s=C3=A4nen?= wrote: > Change the value for undefined descriptor from 0 to -1 because any value > greater or equal to 0 can be a valid file descriptor. > > Signed-off-by: Tuomas Jor

Re: [Nbd] About error management

2012-12-29 Thread Wouter Verhelst
You really know how to dig up the worst warts in nbd, don't you? ;-) On Fri, Dec 28, 2012 at 04:34:51PM +0200, Tuomas Jorma Juhani Räsänen wrote: > Hi > > Now that I've started to work on generalizing the dynamic > reconfiguration hack, I bumped into the quite complex or at least > unnecessarily

Re: [Nbd] [PATCH] nbd-server: remove unused function serve_err()

2012-12-29 Thread Wouter Verhelst
On Fri, Dec 28, 2012 at 03:23:17PM +0200, Tuomas Jorma Juhani Räsänen wrote: > Error reporting and handling should be streamlined. Currently there are > quite many different ways errors are being logged, reported and handled. > > This shall be the first baby step towards more uniform error managem

Re: [Nbd] [PATCH] nbd-server: replace msg2(), msg3() and msg4() with variadic msg()

2012-12-29 Thread Wouter Verhelst
On Fri, Dec 28, 2012 at 11:33:00PM +0200, Tuomas Jorma Juhani Räsänen wrote: > > Signed-off-by: Tuomas Jorma Juhani Räsänen > --- > nbd-server.c | 64 > ++ > 1 file changed, 33 insertions(+), 31 deletions(-) > > diff --git a/nbd-server.

Re: [Nbd] [PATCH] nbd-server: replace msg2(), msg3() and msg4() with variadic msg()

2012-12-29 Thread Wouter Verhelst
On Sat, Dec 29, 2012 at 10:21:57PM +0200, Tuomas Jorma Juhani Räsänen wrote: > On Sat, Dec 29, 2012 at 12:52:36PM +0100, Wouter Verhelst wrote: > > > > I've applied this too, but after I did so and pushed it I started > > thinking that, because it really only calls

Re: [Nbd] [PATCH] nbd-server: replace msg2(), msg3() and msg4() with variadic msg()

2012-12-30 Thread Wouter Verhelst
On Sun, Dec 30, 2012 at 10:19:07PM +0200, Tuomas Jorma Juhani Räsänen wrote: > On Sun, Dec 30, 2012 at 03:16:15AM +0100, Wouter Verhelst wrote: > > On Sat, Dec 29, 2012 at 10:21:57PM +0200, Tuomas Jorma Juhani Räsänen wrote: > > > > > > True. I considered variadic mac

Re: [Nbd] [PATCH 1/2] nbd-server: remove unused CFILE_PROGERR error code

2012-12-31 Thread Wouter Verhelst
On Sun, Dec 30, 2012 at 11:13:56PM +0200, Tuomas Jorma Juhani Räsänen wrote: > Programmer errors should not be mixed with runtime errors. If there's a > prorammer error, then there's nothing we can do about it during runtime, > and the program should fail as early and loud as possible. Yes, those

Re: [Nbd] [PATCH 2/2] nbd-server: remove unused CFILE_ -error codes

2012-12-31 Thread Wouter Verhelst
On Sun, Dec 30, 2012 at 11:14:36PM +0200, Tuomas Jorma Juhani Räsänen wrote: > Signed-off-by: Tuomas Jorma Juhani Räsänen > --- > nbd-server.c |3 --- > 1 file changed, 3 deletions(-) > > diff --git a/nbd-server.c b/nbd-server.c > index 217a07a..7cfbe01 100644 > --- a/nbd-server.c > +++ b/nb

Re: [Nbd] [PATCH 2/2] nbd-server: remove unused CFILE_ -error codes

2012-12-31 Thread Wouter Verhelst
On Mon, Dec 31, 2012 at 07:29:16PM +0200, Tuomas Jorma Juhani Räsänen wrote: > On Mon, Dec 31, 2012 at 10:01:31AM +0100, Wouter Verhelst wrote: > > NAK, sorry. The fact that these aren't used doesn't mean we need to > > remove them, it means we may need to add checks -- u

Re: [Nbd] [PATCH] nbd-server: fix dosockopts() to report errors

2013-01-01 Thread Wouter Verhelst
Thanks, all three are applied. -- Copyshops should do vouchers. So that next time some bureaucracy requires you to mail a form in triplicate, you can mail it just once, add a voucher, and save on postage. -- Master Java

Re: [Nbd] [PATCH 2/4] nbd-server: fix parse_cfile() to not modify any global variables

2013-01-03 Thread Wouter Verhelst
Hi Tuomas, On Thu, Jan 03, 2013 at 11:20:53PM +0200, Tuomas Jorma Juhani Räsänen wrote: > This change allows parse_cfile() to be called without any side-effects > and passes the decision of what to do with parsed results to the > caller. Right, that's the big one :-) [...] > - if(i==1 && hav

Re: [Nbd] [PATCH 3/4] nbd-server: remove global variables: runuser and rungroup

2013-01-03 Thread Wouter Verhelst
On Thu, Jan 03, 2013 at 11:21:05PM +0200, Tuomas Jorma Juhani Räsänen wrote: > User and group names are needed only at the very beginning of the > process, there is no need to keep them hanging in the global scope. > > Signed-off-by: Tuomas Jorma Juhani Räsänen > --- > nbd-server.c | 26 ++

Re: [Nbd] [PATCH 4/4] nbd-server: remove global variables: modern_listen and modernport

2013-01-03 Thread Wouter Verhelst
On Thu, Jan 03, 2013 at 11:21:16PM +0200, Tuomas Jorma Juhani Räsänen wrote: > Address and port of the modern socket are read from the main > configuration file and used only when opening the socket. There is no > need to keep them hanging in the global scope. > > Signed-off-by: Tuomas Jorma Juhan

Re: [Nbd] [PATCH 4/4] nbd-server: remove global variables: modern_listen and modernport

2013-01-04 Thread Wouter Verhelst
On Fri, Jan 04, 2013 at 03:10:09PM +0200, Tuomas Jorma Juhani Räsänen wrote: > On Fri, Jan 04, 2013 at 02:40:59AM +0100, Wouter Verhelst wrote: > > On Thu, Jan 03, 2013 at 11:21:16PM +0200, Tuomas Jorma Juhani Räsänen wrote: > > > Address and port of the modern socket are

Re: [Nbd] [PATCH 4/4] nbd-server: remove global variables: modern_listen and modernport

2013-01-04 Thread Wouter Verhelst
On Fri, Jan 04, 2013 at 10:41:57PM +0200, Tuomas Jorma Juhani Räsänen wrote: > So, when writing this (or the other) patch, I didn't want to think too > much how the username or the groupname could be exploited in future. I > just tried to create a patch which would be correct on its own without > a

Re: [Nbd] [PATCH] nbd-server: fix parse_cfile() to not modify any global variables

2013-01-04 Thread Wouter Verhelst
Thanks, I've applied all four, but applied one on top that removes the g_free() calls again. I've thought about it a bit more, and consider that to be the better approach. The commit message includes some more explanations, including some that weren't in the thread here. On Fri, Jan 04, 2013 at 1

Re: [Nbd] [PATCH] nbd-server: fix parse_cfile() to not modify any global variables

2013-01-05 Thread Wouter Verhelst
On Sat, Jan 05, 2013 at 11:39:26AM +0200, Tuomas Jorma Juhani Räsänen wrote: > On Sat, Jan 05, 2013 at 02:12:34AM +0100, Wouter Verhelst wrote: > > Thanks, I've applied all four, but applied one on top that removes the > > g_free() calls again. I've thought about it

Re: [Nbd] [PATCH 2/5] nbd-server: fix open_modern() to report errors

2013-01-12 Thread Wouter Verhelst
On Fri, Jan 11, 2013 at 11:54:02PM +0200, Tuomas Jorma Juhani Räsänen wrote: > This commit is part of the refactoring work on internal error > management. The goal of the work is to separate error reporting from > error handling to make it possible to call functions from different code > paths with

Re: [Nbd] [PATCH 3/5] nbd-server: fix setup_serve() to report errors

2013-01-12 Thread Wouter Verhelst
On Fri, Jan 11, 2013 at 11:54:21PM +0200, Tuomas Jorma Juhani Räsänen wrote: > This commit changes setup_serve() to report its errors via GError object > to its caller. It also add resource deallocation code to return points > to free all local resources correctly. Note that, the previous version >

Re: [Nbd] [PATCH 5/5] nbd-server: use one error domain for all NBD server errors

2013-01-12 Thread Wouter Verhelst
On Fri, Jan 11, 2013 at 11:55:06PM +0200, Tuomas Jorma Juhani Räsänen wrote: > The purpose of the commit is to move all error identifiers to one > namespace common for all errors originating from NBD server. Using > multiple internal error domains would add only bureaucracy without any > real gain.

Re: [Nbd] [PATCH 1/5] nbd-server: remove unused function

2013-01-12 Thread Wouter Verhelst
thanks, applied. On Fri, Jan 11, 2013 at 11:53:47PM +0200, Tuomas Jorma Juhani Räsänen wrote: > Something like this might be needed in the future, once dynamic > reconfiguration has landed. But it's better to rewrite and test it then > and not keep unreferenced code hanging around cluttering the c

Re: [Nbd] [PATCH 4/5] nbd-server: remove commented code

2013-01-12 Thread Wouter Verhelst
Yes, indeed, doesn't make much sense that way. Applied, thanks. On Fri, Jan 11, 2013 at 11:54:50PM +0200, Tuomas Jorma Juhani Räsänen wrote: > Signed-off-by: Tuomas Jorma Juhani Räsänen > --- > nbd-server.c | 10 -- > 1 file changed, 10 deletions(-) > > diff --git a/nbd-server.c b/nbd

Re: [Nbd] [PATCH 1/3] nbd-server: fix open_modern() to report errors

2013-01-19 Thread Wouter Verhelst
Hi Tuomas, Sorry 'bout the delay; I didn't have much time last week, and then forgot. I've applied all three, thanks. On Sat, Jan 12, 2013 at 11:23:55PM +0200, Tuomas Räsänen wrote: > This commit is part of the refactoring work on internal error > management. The goal of the work is to separate

Re: [Nbd] nbd protocol specification?

2013-01-21 Thread Wouter Verhelst
On Mon, Jan 14, 2013 at 01:41:34PM +0100, Andreas Klauer wrote: > Hi, > > I need to implement a block device in user space with my own idea > of read and write (like a selective copy-on-write layer). The thing > would be machine-local, network is not important. > > I'm currently using FUSE + loo

Re: [Nbd] nbd protocol specification?

2013-01-24 Thread Wouter Verhelst
On Mon, Jan 21, 2013 at 04:25:32PM +0100, Goswin von Brederlow wrote: > On Mon, Jan 21, 2013 at 09:08:15AM +0100, Wouter Verhelst wrote: > > On Mon, Jan 14, 2013 at 01:41:34PM +0100, Andreas Klauer wrote: > > > Hi, > > > > > > I need to implement a block d

Re: [Nbd] [PATCH] nbd-server: handle port number string conversion errors

2013-01-26 Thread Wouter Verhelst
Thanks, applied (earlier today, actually, but I forgot to confirm here :-) On Thu, Jan 24, 2013 at 10:43:22PM +0200, Tuomas Räsänen wrote: > g_strdup_printf() tries to allocate a string large enough to hold the > string representation of the passed value and coverts the value to > string. It retur

Re: [Nbd] NBD with uClibc 0.9.33.2 - compile problem

2013-02-04 Thread Wouter Verhelst
On Sun, Feb 03, 2013 at 04:17:50PM +0100, VAGO Tibor wrote: > Hi, > > I tried to compile nbd 3.2 on my NAS, an ARMv5T based system. I install > gentoo-uclibc on it and when I try to compile nbd it cannot find > fallocate() function: > > --

Re: [Nbd] NBD server terminates on SIGPIPE during negotiation

2013-02-05 Thread Wouter Verhelst
Hi, Sorry for the late reply. Last weekend[1] was fairly busy for me... On Mon, Jan 28, 2013 at 08:57:46AM +, Tuomas Räsänen wrote: > Hi > > Problem: The listener/root server process terminates on SIGPIPE during > negotiation. Crap. > This is hardly the desired behavior, since any malfunct

Re: [Nbd] NBD server terminates on SIGPIPE during negotiation

2013-02-06 Thread Wouter Verhelst
On Wed, Feb 06, 2013 at 08:40:14AM +, Alex Bligh wrote: > Wouter, > > On 5 Feb 2013, at 21:37, Wouter Verhelst wrote: > > >> #1 Set the default action of SIGPIPE to Ign. > >> > >> This is simplest to do, but not the right thing in my opinion. > &

Re: [Nbd] NBD server terminates on SIGPIPE during negotiation

2013-02-07 Thread Wouter Verhelst
On Thu, Feb 07, 2013 at 02:03:22PM +, Alex Bligh wrote: > > On 6 Feb 2013, at 21:38, Wouter Verhelst wrote: > > > This situation is of course different if the server is not using a > > fork-per-client paradigm; but since that's what we're doing, I fail to

Re: [Nbd] [PATCH 1/3] nbd: support FLUSH requests

2013-02-12 Thread Wouter Verhelst
On Tue, Feb 12, 2013 at 07:22:26PM +0100, Nicolas Trangez wrote: > On Tue, 2013-02-12 at 19:06 +0100, Paolo Bonzini wrote: > > Il 12/02/2013 18:37, Alex Bligh ha scritto: > > > For my education, why remove the FUA stuff? > > > > Because I had no way to test it. > > > > >>> > > Hmmm... the underly

Re: [Nbd] [PATCH 0/3] NBD fixes for caching and block device flags

2013-02-13 Thread Wouter Verhelst
On Tue, Feb 12, 2013 at 01:43:49PM -0800, Andrew Morton wrote: > On Tue, 12 Feb 2013 17:06:08 +0100 > Paolo Bonzini wrote: > > > The first two patches improve the behavior of NBD with respect to the host > > cache---respectively the server's cache and the client's. The first adds > > support for

[Nbd] [PATCH] Update documentation for nbd, and link to mailinglist

2013-02-13 Thread Wouter Verhelst
documentation for the non-kernel bits should live. Additionally, add a reference to the MAINTAINERS file for the nbd-general mailinglist that is used for discussion of the userland tools and the kernel module already. Cc: Cc: Paul Clements Cc: Andrew Morton Signed-off-by: Wouter Verhelst

Re: [Nbd] nbd-client current tip does not compile...

2013-02-14 Thread Wouter Verhelst
On Wed, Feb 13, 2013 at 10:00:08PM +0100, Michal Belczyk wrote: > Hi, > > it looks like this commit > > https://github.com/yoe/nbd/commit/c50a67520e6fb473eac298c89b8a408a380cfbb4 > > broke the current tip. > > Please consider applying the following change: > > diff --git a/nbd-client.c b/nbd

[Nbd] release?

2013-03-06 Thread Wouter Verhelst
Hi folks, Looking over the log since 3.2, there's a fair amount of stuff there. I think it's about time I made a new release. Thoughts? -- Copyshops should do vouchers. So that next time some bureaucracy requires you to mail a form in triplicate, you can mail it just once, add a voucher, and sa

Re: [Nbd] BUG: debug output uses signed integer for length field

2013-03-06 Thread Wouter Verhelst
On Tue, Mar 05, 2013 at 10:19:39AM +0100, folkert wrote: > Replaced %d by %u. applied. > diff -uNrBbd nbd-3.2.org/nbd-server.c nbd-3.2/nbd-server.c > --- nbd-3.2.org/nbd-server.c 2012-07-03 22:54:53.0 +0200 > +++ nbd-3.2/nbd-server.c 2013-03-05 10:04:41.0 +0100 > @@ -1736,9 +

Re: [Nbd] BUG: oversized 64b offset wrap not detected when offset + len > 64bit and thus wraps

2013-03-06 Thread Wouter Verhelst
On Tue, Mar 05, 2013 at 10:23:31AM +0100, folkert wrote: > if: > offset = 64bit - 2KB > len = 4KB > then the server will allow the read/write because the check > if (((ssize_t)((off_t)request.from + len) > client->exportsize)) > will never trigger as client->exportsize will be com

Re: [Nbd] BUG: read-command with data size 0 does not return a response header

2013-03-06 Thread Wouter Verhelst
On Mon, Mar 04, 2013 at 04:29:23PM +0100, folkert wrote: > Hi, > > NBD-server v3.2 has a problem: if a client does a read-request of 0 > bytes in length, then the nbd-server does not return a response header. > This is not in line with a write request which always returns a response > header. > Th

Re: [Nbd] NBD protocol implementation verification tool

2013-03-06 Thread Wouter Verhelst
On Tue, Mar 05, 2013 at 09:48:11PM +0100, folkert wrote: > > > A while ago I implemented a data-deduplicating program which > > > communicates with the outside world using NBD. To verify if it > > > implements the NBD protocol corrrect and does the data handling > > > correctly I wrote nbd-verify.

Re: [Nbd] NBD protocol implementation verification tool

2013-03-06 Thread Wouter Verhelst
On Wed, Mar 06, 2013 at 02:31:55PM +0100, folkert wrote: > On Wed, Mar 06, 2013 at 01:06:23PM +0100, Wouter Verhelst wrote: > > > > > "NBD-verify aims to be a verification tool to check if your NBD server > > > > > implementation handles the

Re: [Nbd] release?

2013-03-06 Thread Wouter Verhelst
On Wed, Mar 06, 2013 at 08:20:23PM +0100, folkert wrote: > > Looking over the log since 3.2, there's a fair amount of stuff there. I > > think it's about time I made a new release. > > Thoughts? > > Please verify if offsets > 4GB on devices > 4GB on 32 bit servers work > correctly. The cast to ssi

Re: [Nbd] Yet another NBD server out there

2013-03-10 Thread Wouter Verhelst
On Sat, Mar 09, 2013 at 11:36:22PM +0100, Michal Belczyk wrote: > On Sat, Mar 09, 2013 at 02:17:19PM +0100, folkert wrote: > > > http://code.belo.io/bnbd/ > > > > Some comments: it fails silently. You need to dig in syslog to find out > > it could not write its PID-file. Imho that should be show

Re: [Nbd] [PATCH 1/1] server: remove non-reachable call to err()

2013-03-10 Thread Wouter Verhelst
On Sun, Mar 10, 2013 at 10:42:06PM +0200, Tuomas Räsänen wrote: > Currently, all places where append_serve() is called from, ensure that > the server argument is never NULL. > > Furthermore, > > - exiting on error inside a "util" function is bad practice, it makes it > almost impossible to use

Re: [Nbd] [PATCH 1/1] server: remove non-reachable call to err()

2013-03-10 Thread Wouter Verhelst
On Sun, Mar 10, 2013 at 11:38:10PM +0200, Tuomas Räsänen wrote: > On Sun, Mar 10, 2013 at 10:15:07PM +0100, Wouter Verhelst wrote: > > > > Mmm. Checking for programmer error isn't necessarily a bad idea, though. > > Yes, it's best done at compile time,

Re: [Nbd] [PATCH 1/1] server: remove non-reachable call to err()

2013-03-11 Thread Wouter Verhelst
On Mon, Mar 11, 2013 at 12:54:04PM +0200, Tuomas Räsänen wrote: > On Mon, Mar 11, 2013 at 12:28:45AM +0100, Wouter Verhelst wrote: > > On Sun, Mar 10, 2013 at 11:38:10PM +0200, Tuomas Räsänen wrote: > > > > > > Very well, assert() might be a good idea and I even thoug

Re: [Nbd] Yet another NBD server out there

2013-03-11 Thread Wouter Verhelst
On Sun, Mar 10, 2013 at 10:20:46PM +0100, Michal Belczyk wrote: > On Sun, Mar 10, 2013 at 04:02:30PM +0100, Wouter Verhelst wrote: > > On Sat, Mar 09, 2013 at 11:36:22PM +0100, Michal Belczyk wrote: > > > On Sat, Mar 09, 2013 at 02:17:19PM +0100, folkert wrote: > > > >

Re: [Nbd] Yet another NBD server out there

2013-03-11 Thread Wouter Verhelst
On Mon, Mar 11, 2013 at 12:42:23PM +, Alex Bligh wrote: > > On 11 Mar 2013, at 12:18, Wouter Verhelst wrote: > > > Every time someone reimplements nbd-server, I die a little inside. > > I think separating out the negotiation stuff, and possibly the > packet proces

  1   2   3   4   5   6   7   8   9   >