| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
Currently, the javascript NBD server only handles files of sizes that
are representable in 32 bits.
Although we can't do full 64-bit offsets with Javascript's number
representation, we should be able to handle up to
Number.MAX_SAFE_INTEGER. This change adds support for using the top-32
bit field in file sizes and read request offsets.
Reported-by: Lei YU <mine260309@gmail.com>
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Change-Id: I41dee58c3913cba49c5cd73ebdd5d6fb56786d25
|
| |
|
|
|
|
|
|
|
|
|
| |
| In function 'open_nbd_socket.isra.2',
| inlined from 'main' at ../git/nbd-proxy.c:835:7:
| ../git/nbd-proxy.c:102:2: error: 'strncpy' specified bound 108 equals destination size [-Werror=stringop-truncation]
| strncpy(addr.sun_path, path, sizeof(addr.sun_path));
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Change-Id: I9f412d789f4e5ef1dffe05b37d903a5375fea8ec
Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Currently, we run the start hook synchronously, and wait() for it to
complete.
This means that the proxy process will be blocked during the execution
of that hook, and no servicing any read/write requests from the nbd
device. If any part of the hook implementation needs to access the
device, it'll block waiting for the device (which is waiting for the
nbd-proxy, which is waiting for the hook).
This change runs the hook (for the "start" action) in the background,
while still servicing requests. This allows hooks to access the device.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
| |
|
|
|
|
|
|
|
|
| |
A future change will run the executable asynchronously. With a directory
of hooks, this gets overly complicated.
Replace the directory-of-hooks concept with a single hook. The hook
itself can then spawn multiple hooks if required (eg, with run-parts).
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Currently, we run the start state-change hook as soon as the nbd session
has been established. However, at that point the nbd device isn't
connected, as we haven't processed any read/write operations on the
block device.
This change defers running the start script until we know that the
device is initialised - when we see a udev change event occur. To do
this, we establish a udev monitor.
Once we see that state change, we run the state change hooks and shut
down the udev monitor.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
| |
|
|
|
|
|
| |
We don't want to report an error if a hook is inacessable (and is the
last hook we check), so clear rc in these conditions.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
| |
|
|
|
|
| |
.. runstatedir is only present in autoconf 2.70+
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
| |
|
|
|
|
|
|
| |
We spawn a couple of subprocesses, and want to make sure we don't leak
file descriptors to those. Rather than closing before exec, set CLOEXEC
on sockets and internal pipes.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
| |
|
|
| |
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
| |
|
|
| |
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
| |
|
|
| |
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
| |
|
|
| |
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
| |
|
|
|
|
|
|
|
|
| |
Add a little configuration facility. We'll later add a method to
integrate this with UI-side configuration, so it's implmented as json.
We add a (temporarily required) argument to specify which configuration
to use.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
| |
|
|
|
|
|
| |
For non-local connections, we need a longer timeout than the kernel
default.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
| |
|
|
| |
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|