Skip to content

Commit

Permalink
Allow two instances where read result is not-checked
Browse files Browse the repository at this point in the history
There is ongoing work, see:
stratis-storage#476, and the ultimate
plan is to come up w/ better formalization of how errors in reading
metadata are handled.

Signed-off-by: mulhern <[email protected]>
  • Loading branch information
mulkieran committed Sep 15, 2017
1 parent 2f8c7c7 commit 6606dd1
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/engine/strat_engine/metadata.rs
Original file line number Diff line number Diff line change
Expand Up @@ -190,8 +190,11 @@ impl StaticHeader {
fn setup<F>(f: &mut F) -> EngineResult<Option<StaticHeader>>
where F: Read + Seek
{
#![allow(unused_io_amount)]
f.seek(SeekFrom::Start(0))?;
let mut buf = [0u8; _BDA_STATIC_HDR_SIZE];

// FIXME: See https://github.com/stratis-storage/stratisd/pull/476
f.read(&mut buf)?;

// TODO: repair static header if one incorrect?
Expand Down Expand Up @@ -224,10 +227,12 @@ impl StaticHeader {
pub fn determine_ownership<F>(f: &mut F) -> EngineResult<DevOwnership>
where F: Read + Seek
{

#![allow(unused_io_amount)]

f.seek(SeekFrom::Start(0))?;
let mut buf = [0u8; _BDA_STATIC_HDR_SIZE];

// FIXME: See https://github.com/stratis-storage/stratisd/pull/476
f.read(&mut buf)?;

// Using setup() as a test of ownership sets a high bar. It is
Expand Down

0 comments on commit 6606dd1

Please sign in to comment.