Skip to content

Commit

Permalink
Fix false config_cache_write events
Browse files Browse the repository at this point in the history
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 openzfs#6617
  • Loading branch information
ab-oe authored and FransUrbo committed Apr 28, 2019
1 parent 77e6c9c commit a3c5719
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions module/zfs/spa_config.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down

0 comments on commit a3c5719

Please sign in to comment.