Skip to content

Handle 4kn devices? #19

Description

@akiradeveloper

writeboost/dm-writeboost#176

I think this code should be fixed too? But user land may submits 512B by RMW manner that results in submitting 4KB request in kernel. I will set the status to bug when reported.

 if id == 0 { // superblock
        let mut buf = [0;512];
        let mut f = File::open(&devname).unwrap();
        f.read(&mut buf).unwrap();
        let sup_header = lib::SuperBlockHeader::from_buf(&buf);

        let s = if sup_header.magic == 0x57427374 {
            "formatted"
        } else {
            "unformatted"
        };

        println!("[superblock header]");
        println!("magic = {} ({})", sup_header.magic, s);

        f.seek(SeekFrom::Start((1u64 << 20) - 512)).unwrap();
        f.read(&mut buf).unwrap();
        let sup_record = lib::SuperBlockRecord::from_buf(&buf);

        println!("[superblock record]");
        println!("last writeback id = {}", sup_record.last_writeback_segment_id);

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions