From: Date: October 21 2008 2:31pm Subject: bzr commit into mysql-5.1 branch (jonas:2701) Bug#40205 List-Archive: http://lists.mysql.com/commits/56675 X-Bug: 40205 Message-Id: <20081021123126.EC0AE91B1B4@perch.localdomain> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit #At file:///home/jonas/src/telco-6.2/ 2701 Jonas Oreland 2008-10-21 ndb - bug#40205 O_DIRECT disabled for backups modified: storage/ndb/src/kernel/blocks/ndbfs/AsyncFile.cpp === modified file 'storage/ndb/src/kernel/blocks/ndbfs/AsyncFile.cpp' --- a/storage/ndb/src/kernel/blocks/ndbfs/AsyncFile.cpp 2007-08-27 18:58:49 +0000 +++ b/storage/ndb/src/kernel/blocks/ndbfs/AsyncFile.cpp 2008-10-21 12:31:21 +0000 @@ -270,7 +270,10 @@ AsyncFile::check_odirect_write(Uint32 fl } close(theFd); - theFd = ::open(theFileName.c_str(), new_flags, mode); + /** + * We need to (O_TRUNC) truncate the file since we've written a page to it... + */ + theFd = ::open(theFileName.c_str(), new_flags | O_TRUNC, mode); if (theFd == -1) return errno; #endif @@ -468,6 +471,7 @@ void AsyncFile::openReq(Request* request return; } new_flags |= O_CREAT; + flags |= FsOpenReq::OM_CREATE; } no_odirect: