diff --git a/env/io_posix.cc b/env/io_posix.cc index 216fc897e..70dd7e9b0 100644 --- a/env/io_posix.cc +++ b/env/io_posix.cc @@ -184,16 +184,15 @@ Status PosixSequentialFile::Read(size_t n, Slice* result, char* scratch) { Status PosixSequentialFile::PositionedRead(uint64_t offset, size_t n, Slice* result, char* scratch) { - if (use_direct_io()) { - assert(IsSectorAligned(offset, GetRequiredBufferAlignment())); - assert(IsSectorAligned(n, GetRequiredBufferAlignment())); - assert(IsSectorAligned(scratch, GetRequiredBufferAlignment())); - } + assert(use_direct_io()); + assert(IsSectorAligned(offset, GetRequiredBufferAlignment())); + assert(IsSectorAligned(n, GetRequiredBufferAlignment())); + assert(IsSectorAligned(scratch, GetRequiredBufferAlignment())); + Status s; ssize_t r = -1; size_t left = n; char* ptr = scratch; - assert(use_direct_io()); while (left > 0) { r = pread(fd_, ptr, left, static_cast(offset)); if (r <= 0) {