diff --git a/module/zfs/spa_config.c b/module/zfs/spa_config.c index 479a81f1282f..0ee46c2f28b0 100644 --- a/module/zfs/spa_config.c +++ b/module/zfs/spa_config.c @@ -181,12 +181,10 @@ 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 = vn_remove(dp->scd_path, UIO_SYSSPACE, RMFILE); - /* - * Don't report an error when the cache file is already removed - */ + err = spa_config_remove(dp); if (err == ENOENT) err = 0; + return (err); }