Skip to contentSkip to conversation

Clarify the cases where BLKIF_RSP_EOPNOTSUPP can be returned.

PATCH Superseded Mark Syms 3 participants 6 messages Aug 28, 2025 – Sep 1, 2025

lore
Share & tools
lore

Mark Syms

author
#0 lore raw

PATCH 1/1 Clarify the cases where BLKIF_RSP_EOPNOTSUPP can be returned.

Previously this said it would only happen on barrier writes. Except the documentation blocks for
* feature-flush-cache
* feature-discard

Also say that they can return this error.

---
 xen/include/public/io/blkif.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
xen/include/public/io/blkif.h +1 -1
index 8407453324..5e617b0c67 100644
@@ -710,7 +710,7 @@ typedef struct blkif_response blkif_response_t;
 /*
  * STATUS RETURN CODES.
  */
- /* Operation not supported (only happens on barrier writes). */
+ /* Operation not supported, see feature-barrier, feature-flush-cache, feature-discard. */
 #define BLKIF_RSP_EOPNOTSUPP  -2
  /* Operation failed for some unspecified reason (-EIO). */
 #define BLKIF_RSP_ERROR       -1
Signature · 1 line
2.50.1
#1 lore raw
Quoted 17 lines · Mark Syms

Previously this said it would only happen on barrier writes. Except the documentation blocks for
* feature-flush-cache
* feature-discard

Also say that they can return this error.

---
 xen/include/public/io/blkif.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
xen/include/public/io/blkif.h +0 -0
index 8407453324..5e617b0c67 100644

xen/include/public/io/blkif.h typedef struct blkif_response blkif_response_t; · line 714

Quoted 6 lines
xen/include/public/io/blkif.h +1 -1
@@ -710,7 +710,7 @@ typedef struct blkif_response blkif_response_t;
 /*
  * STATUS RETURN CODES.
  */
- /* Operation not supported (only happens on barrier writes). */
+ /* Operation not supported, see feature-barrier, feature-flush-cache, feature-discard. */
 #define BLKIF_RSP_EOPNOTSUPP  -2

I think there's no need to mention the specific operations. FWIW, blkback will return BLKIF_RSP_EOPNOTSUPP for any request type it doesn't understand (see dispatch_other_io()), which covers any possible request type that's not yet defined:

/* Operation not supported. */
#define BLKIF_RSP_EOPNOTSUPP -2

Should be fine.

Thanks, Roger.

author
#2 lore raw
Quoted 9 lines · Roger Pau Monné

I think there's no need to mention the specific operations. FWIW, blkback will return BLKIF_RSP_EOPNOTSUPP for any request type it doesn't understand (see dispatch_other_io()), which covers any possible request type that's not yet defined:

/* Operation not supported. */
#define BLKIF_RSP_EOPNOTSUPP -2

Should be fine.

OK, I'll reduce that comment to the minimum then, I was just trying to be helpful to future us :)

author
#3 lore raw

PATCH v2 1/1 Clarify the cases where BLKIF_RSP_EOPNOTSUPP can be returned.

In reply to Mark Syms

Previously this said it would only happen on barrier writes. Except the documentation blocks for
* feature-flush-cache
* feature-discard

Also say that they can return this error.

---
v2: simplify to remove references to features as requested.

---
 xen/include/public/io/blkif.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
xen/include/public/io/blkif.h +1 -1
index 8407453324..e96c9af7c6 100644
@@ -710,7 +710,7 @@ typedef struct blkif_response blkif_response_t;
 /*
  * STATUS RETURN CODES.
  */
- /* Operation not supported (only happens on barrier writes). */
+ /* Operation not supported. */
 #define BLKIF_RSP_EOPNOTSUPP  -2
  /* Operation failed for some unspecified reason (-EIO). */
 #define BLKIF_RSP_ERROR       -1
Signature · 1 line
2.50.1
Acked-by on v2 1/1
#4 lore raw
Quoted 4 lines · Mark Syms

Previously this said it would only happen on barrier writes. Except the documentation blocks for
* feature-flush-cache
* feature-discard

I cannot parse what "documentation blocks" means in this context. I would maybe write this as:

"Previously this said it would only happen on barrier writes. However Linux blkback and possibly other backends already return it when the type of the requests is unknown.

Fix the comment to clarify the return code can be used as a reply to any request types not understood by the backend, not just barrier writes."

Quoted 4 lines

Also say that they can return this error.

Possibly with the commit message adjusted:

Thanks, Roger.