linux-man.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Peter Schiffer <pschiffe-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
To: Michael Kerrisk <mtk.manpages-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Cc: linux-man <linux-man-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	esandeen-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org
Subject: [patch] open.2: Update note about the alignment of the user buffer and the file offset for O_DIRECT flag
Date: Tue, 22 Apr 2014 19:21:19 +0200	[thread overview]
Message-ID: <5356A50F.4010602@redhat.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 377 bytes --]

Hello Michael,

the sentence in open(2) man page in notes for O_DIRECT flag:
"Under Linux 2.6, alignment to 512-byte boundaries suffices."

is not universally correct. The alignment is a property of the storage, 
for example, 4k-sector drives with no 512 byte sector emulation will be 
unable to perform 512-byte direct I/O.

The patch clarifies this sentence.

Thanks,

peter

[-- Attachment #2: open.2.patch --]
[-- Type: text/x-patch, Size: 695 bytes --]

diff --git a/man2/open.2 b/man2/open.2
index 389945f..c80686d 100644
--- a/man2/open.2
+++ b/man2/open.2
@@ -1322,7 +1322,16 @@ operation in
 Under Linux 2.4, transfer sizes, and the alignment of the user buffer
 and the file offset must all be multiples of the logical block size
 of the filesystem.
-Under Linux 2.6, alignment to 512-byte boundaries suffices.
+Under Linux 2.6 and newer, alignment to the logical block size of the
+underlying storage (typically 512 bytes) suffices.
+Logical block size can be determined with
+.BR ioctl (2)
+.B BLKSSZGET
+system call or
+.BR blockdev (8)
+command with
+.B --getss
+parameter.
 .LP
 .B O_DIRECT
 I/Os should never be run concurrently with the

             reply	other threads:[~2014-04-22 17:21 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-22 17:21 Peter Schiffer [this message]
     [not found] ` <5356A50F.4010602-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2014-04-22 18:04   ` [patch] open.2: Update note about the alignment of the user buffer and the file offset for O_DIRECT flag Michael Kerrisk (man-pages)

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5356A50F.4010602@redhat.com \
    --to=pschiffe-h+wxahxf7alqt0dzr+alfa@public.gmane.org \
    --cc=esandeen-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
    --cc=linux-man-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=mtk.manpages-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).