summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArkadiusz Bubała <[email protected]>2017-09-11 19:25:01 +0200
committerBrian Behlendorf <[email protected]>2017-09-11 10:25:01 -0700
commitd9549cba9640cd3b09d76b8cbd54387728b7be24 (patch)
tree8249a57a3308319348ed06f92fe10ea73bd0d68f
parent835db58592d7d947e5818eb7281882e2a46073e0 (diff)
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 <[email protected]> Reviewed-by: loli10K <[email protected]> Reviewed-by: Giuseppe Di Natale <[email protected]> Signed-off-by: Arkadiusz Bubała <[email protected]> Closes #6617
-rw-r--r--module/zfs/spa_config.c5
1 files changed, 5 insertions, 0 deletions
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);
}