Re: [patch] open.2: Fix up incorrect O_DIRECT aligment information

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Jeff,

On Thu, Mar 28, 2013 at 6:28 PM, Jeff Moyer <jmoyer@xxxxxxxxxx> wrote:
> Hi,
>
> The alignment text for O_DIRECT is slightly misleading:
>
>        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  file  system.   Under  Linux 2.6, alignment to 512-byte boundaries
>        suffices.
>
> The last sentence is incorrect.  You cannot perform O_DIRECT I/O in
> sizes smaller than the underlying logical block size (for block devices
> and block-based file systems; nfs is a different beast).  I've attached
> my proposed change.  Comments and word-smithing are most welcome.

Could you provide some detail on how you determined, verified, or
tested this detail? I'm not saying you're wrong, but that text has
been there a long time (since before I was maintainer), in the days
when there was no VCS and changelog. It's even possible that I sent
the patch to Andries that added this piece, since I have an idea that
I tested this detail on Linux 2.6 at some point in the distant past.
Indeed, I just now did a (very) quick test using an old program that
suggest that you can do O_DIRECT I/O with block sizes smaller than the
LBS.

Thanks,

Michael

> Signed-off-by: Jeff Moyer <jmoyer@xxxxxxxxxx>
>
> diff --git a/man2/open.2 b/man2/open.2
> index e518c1f..df92d6a 100644
> --- a/man2/open.2
> +++ b/man2/open.2
> @@ -787,7 +787,8 @@ 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 file system.
> -Under Linux 2.6, alignment to 512-byte boundaries suffices.
> +Under Linux 2.6, alignment to the underlying block device's logical
> +block size suffices.
>  .LP
>  .B O_DIRECT
>  I/Os should never be run concurrently with the



--
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
Author of "The Linux Programming Interface"; http://man7.org/tlpi/
--
To unsubscribe from this list: send the line "unsubscribe linux-man" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Kernel Documentation]     [Netdev]     [Linux Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux