]> git.proxmox.com Git - mirror_zfs.git/commitdiff
Replace /*PRINTFLIKEn*/ with attribute(printf)
authorнаб <nabijaczleweli@nabijaczleweli.xyz>
Sat, 5 Jun 2021 11:14:12 +0000 (13:14 +0200)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Mon, 26 Jul 2021 19:07:15 +0000 (12:07 -0700)
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Issue #12201

19 files changed:
cmd/zpool/zpool_util.h
cmd/zpool/zpool_vdev.c
include/libuutil.h
include/libuutil_impl.h
include/os/freebsd/spl/sys/ccompile.h
include/os/freebsd/spl/sys/cmn_err.h
include/os/linux/spl/sys/cmn_err.h
include/sys/spa.h
include/sys/vdev.h
lib/libuutil/uu_pname.c
lib/libzfs/libzfs_util.c
lib/libzpool/kernel.c
lib/libzutil/zutil_import.c
module/os/linux/zfs/vdev_disk.c
module/zfs/arc.c
module/zfs/spa_log_spacemap.c
module/zfs/spa_misc.c
module/zfs/vdev.c
module/zfs/vdev_raidz_math.c

index 71db4dc35608d14e17685a7c0429f080b906f81c..60e8ea873b23de948e0948522e246bca581f4cfe 100644 (file)
@@ -128,7 +128,7 @@ void free_vdev_cmd_data_list(vdev_cmd_data_list_t *vcdl);
 int check_device(const char *path, boolean_t force,
     boolean_t isspare, boolean_t iswholedisk);
 boolean_t check_sector_size_database(char *path, int *sector_size);
-void vdev_error(const char *fmt, ...);
+void vdev_error(const char *fmt, ...) __attribute__((format(printf, 1, 2)));
 int check_file(const char *file, boolean_t force, boolean_t isspare);
 void after_zpool_upgrade(zpool_handle_t *zhp);
 
index 3d83da641ecb63e8250fc3bf24a3bc95a1125c58..57d41e5eaaf3aae79ca05b83cef0e779b08f40b3 100644 (file)
@@ -86,7 +86,6 @@
 boolean_t error_seen;
 boolean_t is_force;
 
-/*PRINTFLIKE1*/
 void
 vdev_error(const char *fmt, ...)
 {
@@ -704,8 +703,11 @@ get_replication(nvlist_t *nvroot, boolean_t fatal)
                                                    "are present\n"),
                                                    raidz->zprl_type,
                                                    mirror->zprl_type,
+                                                   (u_longlong_t)
                                                    raidz->zprl_parity,
+                                                   (u_longlong_t)
                                                    mirror->zprl_children - 1,
+                                                   (u_longlong_t)
                                                    mirror->zprl_children);
                                        else
                                                return (NULL);
@@ -728,7 +730,9 @@ get_replication(nvlist_t *nvroot, boolean_t fatal)
                                                    "%llu are present\n"),
                                                    lastrep.zprl_type,
                                                    rep.zprl_type,
+                                                   (u_longlong_t)
                                                    lastrep.zprl_parity,
+                                                   (u_longlong_t)
                                                    rep.zprl_parity);
                                        else
                                                return (NULL);
@@ -755,8 +759,9 @@ get_replication(nvlist_t *nvroot, boolean_t fatal)
                                            "mismatched replication level: "
                                            "both %llu and %llu device parity "
                                            "%s vdevs are present\n"),
+                                           (u_longlong_t)
                                            lastrep.zprl_parity,
-                                           rep.zprl_parity,
+                                           (u_longlong_t)rep.zprl_parity,
                                            rep.zprl_type);
                                else
                                        return (NULL);
@@ -769,7 +774,9 @@ get_replication(nvlist_t *nvroot, boolean_t fatal)
                                            "mismatched replication level: "
                                            "both %llu-way and %llu-way %s "
                                            "vdevs are present\n"),
+                                           (u_longlong_t)
                                            lastrep.zprl_children,
+                                           (u_longlong_t)
                                            rep.zprl_children,
                                            rep.zprl_type);
                                else
