diff --git a/src/commands/subvolume.rs b/src/commands/subvolume.rs index a5ebcf53..64743115 100644 --- a/src/commands/subvolume.rs +++ b/src/commands/subvolume.rs @@ -42,6 +42,10 @@ pub fn subvolume(argv: Vec) -> i32 { match cli.subcommands { Subcommands::Create { targets } => { for target in targets { + let target = target + .canonicalize() + .expect("unable to canonicalize a target path"); + if let Some(dirname) = target.parent() { let fs = unsafe { BcachefsHandle::open(dirname) }; fs.create_subvolume(target) @@ -50,6 +54,10 @@ pub fn subvolume(argv: Vec) -> i32 { } } Subcommands::Delete { target } => { + let target = target + .canonicalize() + .expect("unable to canonicalize a target path"); + if let Some(dirname) = target.parent() { let fs = unsafe { BcachefsHandle::open(dirname) }; fs.delete_subvolume(target)