Update errno messages
David Sterba
maintainercover Update errno messages
We have a errno -> string decoder that's used to print verbose messages, some of the codes that can be found in the wild have been missing in the table.
David Sterba (2):
btrfs: sort error decoder entries
btrfs: add more codes to decoder table
fs/btrfs/super.c | 27 ++++++++++++++++++--------- 1 file changed, 18 insertions(+), 9 deletions(-)
Signature · 1 line
2.25.0
David Sterba
maintainerPATCH 1/2 btrfs: sort error decoder entries
Add the raw errnos and sort them accordingly.
Signed-off-by David Sterba <[email protected]>
--- fs/btrfs/super.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-)
fs/btrfs/super.c +9 -9
@@ -72,23 +72,23 @@ const char * __attribute_const__ btrfs_decode_error(int errno)char *errstr ="unknown" ;switch (errno) { -case -EIO : +case -ENOENT :/* -2 */ + errstr ="No such entry" ; +break ; +case -EIO :/* -5 */ errstr ="IO failure" ;break ; -case -ENOMEM : +case -ENOMEM :/* -12*/ errstr ="Out of memory" ;break ; -case -EROFS : - errstr ="Readonly filesystem" ; -break ; -case -EEXIST : +case -EEXIST :/* -17 */ errstr ="Object already exists" ;break ; -case -ENOSPC : +case -ENOSPC :/* -28 */ errstr ="No space left" ;break ; -case -ENOENT : - errstr ="No such entry" ; +case -EROFS :/* -30 */ + errstr ="Readonly filesystem" ;break ; }
Signature · 1 line
2.25.0
David Sterba
maintainerPATCH 2/2 btrfs: add more codes to decoder table
In reply to David SterbaI've grepped logs for 'errno=.*unknown' and found -95, -117 and -122, now added to the table. The wording is adjusted so it makes sense in context of filesystem.
Signed-off-by David Sterba <[email protected]>
--- fs/btrfs/super.c | 9 +++++++++ 1 file changed, 9 insertions(+)
fs/btrfs/super.c +9 -0
@@ -90,6 +90,15 @@ const char * __attribute_const__ btrfs_decode_error(int errno)case -EROFS :/* -30 */ errstr ="Readonly filesystem" ;break ; +case -EOPNOTSUPP :/* -95 */ + errstr ="Operation not supported" ; +break ; +case -EUCLEAN :/* -117 */ + errstr ="Filesystem corrupted" ; +break ; +case -EDQUOT :/* -122 */ + errstr ="Quota exceeded" ; +break ; }return errstr;
Signature · 1 line
2.25.0
Re: [PATCH 1/2] btrfs: sort error decoder entries
In reply to David SterbaReviewed-by Anand Jain <[email protected]>
Re: [PATCH 2/2] btrfs: add more codes to decoder table
In reply to David SterbaReviewed-by Anand Jain <[email protected]>