@@ -854,9 +861,9 @@ check_replication(nvlist_t *config, nvlist_t *newroot)
                                    "and %s vdevs, %llu vs. %llu (%llu-way)\n"),
                                    raidz->zprl_type,
                                    mirror->zprl_type,
-                                   raidz->zprl_parity,
-                                   mirror->zprl_children - 1,
-                                   mirror->zprl_children);
+                                   (u_longlong_t)raidz->zprl_parity,
+                                   (u_longlong_t)mirror->zprl_children - 1,
+                                   (u_longlong_t)mirror->zprl_children);
                                ret = -1;
                        }
                } else if (strcmp(current->zprl_type, new->zprl_type) != 0) {
@@ -869,14 +876,17 @@ check_replication(nvlist_t *config, nvlist_t *newroot)
                        vdev_error(gettext(
                            "mismatched replication level: pool uses %llu "
                            "device parity and new vdev uses %llu\n"),
-                           current->zprl_parity, new->zprl_parity);
+                           (u_longlong_t)current->zprl_parity,
+                           (u_longlong_t)new->zprl_parity);
                        ret = -1;
                } else if (current->zprl_children != new->zprl_children) {
                        vdev_error(gettext(
                            "mismatched replication level: pool uses %llu-way "
                            "%s and new vdev uses %llu-way %s\n"),
-                           current->zprl_children, current->zprl_type,
-                           new->zprl_children, new->zprl_type);
+                           (u_longlong_t)current->zprl_children,
+                           current->zprl_type,
+                           (u_longlong_t)new->zprl_children,
+                           new->zprl_type);
                        ret = -1;
                }
        }
index 1d179945cca111a33bc48aa2c6113e4565ce7ecd..cadc20d2d8f3d9194f4dbbccd2836dea1571850f 100644 (file)
@@ -81,15 +81,18 @@ const char *uu_strerror(uint32_t);
 extern void uu_alt_exit(int);
 extern const char *uu_setpname(char *);
 extern const char *uu_getpname(void);
-/*PRINTFLIKE1*/
-extern void uu_warn(const char *, ...);
-extern void uu_vwarn(const char *, va_list);
-/*PRINTFLIKE1*/
-extern void uu_die(const char *, ...) __NORETURN;
-extern void uu_vdie(const char *, va_list) __NORETURN;
-/*PRINTFLIKE2*/
-extern void uu_xdie(int, const char *, ...) __NORETURN;
-extern void uu_vxdie(int, const char *, va_list) __NORETURN;
+extern void uu_warn(const char *, ...)
+    __attribute__((format(printf, 1, 2)));
+extern void uu_vwarn(const char *, va_list)
+    __attribute__((format(printf, 1, 0)));
+extern void uu_die(const char *, ...)
+    __attribute__((format(printf, 1, 2))) __NORETURN;
+extern void uu_vdie(const char *, va_list)
+    __attribute__((format(printf, 1, 0))) __NORETURN;
+extern void uu_xdie(int, const char *, ...)
+    __attribute__((format(printf, 2, 3))) __NORETURN;
+extern void uu_vxdie(int, const char *, va_list)
+    __attribute__((format(printf, 2, 0))) __NORETURN;
 
 /*
  * Exit status functions (not to be used directly)
@@ -111,8 +114,8 @@ int uu_check_name(const char *, uint_t);
  */
 #define        UU_NELEM(a)     (sizeof (a) / sizeof ((a)[0]))
 
-/*PRINTFLIKE1*/
-extern char *uu_msprintf(const char *format, ...);
+extern char *uu_msprintf(const char *format, ...)
+    __attribute__((format(printf, 1, 2)));
 extern void *uu_zalloc(size_t);
 extern char *uu_strdup(const char *);
 extern void uu_free(void *);
