@samitouri / QOSamiQemu / commits / 0cf42d8496

fuse: Ensure init clean-up even with error_fatal

When exports are created on the command line (with the storage daemon), errp is going to point to error_fatal. Without ERRP_GUARD, we would exit immediately when *errp is set, i.e. skip the clean-up code under the `fail` label. Use ERRP_GUARD so we always run that code. As far as I know, this has no actual impact right now[1], but it is still better to make this right. [1] Not cleaning up the mount point is the only thing I can imagine would be problematic, but that is the last thing we attempt, so if it fails, it will clean itself up. Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: Hanna Czenczek <hreitz@redhat.com> Message-ID: <20260309150856.26800-3-hreitz@redhat.com> Reviewed-by: Kevin Wolf <kwolf@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>

Hanna Czenczek committed Mar 9, 2026 at 16:08 UTC 0cf42d849615e7b96b82cae85f1f5d3a39ec3705
1 file changed +1
block/export/fuse.c
+1
@@ -119,6 +119,7 @@ static int fuse_export_create(BlockExport *blk_exp,
119 BlockExportOptions *blk_exp_args,
120 Error **errp)
121 {
122 + ERRP_GUARD(); /* ensure clean-up even with error_fatal */
123 FuseExport *exp = container_of(blk_exp, FuseExport, common);
124 BlockExportOptionsFuse *args = &blk_exp_args->u.fuse;
125 int ret;