Skip to content

Commit

Permalink
virtiofsd: Handle hard reboot
Browse files Browse the repository at this point in the history
Handle a
  mount
  hard reboot (without unmount)
  mount

we get another 'init' which FUSE doesn't normally expect.

Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
  • Loading branch information
dagrh committed Jan 23, 2020
1 parent c806d64 commit e8556f4
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion tools/virtiofsd/fuse_lowlevel.c
Original file line number Diff line number Diff line change
Expand Up @@ -2433,7 +2433,21 @@ void fuse_session_process_buf_int(struct fuse_session *se,
goto reply_err;
}
} else if (in->opcode == FUSE_INIT || in->opcode == CUSE_INIT) {
goto reply_err;
if (fuse_lowlevel_is_virtio(se)) {
/*
* TODO: This is after a hard reboot typically, we need to do
* a destroy, but we can't reply to this request yet so
* we can't use do_destroy
*/
fuse_log(FUSE_LOG_DEBUG, "%s: reinit\n", __func__);
se->got_destroy = 1;
se->got_init = 0;
if (se->op.destroy) {
se->op.destroy(se->userdata);
}
} else {
goto reply_err;
}
}

err = EACCES;
Expand Down

0 comments on commit e8556f4

Please sign in to comment.