index 50d8e012d5f29180172a9c0e3ab7e3f134cc467f..753bbff2461d56bb26049e52760211c5d34e00a1 100644 (file)
@@ -42,8 +42,7 @@ extern "C" {
 void uu_set_error(uint_t);
 
 
-/*PRINTFLIKE1*/
-void uu_panic(const char *format, ...);
+void uu_panic(const char *format, ...) __attribute__((format(printf, 1, 2)));
 
 
 /*
index 7109d42ffbb6670d32533e2a8a0cdab08944ca3c..9970443103bf8266f7362dffc978064e1dceb87d 100644 (file)
 extern "C" {
 #endif
 
-/*
- * Allow for version tests for compiler bugs and features.
- */
-#if defined(__GNUC__)
-#define        __GNUC_VERSION  \
-       (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__)
-#else
-#define        __GNUC_VERSION  0
-#endif
-
-#if defined(__ATTRIBUTE_IMPLEMENTED) || defined(__GNUC__)
-
-#if 0
-/*
- * analogous to lint's PRINTFLIKEn
- */
-#define        __sun_attr___PRINTFLIKE__(__n)  \
-               __attribute__((__format__(printf, __n, (__n)+1)))
-#define        __sun_attr___VPRINTFLIKE__(__n) \
-               __attribute__((__format__(printf, __n, 0)))
-
-#define        __sun_attr___KPRINTFLIKE__      __sun_attr___PRINTFLIKE__
-#define        __sun_attr___KVPRINTFLIKE__     __sun_attr___VPRINTFLIKE__
-#else
-/*
- * Currently the openzfs codebase has a lot of formatting errors
- * which are not picked up in the linux build because they're not
- * doing formatting checks. LLVM's kprintf implementation doesn't
- * actually do format checks!
- *
- * For FreeBSD these break under gcc! LLVM shim'ed cmn_err as a
- * format attribute but also didn't check anything.  If one
- * replaces it with the above, all of the format issues
- * in the codebase show up.
- *
- * Once those format string issues are addressed, the above
- * should be flipped on once again.
- */
-#define        __sun_attr___PRINTFLIKE__(__n)
-#define        __sun_attr___VPRINTFLIKE__(__n)
-#define        __sun_attr___KPRINTFLIKE__(__n)
-#define        __sun_attr___KVPRINTFLIKE__(__n)
-
-#endif
-
-/*
- * This one's pretty obvious -- the function never returns
- */
-#define        __sun_attr___noreturn__ __attribute__((__noreturn__))
-
-/*
- * This is an appropriate label for functions that do not
- * modify their arguments, e.g. strlen()
- */
-#define        __sun_attr___pure__     __attribute__((__pure__))
-
-/*
- * This is a stronger form of __pure__. Can be used for functions
- * that do not modify their arguments and don't depend on global
- * memory.
- */
-#define        __sun_attr___const__    __attribute__((__const__))
-
-/*
- * structure packing like #pragma pack(1)
- */
-#define        __sun_attr___packed__   __attribute__((__packed__))
-
-#define        ___sun_attr_inner(__a)  __sun_attr_##__a
-#define        __sun_attr__(__a)       ___sun_attr_inner __a
-
-#else  /* __ATTRIBUTE_IMPLEMENTED || __GNUC__ */
-
-#define        __sun_attr__(__a)
-
-#endif /* __ATTRIBUTE_IMPLEMENTED || __GNUC__ */
-
-/*
- * Shorthand versions for readability
- */
-
-#define        __PRINTFLIKE(__n)       __sun_attr__((__PRINTFLIKE__(__n)))
-#define        __VPRINTFLIKE(__n)      __sun_attr__((__VPRINTFLIKE__(__n)))
-#define        __KPRINTFLIKE(__n)      __sun_attr__((__KPRINTFLIKE__(__n)))
-#define        __KVPRINTFLIKE(__n)     __sun_attr__((__KVPRINTFLIKE__(__n)))
 #if    defined(_KERNEL) || defined(_STANDALONE)
 #define        __NORETURN              __sun_attr__((__noreturn__))
 #endif /* _KERNEL || _STANDALONE */
index ba4cff37d5f3041b6a05822af255d3e6063a12ad..bf41ecdb286db57ef84fa283832c624cdd955a87 100644 (file)
@@ -49,36 +49,29 @@ extern "C" {
 
 #ifndef _ASM
 
-/*PRINTFLIKE2*/
 extern void cmn_err(int, const char *, ...)
-    __KPRINTFLIKE(2);
+    __attribute__((format(printf, 2, 3)));
 
 extern void vzcmn_err(zoneid_t, int, const char *, __va_list)
-    __KVPRINTFLIKE(3);
+    __attribute__((format(printf, 3, 0)));
 
 extern void vcmn_err(int, const char *, __va_list)
-    __KVPRINTFLIKE(2);
+    __attribute__((format(printf, 2, 0)));
 
-/*PRINTFLIKE3*/
 extern void zcmn_err(zoneid_t, int, const char *, ...)
-    __KPRINTFLIKE(3);
+    __attribute__((format(printf, 3, 4)));
 
 extern void vzprintf(zoneid_t, const char *, __va_list)
-    __KVPRINTFLIKE(2);
+    __attribute__((format(printf, 2, 0)));
 
-/*PRINTFLIKE2*/
 extern void zprintf(zoneid_t, const char *, ...)
-    __KPRINTFLIKE(2);
+    __attribute__((format(printf, 2, 3)));
 
 extern void vuprintf(const char *, __va_list)
-    __KVPRINTFLIKE(1);
+    __attribute__((format(printf, 1, 0)));
 
-/*PRINTFLIKE1*/
 extern void panic(const char *, ...)
-    __KPRINTFLIKE(1) __NORETURN;
-
-extern void vpanic(const char *, __va_list)
-    __KVPRINTFLIKE(1) __NORETURN;
+    __attribute__((format(printf, 1, 2))) __NORETURN;
 
 #endif /* !_ASM */
 
index 314bbbaf9e95f3801a492c8e6e15136b6b6da817..79297067c17d2c998b39f1499e9010ae50ca7ab7 100644 (file)
 #define        CE_PANIC        3 /* panic */
 #define        CE_IGNORE       4 /* print nothing */
 
-extern void cmn_err(int, const char *, ...);
-extern void vcmn_err(int, const char *, va_list);
-extern void vpanic(const char *, va_list);
+extern void cmn_err(int, const char *, ...)
+    __attribute__((format(printf, 2, 3)));
+extern void vcmn_err(int, const char *, va_list)
+    __attribute__((format(printf, 2, 0)));
+extern void vpanic(const char *, va_list)
+    __attribute__((format(printf, 1, 0)));
 
 #define        fm_panic        panic
 
index 08eba250d3a339e76ba7f1ad6d326a6c5a442846..05b31004b3a88dcb09a9048582633f59a3273aaa 100644 (file)
@@ -1056,8 +1056,10 @@ extern uint64_t spa_dirty_data(spa_t *spa);
 extern spa_autotrim_t spa_get_autotrim(spa_t *spa);
 
 /* Miscellaneous support routines */
-extern void spa_load_failed(spa_t *spa, const char *fmt, ...);
-extern void spa_load_note(spa_t *spa, const char *fmt, ...);
+extern void spa_load_failed(spa_t *spa, const char *fmt, ...)
+    __attribute__((format(printf, 2, 3)));
+extern void spa_load_note(spa_t *spa, const char *fmt, ...)
+    __attribute__((format(printf, 2, 3)));
 extern void spa_activate_mos_feature(spa_t *spa, const char *feature,
     dmu_tx_t *tx);
 extern void spa_deactivate_mos_feature(spa_t *spa, const char *feature);
index f235bfc8cc1974c597b832c48ef01c26064bb2ba..0a81713a44d020bae537b53970dacc533a4e79b2 100644 (file)
@@ -52,7 +52,8 @@ extern int zfs_nocacheflush;
 
 typedef boolean_t vdev_open_children_func_t(vdev_t *vd);
 
-extern void vdev_dbgmsg(vdev_t *vd, const char *fmt, ...);
+extern void vdev_dbgmsg(vdev_t *vd, const char *fmt, ...)
+    __attribute__((format(printf, 2, 3)));
 extern void vdev_dbgmsg_print_tree(vdev_t *, int);
 extern int vdev_open(vdev_t *);
 extern void vdev_open_children(vdev_t *);
index a6a0f22661e5bc22db4cb8cc11564e4ad99e7170..28c4a8a9cf7b8c232f99d69844acdb876517b894 100644 (file)
@@ -38,9 +38,6 @@
 #include <wchar.h>
 #include <unistd.h>
 
-static const char PNAME_FMT[] = "%s: ";
-static const char ERRNO_FMT[] = ": %s\n";
-
 static const char *pname;
 
 static void
@@ -85,16 +82,16 @@ uu_alt_exit(int profile)
        }
 }
 
