History

block: Add error codes for common PR failures

If a PR operation fails we can return a device-specific error which is impossible to handle in some cases because we could have a mix of devices when DM is used, or future users like LIO only knows it's interacting with a block device so it doesn't know the type. This patch adds a new pr_status enum so drivers can convert errors to a common type which can be handled by the caller.

Mike Christie committed 3 years ago

Commit 255c4f41 parent 9f5436f1 file · +17 −0Browse files

Showing the changes to include/uapi (1 of 1 file). Show all

Unified · Split

include/uapi/linux/pr.h+17−0
@@ -4,6 +4,23 @@ · 3 unmodified lines
4 4
5#include <linux/types.h>5#include <linux/types.h>
6 6
7enum pr_status {
8 PR_STS_SUCCESS = 0x0,
9 /*
10 * The following error codes are based on SCSI, because the interface
11 * was originally created for it and has existing users.
12 */
13 /* Generic device failure. */
14 PR_STS_IOERR = 0x2,
15 PR_STS_RESERVATION_CONFLICT = 0x18,
16 /* Temporary path failure that can be retried. */
17 PR_STS_RETRY_PATH_FAILURE = 0xe0000,
18 /* The request was failed due to a fast failure timer. */
19 PR_STS_PATH_FAST_FAILED = 0xf0000,
20 /* The path cannot be reached and has been marked as failed. */
21 PR_STS_PATH_FAILED = 0x10000,
22};
23
7enum pr_type {24enum pr_type {
8 PR_WRITE_EXCLUSIVE = 1,25 PR_WRITE_EXCLUSIVE = 1,
9 PR_EXCLUSIVE_ACCESS = 2,26 PR_EXCLUSIVE_ACCESS = 2,