]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
fixed stpuid write blocking bug, yay!
authorsage <sage@29311d96-e01e-0410-9327-a35deaab8ce9>
Sun, 3 Sep 2006 22:39:07 +0000 (22:39 +0000)
committersage <sage@29311d96-e01e-0410-9327-a35deaab8ce9>
Sun, 3 Sep 2006 22:39:07 +0000 (22:39 +0000)
git-svn-id: https://ceph.svn.sf.net/svnroot/ceph@839 29311d96-e01e-0410-9327-a35deaab8ce9

ceph/ebofs/Ebofs.cc
ceph/ebofs/Table.h

index 27518f3099c719a0d2dce42f8f517fe2dab0bfd8..b99e6a70da7b3fdcaa8c617ceb2fc01c1033d795 100644 (file)
@@ -375,6 +375,12 @@ int Ebofs::commit_thread_entry()
                          << nodepool.num_free() << " (" << 100*nodepool.num_free()/nodepool.num_total() << "%) free, " 
                          << nodepool.num_limbo() << " (" << 100*nodepool.num_limbo()/nodepool.num_total() << "%) limbo, " 
                          << nodepool.num_total() << " total." << endl;
+         dout(2) << "commit_thread    bc: " 
+                         << "size " << bc.get_size() 
+                         << ", trimmable " << bc.get_trimmable()
+                         << ", max " << g_conf.ebofs_bc_size
+                         << endl;
+         
          
          // (async) write onodes+condes  (do this first; it currently involves inode reallocation)
          commit_inodes_start();
@@ -1976,9 +1982,21 @@ unsigned Ebofs::apply_transaction(Transaction& t, Context *onsafe)
 
 int Ebofs::_write(object_t oid, off_t offset, size_t length, bufferlist& bl)
 {
-  dout(7) << "_write " << hex << oid << dec << " len " << length << " off " << offset << endl;
+  dout(7) << "_write " << hex << oid << dec << " " << offset << "~" << length << endl;
   assert(bl.length() == length);
 
+  // too much unflushed dirty data?  (if so, block!)
+  if (_write_will_block()) {
+       dout(10) << "_write blocking " 
+                        << hex << oid << dec << " " << offset << "~" << length << endl;
+
+       while (_write_will_block()) 
+         bc.waitfor_stat();  // waits on ebofs_lock
+
+       dout(7) << "_write unblocked " 
+                        << hex << oid << dec << " " << offset << "~" << length << endl;
+  }
+
   // out of space?
   unsigned max = (length+offset) / EBOFS_BLOCK_SIZE + 10;  // very conservative; assumes we have to rewrite
   max += dirty_onodes.size() + dirty_cnodes.size();
@@ -2042,18 +2060,6 @@ int Ebofs::write(object_t oid,
   ebofs_lock.Lock();
   assert(len > 0);
 
-  // too much unflushed dirty data?  (if so, block!)
-  if (_write_will_block()) {
-       dout(10) << "write blocking " 
-                        << hex << oid << dec << " len " << len << " off " << off << endl;
-
-       while (_write_will_block()) 
-         bc.waitfor_stat();  // waits on ebofs_lock
-
-       dout(7) << "write unblocked " 
-                       << hex << oid << dec << " len " << len << " off " << off << endl;
-  }
-
   // go
   int r = _write(oid, off, len, bl);
 
index 872b360b3de58f847ceebdc76526c028701f63be..438dca4e6332a2102153c0a909c6ec8c07637958 100644 (file)
@@ -537,7 +537,7 @@ class Table {
          assert( cursor.open[cursor.level].size() == cursor.open[cursor.level].max_items() );
 
          /* can we rotate? */
-         if (false)
+         if (false)      // NO! there's a bug in here somewhere, don't to it.
          if (cursor.level > 0) {
                if ((cursor.pos[cursor.level-1] > 0 
                         && cursor.rotate_left() >= 0) ||