hi Randy: 2014-07-19 2:13 GMT+08:00 Randy Dunlap <rdunlap@xxxxxxxxxxxxx>: > On 07/18/2014 10:31 AM, loody wrote: >> hi Randy and All: >> >>> >>> It means that the <buffer> still is not aligned to a 512-byte boundary. >>> Try >>> char buffer[1024] __attribute__ ((aligned(1024))); >>> >>> Well, that is aligned to 1024 bytes, not 512, but whatever. >> the suggestion you gave to me works ^^ >> is there any alignment check in kernel FS such that it will directly >> output to device instead of getting data from page cache? > > Not sure that I understand your question, but I think that using > O_DIRECT in the open() call attempts to do what you are asking. > > Please read 'man open' and search for O_DIRECT. sorry for making you confused. ^^ I just want to know why O_DIRECT is not enough and need to announce the buffer size as 512-byte boundary. Is there any checking mechanism for 512-byte when O_DIRECT flag apply? appreciate all your kind help, -- To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html