Message ID | 9184b5e8-7070-4395-b179-4975b2e3fbc3@p183 (mailing list archive) |
---|---|
State | New |
Headers | show |
Series | uapi: add EROBLK | expand |
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?
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.
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?
--- 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
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(+)