linux-api.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] uapi: add EROBLK
@ 2024-11-19 15:54 Alexey Dobriyan
  2024-11-19 16:22 ` Christoph Hellwig
  0 siblings, 1 reply; 4+ messages in thread
From: Alexey Dobriyan @ 2024-11-19 15:54 UTC (permalink / raw)
  To: Jens Axboe; +Cc: linux-block, linux-api

Block drivers and DM sometimes use EROFS to report errors. There is
no confusion about what happens but naive error reporting code might
pass -EROFS to strerror(3) which will print "filesystem" when clearly
there is no filesystem anywhere, it is layer above.

Or in other words, if EROFS exists, why not EROBLK?
It is not like there is a tax on errno values.

Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
---

 include/uapi/asm-generic/errno.h |    1 +
 1 file changed, 1 insertion(+)

--- a/include/uapi/asm-generic/errno.h
+++ b/include/uapi/asm-generic/errno.h
@@ -119,5 +119,6 @@
 #define ERFKILL		132	/* Operation not possible due to RF-kill */
 
 #define EHWPOISON	133	/* Memory page has hardware error */
+#define EROBLK		134	/* Block device is read-only */
 
 #endif

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] uapi: add EROBLK
  2024-11-19 15:54 [PATCH] uapi: add EROBLK Alexey Dobriyan
@ 2024-11-19 16:22 ` Christoph Hellwig
  2024-11-19 17:20   ` Alexey Dobriyan
  0 siblings, 1 reply; 4+ messages in thread
From: Christoph Hellwig @ 2024-11-19 16:22 UTC (permalink / raw)
  To: Alexey Dobriyan; +Cc: Jens Axboe, linux-block, linux-api

On Tue, Nov 19, 2024 at 06:54:52PM +0300, Alexey Dobriyan wrote:
> Block drivers and DM sometimes use EROFS to report errors. There is
> no confusion about what happens but naive error reporting code might
> pass -EROFS to strerror(3) which will print "filesystem" when clearly
> there is no filesystem anywhere, it is layer above.
> 
> Or in other words, if EROFS exists, why not EROBLK?
> It is not like there is a tax on errno values.

And where would you return this value without breaking existing
userspace?

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] uapi: add EROBLK
  2024-11-19 16:22 ` Christoph Hellwig
@ 2024-11-19 17:20   ` Alexey Dobriyan
  2024-11-19 17:27     ` Christoph Hellwig
  0 siblings, 1 reply; 4+ messages in thread
From: Alexey Dobriyan @ 2024-11-19 17:20 UTC (permalink / raw)
  To: Christoph Hellwig; +Cc: Jens Axboe, linux-block, linux-api

On Tue, Nov 19, 2024 at 08:22:08AM -0800, Christoph Hellwig wrote:
> On Tue, Nov 19, 2024 at 06:54:52PM +0300, Alexey Dobriyan wrote:
> > Block drivers and DM sometimes use EROFS to report errors. There is
> > no confusion about what happens but naive error reporting code might
> > pass -EROFS to strerror(3) which will print "filesystem" when clearly
> > there is no filesystem anywhere, it is layer above.
> > 
> > Or in other words, if EROFS exists, why not EROBLK?
> > It is not like there is a tax on errno values.
> 
> And where would you return this value without breaking existing
> userspace?

New code may start returning it right away.

Old code may start checking for both and in ~100 years delete EROFS
clause.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] uapi: add EROBLK
  2024-11-19 17:20   ` Alexey Dobriyan
@ 2024-11-19 17:27     ` Christoph Hellwig
  0 siblings, 0 replies; 4+ messages in thread
From: Christoph Hellwig @ 2024-11-19 17:27 UTC (permalink / raw)
  To: Alexey Dobriyan; +Cc: Christoph Hellwig, Jens Axboe, linux-block, linux-api

On Tue, Nov 19, 2024 at 08:20:33PM +0300, Alexey Dobriyan wrote:
> > And where would you return this value without breaking existing
> > userspace?
> 
> New code may start returning it right away.
> 
> Old code may start checking for both and in ~100 years delete EROFS
> clause.

In other word it's all hypothetical, you have no actual users in mind
and no ral problem to solve?

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2024-11-19 17:27 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-11-19 15:54 [PATCH] uapi: add EROBLK Alexey Dobriyan
2024-11-19 16:22 ` Christoph Hellwig
2024-11-19 17:20   ` Alexey Dobriyan
2024-11-19 17:27     ` Christoph Hellwig

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).