-static void
+static __attribute__((format(printf, 2, 0))) void
 uu_warn_internal(int err, const char *format, va_list alist)
 {
        if (pname != NULL)
-               (void) fprintf(stderr, PNAME_FMT, pname);
+               (void) fprintf(stderr, "%s: ", pname);
 
        (void) vfprintf(stderr, format, alist);
 
        if (strrchr(format, '\n') == NULL)
-               (void) fprintf(stderr, ERRNO_FMT, strerror(err));
+               (void) fprintf(stderr, ": %s\n", strerror(err));
 }
 
 void
@@ -103,7 +100,6 @@ uu_vwarn(const char *format, va_list alist)
        uu_warn_internal(errno, format, alist);
 }
 
-/*PRINTFLIKE1*/
 void
 uu_warn(const char *format, ...)
 {
@@ -113,7 +109,7 @@ uu_warn(const char *format, ...)
        va_end(alist);
 }
 
-static void
+static __attribute__((format(printf, 2, 0))) __NORETURN void
 uu_die_internal(int status, const char *format, va_list alist)
 {
        uu_warn_internal(errno, format, alist);
@@ -137,7 +133,6 @@ uu_vdie(const char *format, va_list alist)
        uu_die_internal(UU_EXIT_FATAL, format, alist);
 }
 
