Commit 9d868351 authored by jonas@perch.ndb.mysql.com's avatar jonas@perch.ndb.mysql.com

Merge mysqldev@production.mysql.com:/data0/mysqldev/my/mysql-5.1-release

into  perch.ndb.mysql.com:/home/jonas/tmp/mysql-5.1-release
parents 920ac3a0 05a17d95
...@@ -370,7 +370,6 @@ void AsyncFile::openReq(Request* request) ...@@ -370,7 +370,6 @@ void AsyncFile::openReq(Request* request)
const int mode = S_IRUSR | S_IWUSR | const int mode = S_IRUSR | S_IWUSR |
S_IRGRP | S_IWGRP | S_IRGRP | S_IWGRP |
S_IROTH | S_IWOTH; S_IROTH | S_IWOTH;
retry:
if(flags & FsOpenReq::OM_CREATE_IF_NONE){ if(flags & FsOpenReq::OM_CREATE_IF_NONE){
if((theFd = ::open(theFileName.c_str(), new_flags, mode)) != -1) { if((theFd = ::open(theFileName.c_str(), new_flags, mode)) != -1) {
close(theFd); close(theFd);
...@@ -432,6 +431,7 @@ retry: ...@@ -432,6 +431,7 @@ retry:
m_fs.EXECUTE_DIRECT(block, GSN_FSWRITEREQ, signal, m_fs.EXECUTE_DIRECT(block, GSN_FSWRITEREQ, signal,
FsReadWriteReq::FixedLength + 1); FsReadWriteReq::FixedLength + 1);
retry:
Uint32 size = request->par.open.page_size; Uint32 size = request->par.open.page_size;
char* buf = (char*)m_page_ptr.p; char* buf = (char*)m_page_ptr.p;
while(size > 0){ while(size > 0){
...@@ -449,9 +449,21 @@ retry: ...@@ -449,9 +449,21 @@ retry:
} }
if(size != 0) if(size != 0)
{ {
int err = errno;
#ifdef O_DIRECT
if ((new_flags & O_DIRECT) && off == 0)
{
ndbout_c("error on first write(%d), disable O_DIRECT", err);
new_flags &= ~O_DIRECT;
close(theFd);
theFd = ::open(theFileName.c_str(), new_flags, mode);
if (theFd != -1)
goto retry;
}
#endif
close(theFd); close(theFd);
unlink(theFileName.c_str()); unlink(theFileName.c_str());
request->error = errno; request->error = err;
return; return;
} }
off += request->par.open.page_size; off += request->par.open.page_size;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment