switch -D is not working

Bug #1183699 reported by arsen stasic
18
This bug affects 4 people
Affects Status Importance Assigned to Milestone
bonnie++ (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

-D (O_DIRECT) is not working. (without -D everything runs fine)

/usr/sbin/bonnie++ -n 1024 -D >> ~/squeeze-mpath-ext4d.csv
Writing a byte at a time...Can't write() - disk full?

echo $?
1

I think its an issue with O_DIRECT.

man 2 open (notes section):
--- snip ---
O_DIRECT

The O_DIRECT flag may impose alignment restrictions on the length and
and address of userspace buffers and the file offset of I/Os. Linux
alignment restrictions vary by file system and kernel version and might
be absent entirely. However there is currently no file
system-independent interface for an application to discover these
restrictions for a given file or file system. [...]

Under Linux 2.6, alignment to 512-byte boundaries suffices.
--- snip ---

I think its located at bon_io.cpp line 227 where you try to write 1
byte:

    if(write(m_fd, &c, 1) != 1)
                   ^^ ^

I think it is sufficient if both *buf and count are 512 byte.

lsb_release -rd
Description: Ubuntu 13.04
Release: 13.04

apt-cache policy bonnie++
bonnie++:
  Installed: 1.97.1
  Candidate: 1.97.1

cheers
-arsen

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in bonnie++ (Ubuntu):
status: New → Confirmed
Revision history for this message
Radu Cristescu (radu.c) wrote :

By that description, '-f' (without a size value) should be enforced with '-D'. I.e. the char test makes no sense in O_DIRECT mode and should be skipped.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.