Skip to content

Commit 69f407e

Browse files
ps-ushankaraxboe
authored andcommitted
Documentation: ublk: document UBLK_F_USER_RECOVERY_FAIL_IO
Signed-off-by: Uday Shankar <[email protected]> Reviewed-by: Ming Lei <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jens Axboe <[email protected]>
1 parent 59eaa01 commit 69f407e

File tree

1 file changed

+18
-6
lines changed

1 file changed

+18
-6
lines changed

Documentation/block/ublk.rst

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -199,24 +199,36 @@ managing and controlling ublk devices with help of several control commands:
199199

200200
- user recovery feature description
201201

202-
Two new features are added for user recovery: ``UBLK_F_USER_RECOVERY`` and
203-
``UBLK_F_USER_RECOVERY_REISSUE``.
204-
205-
With ``UBLK_F_USER_RECOVERY`` set, after one ubq_daemon(ublk server's io
202+
Three new features are added for user recovery: ``UBLK_F_USER_RECOVERY``,
203+
``UBLK_F_USER_RECOVERY_REISSUE``, and ``UBLK_F_USER_RECOVERY_FAIL_IO``. To
204+
enable recovery of ublk devices after the ublk server exits, the ublk server
205+
should specify the ``UBLK_F_USER_RECOVERY`` flag when creating the device. The
206+
ublk server may additionally specify at most one of
207+
``UBLK_F_USER_RECOVERY_REISSUE`` and ``UBLK_F_USER_RECOVERY_FAIL_IO`` to
208+
modify how I/O is handled while the ublk server is dying/dead (this is called
209+
the ``nosrv`` case in the driver code).
210+
211+
With just ``UBLK_F_USER_RECOVERY`` set, after one ubq_daemon(ublk server's io
206212
handler) is dying, ublk does not delete ``/dev/ublkb*`` during the whole
207213
recovery stage and ublk device ID is kept. It is ublk server's
208214
responsibility to recover the device context by its own knowledge.
209215
Requests which have not been issued to userspace are requeued. Requests
210216
which have been issued to userspace are aborted.
211217

212-
With ``UBLK_F_USER_RECOVERY_REISSUE`` set, after one ubq_daemon(ublk
213-
server's io handler) is dying, contrary to ``UBLK_F_USER_RECOVERY``,
218+
With ``UBLK_F_USER_RECOVERY_REISSUE`` additionally set, after one ubq_daemon
219+
(ublk server's io handler) is dying, contrary to ``UBLK_F_USER_RECOVERY``,
214220
requests which have been issued to userspace are requeued and will be
215221
re-issued to the new process after handling ``UBLK_CMD_END_USER_RECOVERY``.
216222
``UBLK_F_USER_RECOVERY_REISSUE`` is designed for backends who tolerate
217223
double-write since the driver may issue the same I/O request twice. It
218224
might be useful to a read-only FS or a VM backend.
219225

226+
With ``UBLK_F_USER_RECOVERY_FAIL_IO`` additionally set, after the ublk server
227+
exits, requests which have issued to userspace are failed, as are any
228+
subsequently issued requests. Applications continuously issuing I/O against
229+
devices with this flag set will see a stream of I/O errors until a new ublk
230+
server recovers the device.
231+
220232
Unprivileged ublk device is supported by passing ``UBLK_F_UNPRIVILEGED_DEV``.
221233
Once the flag is set, all control commands can be sent by unprivileged
222234
user. Except for command of ``UBLK_CMD_ADD_DEV``, permission check on

0 commit comments

Comments
 (0)