]> granicus.if.org Git - zfs/commitdiff
Fix false config_cache_write events
authorArkadiusz Bubała <arkadiusz.bubala@open-e.com>
Mon, 11 Sep 2017 17:25:01 +0000 (19:25 +0200)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Mon, 11 Sep 2017 17:25:01 +0000 (10:25 -0700)
On pool import when the old cache file is removed
the ereport.fs.zfs.config_cache_write event is generated.
Because zpool export always removes cache file it happens
every export - import sequence.

Reviewed-by: George Melikov <mail@gmelikov.ru>
Reviewed-by: loli10K <ezomori.nozomu@gmail.com>
Reviewed-by: Giuseppe Di Natale <dinatale2@llnl.gov>
Signed-off-by: Arkadiusz Bubała <arkadiusz.bubala@open-e.com>
Closes #6617

module/zfs/spa_config.c

index 7e712d368776b773e18c34e5aa81f7420779060a..8459e736281337e21d4b2d21fefdc12f362b0f22 100644 (file)
@@ -162,6 +162,11 @@ spa_config_write(spa_config_dirent_t *dp, nvlist_t *nvl)
         */
        if (nvl == NULL) {
                err = vn_remove(dp->scd_path, UIO_SYSSPACE, RMFILE);
+               /*
+                * Don't report an error when the cache file is already removed
+                */
+               if (err == ENOENT)
+                       err = 0;
                return (err);
        }