]> git.proxmox.com Git - mirror_zfs.git/commitdiff
Skip rate limiting events in zfs_ereport_post
authorGiuseppe Di Natale <dinatale2@users.noreply.github.com>
Wed, 12 Apr 2017 01:37:45 +0000 (18:37 -0700)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Wed, 12 Apr 2017 01:37:45 +0000 (18:37 -0700)
In zfs_ereport_post, if an event is a rate limiting
event, immediately return before any processing is done.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Giuseppe Di Natale <dinatale2@llnl.gov>
Closes #5998

module/zfs/zfs_fm.c

index 6c0b038bee9a7cdb7c83bc69c80a6a8f8f0b482c..68c0951f62e433cfcc822c5c17e871ded0f63cde 100644 (file)
@@ -778,15 +778,15 @@ zfs_ereport_post(const char *subclass, spa_t *spa, vdev_t *vd, zio_t *zio,
        nvlist_t *ereport = NULL;
        nvlist_t *detector = NULL;
 
+       if (zfs_is_ratelimiting_event(subclass, vd))
+               return;
+
        zfs_ereport_start(&ereport, &detector,
            subclass, spa, vd, zio, stateoroffset, size);
 
        if (ereport == NULL)
                return;
 
-       if (zfs_is_ratelimiting_event(subclass, vd))
-               return;
-
        /* Cleanup is handled by the callback function */
        zfs_zevent_post(ereport, detector, zfs_zevent_post_cb);
 #endif