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
*/
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);
}