diff mbox series

[v2,2/2] btrfs: Add error string for EUCLEAN

Message ID 20190406103759.6330-2-wqu@suse.com (mailing list archive)
State New, archived
Headers show
Series [v2,1/2] block: Add new BLK_STS_SELFTEST status | expand

Commit Message

Qu Wenruo April 6, 2019, 10:37 a.m. UTC
Since we're going to support write time tree checker, it's possible that
transaction get aborted due to tree-checker, also due to new
BLK_STS_UCLEAN bit, we can distinguish real EIO error and EUCLEAN
error.

So adding new string for EUCLEAN to make the "unknown" reason to an easy
to read one.

Signed-off-by: Qu Wenruo <wqu@suse.com>
---
changelog:
v2:
- Use the original error message from EUCLEAN.
---
 fs/btrfs/super.c | 3 +++
 1 file changed, 3 insertions(+)
diff mbox series

Patch

diff --git a/fs/btrfs/super.c b/fs/btrfs/super.c
index 120e4340792a..f69a6696f59d 100644
--- a/fs/btrfs/super.c
+++ b/fs/btrfs/super.c
@@ -86,6 +86,9 @@  const char *btrfs_decode_error(int errno)
 	case -ENOENT:
 		errstr = "No such entry";
 		break;
+	case -EUCLEAN:
+		errstr = "Structure needs cleaning";
+		break;
 	}
 
 	return errstr;