-
Notifications
You must be signed in to change notification settings - Fork 65
Open
Labels
bugSomething isn't workingSomething isn't working
Milestone
Description
When using a block device with FileDeviceBuilder, the capacity defaults to the amount of free space in the parent directory of the device (typically /dev) rather than the capacity of the device itself.
For example, I have a 950GB block device at /dev/nvme3n1:
$ blockdev --getsize64 /dev/nvme3n1
950000000000But because of the logic to query the free space in the parent directory, the capacity defaults to ~3.3MB (the amount of free space in devtmpfs on this host):
let device = FileDeviceBuilder::new("/dev/nvme3n1").build().unwrap();
// Prints "capacity = 3354624"
println!("capacity = {}", device.capacity());For block devices, the default device capacity could be computed instead via the file size (or, on Linux, using the BLKGETSIZE64 ioctl).
rustc 1.89.0
foyer 0.19.2
MrCroxx
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working
Type
Projects
Status
No status