List:Commits« Previous MessageNext Message »
From:pekka Date:August 27 2007 6:58pm
Subject:bk commit into 5.1 tree (pekka:1.2582) BUG#30646
View as plain text  
Below is the list of changes that have just been committed into a local
5.1 repository of pekka. When pekka does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html

ChangeSet@stripped, 2007-08-27 21:58:49+03:00, pekka@stripped +2 -0
  ndb - bug#30646 fsync on close only if file is open for write

  storage/ndb/src/kernel/blocks/ndbfs/AsyncFile.cpp@stripped, 2007-08-27 21:57:18+03:00, pekka@stripped +8 -1
    AsyncFile: fsync on close only if file is open for write (for AIX)

  storage/ndb/src/kernel/blocks/ndbfs/AsyncFile.hpp@stripped, 2007-08-27 21:57:18+03:00, pekka@stripped +2 -0
    AsyncFile: fsync on close only if file is open for write (for AIX)

# This is a BitKeeper patch.  What follows are the unified diffs for the
# set of deltas contained in the patch.  The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User:	pekka
# Host:	sama.ndb.mysql.com
# Root:	/export/space/pekka/ndb/version/my51-bug30646

--- 1.39/storage/ndb/src/kernel/blocks/ndbfs/AsyncFile.cpp	2007-06-05 18:29:34 +03:00
+++ 1.40/storage/ndb/src/kernel/blocks/ndbfs/AsyncFile.cpp	2007-08-27 21:57:18 +03:00
@@ -99,6 +99,7 @@
 {
   m_page_ptr.setNull();
   m_current_request= m_last_request= 0;
+  m_open_flags = 0;
 }
 
 void
@@ -328,6 +329,7 @@
 {  
   m_auto_sync_freq = 0;
   m_write_wo_sync = 0;
+  m_open_flags = request->par.open.flags;
 
   // for open.flags, see signal FSOPENREQ
 #ifdef NDB_WIN32
@@ -954,7 +956,12 @@
 void
 AsyncFile::closeReq(Request * request)
 {
-  syncReq(request);
+  if (m_open_flags & (
+      FsOpenReq::OM_WRITEONLY |
+      FsOpenReq::OM_READWRITE |
+      FsOpenReq::OM_APPEND )) {
+    syncReq(request);
+  }
 #ifdef NDB_WIN32
   if(!CloseHandle(hFile)) {
     request->error = GetLastError();

--- 1.11/storage/ndb/src/kernel/blocks/ndbfs/AsyncFile.hpp	2007-06-05 19:00:27 +03:00
+++ 1.12/storage/ndb/src/kernel/blocks/ndbfs/AsyncFile.hpp	2007-08-27 21:57:18 +03:00
@@ -224,6 +224,8 @@
 #else
   int theFd;
 #endif
+
+  Uint32 m_open_flags; // OM_ flags from request to open file
   
   MemoryChannel<Request> *theReportTo;
   MemoryChannel<Request>* theMemoryChannelPtr;
Thread
bk commit into 5.1 tree (pekka:1.2582) BUG#30646pekka27 Aug