How does recovery work?

5 views
Skip to first unread message

ronnie sahlberg

unread,
Mar 4, 2025, 5:20:32 PMMar 4
to ub...@googlegroups.com
I tried to test some recovery code but struggle on what it is supposed to do.
And also for example, why the special handling for unprivileged devices:

#define ublk_un_privileged_prep_data(dev, data)  \
        char buf[UBLKC_PATH_MAX];                       \
        if (ublk_is_unprivileged(dev)) {                        \
                snprintf(buf, UBLKC_PATH_MAX, "%s%d", UBLKC_DEV, \
                        dev->dev_info.dev_id);                  \
                data.flags |= CTRL_CMD_HAS_BUF | CTRL_CMD_HAS_DATA;     \
                data.len = sizeof(buf); \
                data.dev_path_len = UBLKC_PATH_MAX;     \
                data.addr = (__u64)buf; \
        }


I want to make sure I understand what the recover code does and how to use it.

Can you add some text explaining  recovery, what scenarios it is supposed to cover, how it works and how to use it?
I can later re-work it and add it to the manpage once I understand it.

(An initial test starting a loop device, killing the target with kill -9 and trying ublk recover -n 0 did not work as I expected it would).

regards
ronnie sahlberg

ronnie sahlberg

unread,
Mar 4, 2025, 7:59:55 PMMar 4
to ublk
I sent a pull request where I describe recovery in the manpage.  I am not sure it is 100% correct, so read it carefully.

Ming Lei

unread,
Mar 6, 2025, 2:40:42 AMMar 6
to ronnie sahlberg, ub...@googlegroups.com
The feature is added for addressing some cases in which the ublk
server daemon is crashed,
please see the commit log:

https://lore.kernel.org/linux-block/20220923153919.44...@linux.alibaba.com/




Thanks,
Ming Lei
Reply all
Reply to author
Forward
0 new messages