From 6b368ccbd40dfd6929233c7edfe127faa7f99bed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arkadiusz=20Buba=C5=82a?= Date: Fri, 8 Sep 2017 13:46:58 +0200 Subject: [PATCH] Fix false config_cache_write events. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. Signed-off-by: Arkadiusz BubaƂa --- module/zfs/spa_config.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/module/zfs/spa_config.c b/module/zfs/spa_config.c index 7e712d368776..8459e7362813 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); }