From a3c5719561d80f8b9d6e25bd49997da19f31736f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arkadiusz=20Buba=C5=82a?= Date: Mon, 11 Sep 2017 19:25:01 +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. Reviewed-by: George Melikov Reviewed-by: loli10K Reviewed-by: Giuseppe Di Natale Signed-off-by: Arkadiusz BubaƂa Closes #6617 --- module/zfs/spa_config.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/module/zfs/spa_config.c b/module/zfs/spa_config.c index 0ee46c2f28b0..479a81f1282f 100644 --- a/module/zfs/spa_config.c +++ b/module/zfs/spa_config.c @@ -181,10 +181,12 @@ spa_config_write(spa_config_dirent_t *dp, nvlist_t *nvl) * If the nvlist is empty (NULL), then remove the old cachefile. */ if (nvl == NULL) { - err = spa_config_remove(dp); + 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); }