On 2021/9/11 0:17, Martin Wilck wrote:
> Hello lixiaokeng,
>
> thanks for your patch.
>
> On Fri, 2021-09-10 at 20:31 +0800, lixiaokeng wrote:
>> There are two paths(sucu as sda and adb) for one LUN. The two
>> paths log in, but before the two uevents have been processed
>> (for example there
Hello lixiaokeng,
thanks for your patch.
On Fri, 2021-09-10 at 20:31 +0800, lixiaokeng wrote:
> There are two paths(sucu as sda and adb) for one LUN. The two
> paths log in, but before the two uevents have been processed
> (for example there are many uevent), users use multipathd add
> path
From: Martin Wilck
Add a small helper.
Signed-off-by: Martin Wilck
---
libmultipath/lock.h | 5 +
1 file changed, 5 insertions(+)
diff --git a/libmultipath/lock.h b/libmultipath/lock.h
index a170efe..d99eedb 100644
--- a/libmultipath/lock.h
+++ b/libmultipath/lock.h
@@ -12,6 +12,11 @@
From: Martin Wilck
This allows us to simplify callers by not having to track the
reply length separately.
Signed-off-by: Martin Wilck
---
multipathd/cli.c | 7 +-
multipathd/cli.h | 6 +-
multipathd/cli_handlers.c | 316 +++---
From: Martin Wilck
EAGAIN is too generic, and doesn't fit semantically either.
ESRCH in't used anywhere else in our code.
Signed-off-by: Martin Wilck
---
multipathd/cli.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/multipathd/cli.c b/multipathd/cli.c
index
From: Martin Wilck
uevents listed on merge_node must be cleaned up, too. uevents
cancelled while being serviced and temporary queues, likewise.
The global uevq must be cleaned out in the uevent listener thread,
because it might have added events after the dispatcher thread
had already finished.
From: Martin Wilck
Since e3270f7 ("multipathd: use weaker "force_reload" at startup"),
(multipath-tools 0.7.0), we only reload those maps that must be
reloaded during startup. "multipath reconfigure", OTOH, reloads
every map, which may take a long time on systems with lots of
storage devices, as
From: Martin Wilck
Since 47cc1d3 ("multipathd: fix client response for socket
activation"), we hold back clients while reconfigure is running.
The idea of 47cc1d3 was to fix the behavior during initial
start up. When multipathd reconfigures itself during runtime,
and the reconfiguration takes a
From: Martin Wilck
Modify set_handler_callback() such that a missing slot is created
if no matching slot is found. This way, we can skip the initialization
with NULL handlers on startup.
Signed-off-by: Martin Wilck
---
multipathd/cli.c | 85 +++-
From: Martin Wilck
Move the actual execution of the handler out of parse_cmd(). For now,
we do it in uxsock_trigger().
Signed-off-by: Martin Wilck
---
multipathd/uxlsnr.c | 47 -
1 file changed, 29 insertions(+), 18 deletions(-)
diff --git
From: Martin Wilck
The list of clients is never changed anywhere except in
uxsock_listen(). No need to lock.
Signed-off-by: Martin Wilck
---
multipathd/uxlsnr.c | 21 ++---
1 file changed, 2 insertions(+), 19 deletions(-)
diff --git a/multipathd/uxlsnr.c b/multipathd/uxlsnr.c
From: Martin Wilck
The server checks for root permissions anyway. "multipathd -k"
should work for ordinary users as long as no priviledged commands
are executed.
Signed-off-by: Martin Wilck
---
multipathd/main.c | 10 +-
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git
From: Martin Wilck
Our ppoll() call needs to wake up when a client request times out.
This logic can be added by determining the first client that's about
to time out. The logic in handle_client() will then cause a timeout
reply to be sent to the client. This is more client-friendly
as the
From: Martin Wilck
send_packet() may busy-loop. By polling for POLLOUT, we can
avoid that, even if it's very unlikely in practice.
Signed-off-by: Martin Wilck
---
multipathd/uxlsnr.c | 39 ---
1 file changed, 32 insertions(+), 7 deletions(-)
diff --git
From: Martin Wilck
When a reconfigure operation is requested, either by the admin
or by some condition multipathd encounters, the current code
attempts to set DAEMON_CONFIGURE state and gives up after a second
if it doesn't succeed. Apart from shutdown, this happens only
if multipathd is either
From: Martin Wilck
No functional changes at this point. handle_client() will become
the state machine for handling client requests.
Signed-off-by: Martin Wilck
---
multipathd/uxlsnr.c | 67 ++---
1 file changed, 32 insertions(+), 35 deletions(-)
diff
From: Martin Wilck
parse_cmd() does more than the name says - it parses, executes
handlers, and even provides reply strings for some cases. This doesn't
work well with the state machine idea. Thus move it to uxlsnr.c,
where later patches will move some functionality elsewhere.
No functional
From: Martin Wilck
As a next step towards the state machine, give the handler functions
access to the state of the client connection.
Signed-off-by: Martin Wilck
---
multipathd/uxlsnr.c | 61 +
1 file changed, 29 insertions(+), 32 deletions(-)
diff
From: Martin Wilck
Add a small utility that will be used in later patches.
Signed-off-by: Martin Wilck
---
libmultipath/libmultipath.version | 5 +
libmultipath/time-util.c | 12
libmultipath/time-util.h | 1 +
3 files changed, 18 insertions(+)
diff --git
From: Martin Wilck
exactly like snprint_config(), but takes a struct strbuf * as argument.
Signed-off-by: Martin Wilck
---
libmultipath/libmultipath.version | 5 +
libmultipath/print.c | 34 +--
libmultipath/print.h | 2 ++
3 files
From: Martin Wilck
Use a typedef instead of spelling out the function type everywhere.
Signed-off-by: Martin Wilck
---
multipathd/cli.c | 6 +++---
multipathd/cli.h | 10 ++
2 files changed, 9 insertions(+), 7 deletions(-)
diff --git a/multipathd/cli.c b/multipathd/cli.c
index
From: Martin Wilck
As a first step towards our state machine, avoid the call to
read_all() via recv_packet_from_client(). handle_client() is now
invoked twice for the same connection. The first time it reads
the command length, and later on it reads the command itself
piece-wise, as sent by the
From: Martin Wilck
Currently the uxlsnr handles each client request (receive requset -
handle request - respond) in a single loop iteration. This has
severe disadvantages. In particular, the code may wait in poll()
called from read_all(), or wait for the vecs lock, while other
clients are ready
From: Martin Wilck
Avoid hardcoding the indices as 0, 1, 2...
Signed-off-by: Martin Wilck
---
multipathd/uxlsnr.c | 25 +++--
1 file changed, 15 insertions(+), 10 deletions(-)
diff --git a/multipathd/uxlsnr.c b/multipathd/uxlsnr.c
index 7e88538..6506109 100644
---
From: Martin Wilck
This patch sets up the bulk of the state machine. The idea is to
fall through the case labels as long as possible (when steps succeed)
and return to the caller if either an error occurs, or it becomes
necessary to wait for some pollable condition.
While doing this, switch to
From: Martin Wilck
Rather than using a separate poor-man's parser for checking root
commands, use the real parser. It will return "LIST" as first verb
for the read-only commands that non-root users may execute.
Signed-off-by: Martin Wilck
---
multipathd/uxlsnr.c | 27
From: Martin Wilck
Return code 2 from ev_remove_map means that a delayed remove has
been started, which is not the same as failure.
Signed-off-by: Martin Wilck
---
multipathd/cli_handlers.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/multipathd/cli_handlers.c
From: Martin Wilck
This function just prints a warning, anyway. If this warning
is printed, the client will see a timeout and print a warning, too.
A later patch will re-introduce this function with real functionality.
Signed-off-by: Martin Wilck
---
multipathd/uxlsnr.c | 21
From: Martin Wilck
The SO_PEERCRED socket option returns "the credentials that were
in effect at the time of the call to connect(2)" (see unix(7)).
So we might as well fetch these credentials at that time.
Signed-off-by: Martin Wilck
---
multipathd/uxlsnr.c | 3 +--
1 file changed, 1
From: Martin Wilck
uxsock_trigger() really belongs into cli.c. I suppose that way back in
the past there were strong reasons to call this function via a
pointer. I don't think these reasons are valid any more. Moving
the function to cli.c allows restructuring the code.
No functional changes.
From: Martin Wilck
The cli_handler functions are only called from the handler table and
need not be exported.
Signed-off-by: Martin Wilck
---
multipathd/cli_handlers.c | 214 ++
multipathd/cli_handlers.h | 61 ++-
multipathd/main.c | 58
From: Martin Wilck
Have struct mutex_lock take an optional wakeup function.
unlock() is renamed to __unlock() in order to prevent it from
being called by mistake.
Signed-off-by: Martin Wilck
---
libmultipath/libmultipath.version | 5 +
libmultipath/lock.c | 12 +++-
From: Martin Wilck
The unix socket listener thread doesn't even look at the revents
returned by poll() while the daemon is configuring. This may cause a
closed client socket to be kept open for a long time by the server,
while the listener basically performs a busy loop, as ppoll() always
From: Martin Wilck
Minor edit: if notifications are off, we set the poll fd to
-1 but still use the POLLIN mask. It looks nicer if to poll
the correct fd, but reset the event mask to 0 if we're not
actually interested in it.
Signed-off-by: Martin Wilck
---
multipathd/uxlsnr.c | 6 +++---
1
From: Martin Wilck
Hello Christophe, hello Ben,
The current multipathd unix listener code has various deficiencies.
- client disconnects aren't handled correctly,
- the uxsock_timeout is applied for receiving, handling, and
responding to the client requests separately, rather than for
From: Martin Wilck
No functional changes. Just make the code a little easier to read.
Signed-off-by: Martin Wilck
---
multipathd/cli.h | 82
1 file changed, 41 insertions(+), 41 deletions(-)
diff --git a/multipathd/cli.h b/multipathd/cli.h
There are two paths(sucu as sda and adb) for one LUN. The two
paths log in, but before the two uevents have been processed
(for example there are many uevent), users use multipathd add
path /dev/sda to cause mpatha and use mpathpersist -o -I to
register prkey for mpatha. The add map uevent is
On Wed, 2021-09-08 at 22:33 +0200, Xose Vazquez Perez wrote:
> Added in 5.11:
> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=e4d2e82b2300b03f66b3ca8417590c86e661fab1
>
> Cc: Mike Christie
> Cc: Martin Wilck
> Cc: Benjamin Marzinski
> Cc: Christophe Varoqui
>
38 matches
Mail list logo