]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
os/filestore/FileJournal: Only write w/ directio fail, it check bufferlist whether... 13980/head
authorJianpeng Ma <jianpeng.ma@intel.com>
Thu, 16 Mar 2017 12:25:30 +0000 (20:25 +0800)
committerJianpeng Ma <jianpeng.ma@intel.com>
Thu, 16 Mar 2017 12:25:30 +0000 (20:25 +0800)
Move check bufferlist align into after direct-write which met error. Because check_align basilly
don't met error.

Signed-off-by: Jianpeng Ma <jianpeng.ma@intel.com>
src/os/filestore/FileJournal.cc

index 74a0031d1ba8bf5ee95ae2567bb8d229f4284247..9956a1f213b4a2b9578e219184d671764227e149 100644 (file)
@@ -1047,7 +1047,6 @@ void FileJournal::do_write(bufferlist& bl)
   off64_t pos = write_pos;
 
   // Adjust write_pos
-  check_align(pos, bl);
   write_pos += bl.length();
   if (write_pos >= header.max_size)
     write_pos = write_pos - header.max_size + get_top();
@@ -1082,12 +1081,14 @@ void FileJournal::do_write(bufferlist& bl)
     if (write_bl(pos, second)) {
       derr << "FileJournal::do_write: write_bl(pos=" << orig_pos
           << ") failed" << dendl;
+      check_align(pos, second);
       ceph_abort();
     }
     orig_pos = first_pos;
     if (write_bl(first_pos, first)) {
       derr << "FileJournal::do_write: write_bl(pos=" << orig_pos
           << ") failed" << dendl;
+      check_align(first_pos, first);
       ceph_abort();
     }
     assert(first_pos == get_top());
@@ -1106,6 +1107,7 @@ void FileJournal::do_write(bufferlist& bl)
     if (write_bl(pos, bl)) {
       derr << "FileJournal::do_write: write_bl(pos=" << pos
           << ") failed" << dendl;
+      check_align(pos, bl);
       ceph_abort();
     }
   }
@@ -1367,8 +1369,6 @@ void FileJournal::do_aio_write(bufferlist& bl)
  */
 int FileJournal::write_aio_bl(off64_t& pos, bufferlist& bl, uint64_t seq)
 {
-  check_align(pos, bl);
-
   dout(20) << "write_aio_bl " << pos << "~" << bl.length() << " seq " << seq << dendl;
 
   while (bl.length() > 0) {
@@ -1421,6 +1421,7 @@ int FileJournal::write_aio_bl(off64_t& pos, bufferlist& bl, uint64_t seq)
          usleep(500);
          continue;
        }
+       check_align(pos, tbl);
        assert(0 == "io_submit got unexpected error");
       } else {
        break;