Re: How to know the file size limit, and know if O_DIRECT is supported

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

 



A: http://en.wikipedia.org/wiki/Top_post
Q: Where do I find info about this thing called top-posting?
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing in e-mail?

A: No.
Q: Should I leave quotations after my reply?

On Fri, Dec 22, 2006 at 10:04:16AM +0800, colin wrote:
> 
> Hi Erik,
> My colleague said that when use direct I/O on USB disk that has a ext3
> partition, open can succeed, but read fails.

Then you're reading the wrong way.

> I know that filesystem must have some system calls for direct I/O, and open
> with O_DIRECT flag will check if these system calls exist.
> But why does read fail? Is it that direst I/O cannot use on USB disk?

Because you probably don't read() the right way. For direct IO to
succeed, you need:

- a device or filesystem that supports it
- a page aligned buffer
- transfers need to be multiples of the sector size in 2.6 or multiples
  of the soft block size in 2.4


Erik

-- 
They're all fools. Don't worry. Darwin may be slow, but he'll
eventually get them. -- Matthew Lammers in alt.sysadmin.recovery

--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           http://kernelnewbies.org/faq/


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux