Skip to content

block/file: be more defensive about the backing file #1011

@iximeow

Description

@iximeow

in file.rs we'll just open the backing file for whatever permissions the disk should have:

let fp = OpenOptions::new().read(true).write(!read_only).open(p)?;

but we don't get O_EXCL in here anywhere. I'd thought offhandedly that we could take advantage of that for a very weird one-off test configuration (opening a volume from multiple propolises concurrently), but this was appropriately worrying to everyone else with more calibrated fear-o-meter. we should probably open with O_EXCL, which I think we can plumb in with custom_flags()

if Propolis is told to open a file for writing by multiple VMs concurrently that's likely a serious operator error. I'm less opposed to concurrent read-only opens, but caution seems more appropriate here. I've definitely corrupted guests doing this nonsense locally before.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request.storageRelated to storage devices/backends.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions