From: Arkadiusz Bubała Date: Mon, 11 Sep 2017 17:25:01 +0000 (+0200) Subject: Fix false config_cache_write events X-Git-Tag: zfs-0.8.0-rc1~567 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=d9549cba9640cd3b09d76b8cbd54387728b7be24;p=zfs Fix false config_cache_write events 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 Reviewed-by: loli10K Reviewed-by: Giuseppe Di Natale Signed-off-by: Arkadiusz Bubała Closes #6617 --- diff --git a/module/zfs/spa_config.c b/module/zfs/spa_config.c index 7e712d368..8459e7362 100644 --- a/module/zfs/spa_config.c +++ b/module/zfs/spa_config.c @@ -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); }