Skip to content

Commit 255c4f4

Browse files
mikechristiemartinkpetersen
authored andcommitted
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. Signed-off-by: Mike Christie <[email protected]> Link: https://lore.kernel.org/r/[email protected] Reviewed-by: Christoph Hellwig <[email protected]> Reviewed-by: Chaitanya Kulkarni <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
1 parent 9f5436f commit 255c4f4

File tree

1 file changed

+17
-0
lines changed
  • include/uapi/linux

1 file changed

+17
-0
lines changed

include/uapi/linux/pr.h

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,23 @@
44

55
#include <linux/types.h>
66

7+
enum 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+
724
enum pr_type {
825
PR_WRITE_EXCLUSIVE = 1,
926
PR_EXCLUSIVE_ACCESS = 2,

0 commit comments

Comments
 (0)