-/*PRINTFLIKE1*/
 void
 uu_die(const char *format, ...)
 {
@@ -153,7 +148,6 @@ uu_vxdie(int status, const char *format, va_list alist)
        uu_die_internal(status, format, alist);
 }
 
-/*PRINTFLIKE2*/
 void
 uu_xdie(int status, const char *format, ...)
 {
index 68e97e4830d816f97d777adbdb4ecc1ec2dec2f3..88d6561a5fb4b1d4206b452a71e78df69828c228 100644 (file)
@@ -304,7 +304,6 @@ libzfs_error_description(libzfs_handle_t *hdl)
        }
 }
 
-/*PRINTFLIKE2*/
 void
 zfs_error_aux(libzfs_handle_t *hdl, const char *fmt, ...)
 {
@@ -352,7 +351,6 @@ zfs_error(libzfs_handle_t *hdl, int error, const char *msg)
        return (zfs_error_fmt(hdl, error, "%s", msg));
 }
 
-/*PRINTFLIKE3*/
 int
 zfs_error_fmt(libzfs_handle_t *hdl, int error, const char *fmt, ...)
 {
@@ -403,7 +401,6 @@ zfs_standard_error(libzfs_handle_t *hdl, int error, const char *msg)
        return (zfs_standard_error_fmt(hdl, error, "%s", msg));
 }
 
-/*PRINTFLIKE3*/
 int
 zfs_standard_error_fmt(libzfs_handle_t *hdl, int error, const char *fmt, ...)
 {
@@ -613,7 +610,6 @@ zpool_standard_error(libzfs_handle_t *hdl, int error, const char *msg)
        return (zpool_standard_error_fmt(hdl, error, "%s", msg));
 }
 
-/*PRINTFLIKE3*/
 int
 zpool_standard_error_fmt(libzfs_handle_t *hdl, int error, const char *fmt, ...)
 {
@@ -771,7 +767,6 @@ zfs_alloc(libzfs_handle_t *hdl, size_t size)
 /*
  * A safe form of asprintf() which will die if the allocation fails.
  */
-/*PRINTFLIKE2*/
 char *
 zfs_asprintf(libzfs_handle_t *hdl, const char *fmt, ...)
 {
index 25f58f156bf9ce58f1877c045d4cc83b472df51e..ef75706fa6e33a11ac7061a9cc2b22c553e4d17f 100644 (file)
@@ -634,7 +634,6 @@ vcmn_err(int ce, const char *fmt, va_list adx)
        }
 }
 
