svn commit: r357297 - stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys

Alexander Motin mav at FreeBSD.org
Thu Jan 30 16:38:41 UTC 2020


Author: mav
Date: Thu Jan 30 16:38:40 2020
New Revision: 357297
URL: https://svnweb.freebsd.org/changeset/base/357297

Log:
  MFC r356707: Map ECKSUM and EFRAGS from ZFS onto real errnos.
  
  Make it less confusing when, for example, stat sets errno to 122 because a
  checksum failed in ZFS:
  
  Before: getfacl: /foo/bar: stat() failed: Unknown error: 122
  After: getfacl: /foo/bar: stat() failed: Integrity check failed
  
  Submitted by:	Ryan Moeller <ryan at ixsystems.com>

Modified:
  stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio.h
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio.h
==============================================================================
--- stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio.h	Thu Jan 30 16:11:19 2020	(r357296)
+++ stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio.h	Thu Jan 30 16:38:40 2020	(r357297)
@@ -227,12 +227,11 @@ enum zio_wait_type {
 };
 
 /*
- * We'll take the number 122 and 123 to indicate checksum errors and
- * fragmentation. Those doesn't collide with any errno values as they
- * are greater than ELAST.
+ * These are bespoke errnos used in ZFS. We map them to their closest FreeBSD
+ * equivalents. This gives us more useful error messages from strerror(3).
  */
-#define	ECKSUM	122
-#define	EFRAGS	123
+#define	ECKSUM	EINTEGRITY
+#define	EFRAGS	ENOSPC
 
 typedef void zio_done_func_t(zio_t *zio);
 


More information about the svn-src-stable mailing list