-/*PRINTFLIKE2*/
 void
 cmn_err(int ce, const char *fmt, ...)
 {
index b5b2d7dbed91b8d1ea5d8286b3653c8911397e69..277698aa0ebec4cc83ed8159482c7a759429e606 100644 (file)
@@ -69,8 +69,7 @@
 
 #include "zutil_import.h"
 
-/*PRINTFLIKE2*/
-static void
+static __attribute__((format(printf, 2, 3))) void
 zutil_error_aux(libpc_handle_t *hdl, const char *fmt, ...)
 {
        va_list ap;
@@ -104,8 +103,7 @@ zutil_verror(libpc_handle_t *hdl, const char *error, const char *fmt,
        }
 }
 
-/*PRINTFLIKE3*/
-static int
+static __attribute__((format(printf, 3, 4))) int
 zutil_error_fmt(libpc_handle_t *hdl, const char *error, const char *fmt, ...)
 {
        va_list ap;
@@ -1237,7 +1235,7 @@ zpool_find_import_scan_dir(libpc_handle_t *hdl, pthread_mutex_t *lock,
                if (error == ENOENT)
                        return (0);
 
-               zutil_error_aux(hdl, strerror(error));
+               zutil_error_aux(hdl, "%s", strerror(error));
                (void) zutil_error_fmt(hdl, EZFS_BADPATH, dgettext(
                    TEXT_DOMAIN, "cannot resolve path '%s'"), dir);
                return (error);
@@ -1246,7 +1244,7 @@ zpool_find_import_scan_dir(libpc_handle_t *hdl, pthread_mutex_t *lock,
        dirp = opendir(path);
        if (dirp == NULL) {
                error = errno;
-               zutil_error_aux(hdl, strerror(error));
+               zutil_error_aux(hdl, "%s", strerror(error));
                (void) zutil_error_fmt(hdl, EZFS_BADPATH,
                    dgettext(TEXT_DOMAIN, "cannot open '%s'"), path);
                return (error);
@@ -1308,7 +1306,7 @@ zpool_find_import_scan_path(libpc_handle_t *hdl, pthread_mutex_t *lock,
                        goto out;
                }
 
-               zutil_error_aux(hdl, strerror(error));
+               zutil_error_aux(hdl, "%s", strerror(error));
                (void) zutil_error_fmt(hdl, EZFS_BADPATH, dgettext(
                    TEXT_DOMAIN, "cannot resolve path '%s'"), dir);
                goto out;
@@ -1346,7 +1344,7 @@ zpool_find_import_scan(libpc_handle_t *hdl, pthread_mutex_t *lock,
                        if (error == ENOENT)
                                continue;
 
-                       zutil_error_aux(hdl, strerror(error));
+                       zutil_error_aux(hdl, "%s", strerror(error));
                        (void) zutil_error_fmt(hdl, EZFS_BADPATH, dgettext(
                            TEXT_DOMAIN, "cannot resolve path '%s'"), dir[i]);
                        goto error;
index c56fd3a6ff21d9be564b1feb5dac4af03d80a7da..59d062ebe2a656c7f105af642da10ae0289ea423 100644 (file)
@@ -546,7 +546,9 @@ __vdev_disk_physio(struct block_device *bdev, zio_t *zio,
        if (io_offset + io_size > bdev->bd_inode->i_size) {
                vdev_dbgmsg(zio->io_vd,
                    "Illegal access %llu size %llu, device size %llu",
-                   io_offset, io_size, i_size_read(bdev->bd_inode));
+                   (u_longlong_t)io_offset,
+                   (u_longlong_t)io_size,
+                   (u_longlong_t)i_size_read(bdev->bd_inode));
                return (SET_ERROR(EIO));
        }
 
index 02663e8e2e5dab962b584fb1d9ef7537d982afbc..75b1dcc82b5aac5a2008c08cc88aa83c80f379a3 100644 (file)
@@ -7470,7 +7470,7 @@ arc_state_multilist_index_func(multilist_t *ml, void *obj)
        if ((do_warn) && (tuning) && ((tuning) != (value))) {   \
                cmn_err(CE_WARN,                                \
                    "ignoring tunable %s (using %llu instead)", \
-                   (#tuning), (value));                        \
+                   (#tuning), (u_longlong_t)(value));  \
        }                                                       \
 } while (0)
 
index f4c2910ad7fe47bc742c1c316d5cde2011b99292..6fd302b8df34e07aef23dfa3d11f11d81b7f3586 100644 (file)
@@ -1033,8 +1033,8 @@ spa_ld_log_sm_metadata(spa_t *spa)
                if (sls == NULL) {
                        spa_load_failed(spa, "spa_ld_log_sm_metadata(): bug "
                            "encountered: could not find log spacemap for "
-                           "TXG %ld [error %d]",
-                           metaslab_unflushed_txg(m), ENOENT);
+                           "TXG %llu [error %d]",
+                           (u_longlong_t)metaslab_unflushed_txg(m), ENOENT);
                        return (ENOENT);
                }
                sls->sls_mscount++;
index ad1c4437c098760959638534ba4b736e04726110..1ecd2294dba0eccf2764a1863197a0a21e0d546a 100644 (file)
@@ -389,7 +389,6 @@ uint64_t spa_max_slop = 128ULL * 1024 * 1024 * 1024;
 int spa_allocators = 4;
 
 
-/*PRINTFLIKE2*/
 void
 spa_load_failed(spa_t *spa, const char *fmt, ...)
 {
@@ -404,7 +403,6 @@ spa_load_failed(spa_t *spa, const char *fmt, ...)
            spa->spa_trust_config ? "trusted" : "untrusted", buf);
 }
 
-/*PRINTFLIKE2*/
 void
 spa_load_note(spa_t *spa, const char *fmt, ...)
 {
index 4e316d8135eeb751aa6d3b436e48f935a293536c..47a475135302b7c426882e9ea41316785dbaab79 100644 (file)
@@ -137,7 +137,6 @@ int zfs_nocacheflush = 0;
 uint64_t zfs_vdev_max_auto_ashift = ASHIFT_MAX;
 uint64_t zfs_vdev_min_auto_ashift = ASHIFT_MIN;
 
-/*PRINTFLIKE2*/
 void
 vdev_dbgmsg(vdev_t *vd, const char *fmt, ...)
 {
@@ -3457,7 +3456,8 @@ vdev_load(vdev_t *vd)
                        vdev_set_state(vd, B_FALSE, VDEV_STATE_CANT_OPEN,
                            VDEV_AUX_CORRUPT_DATA);
                        vdev_dbgmsg(vd, "vdev_load: zap_lookup(top_zap=%llu) "
-                           "failed [error=%d]", vd->vdev_top_zap, error);
+                           "failed [error=%d]",
+                           (u_longlong_t)vd->vdev_top_zap, error);
                        return (error);
                }
        }
index 25d76970e99a81c1359b30771f613f3a176bc75e..138b7dac5956f6911bb7dc0b4cdb4f7737757a6e 100644 (file)
@@ -165,8 +165,8 @@ vdev_raidz_math_generate(raidz_map_t *rm, raidz_row_t *rr)
                        break;
                default:
                        gen_parity = NULL;
-                       cmn_err(CE_PANIC, "invalid RAID-Z configuration %d",
-                           raidz_parity(rm));
+                       cmn_err(CE_PANIC, "invalid RAID-Z configuration %llu",
+                           (u_longlong_t)raidz_parity(rm));
                        break;
        }
 
@@ -257,8 +257,8 @@ vdev_raidz_math_reconstruct(raidz_map_t *rm, raidz_row_t *rr,
                rec_fn = reconstruct_fun_pqr_sel(rm, parity_valid, nbaddata);
                break;
        default:
-               cmn_err(CE_PANIC, "invalid RAID-Z configuration %d",
-                   raidz_parity(rm));
+               cmn_err(CE_PANIC, "invalid RAID-Z configuration %llu",
+                   (u_longlong_t)raidz_parity(rm));
                break;
        }