From: Jianpeng Ma Date: Thu, 16 Mar 2017 12:25:30 +0000 (+0800) Subject: os/filestore/FileJournal: Only write w/ directio fail, it check bufferlist whether... X-Git-Tag: v12.0.1~24^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F13980%2Fhead;p=ceph.git os/filestore/FileJournal: Only write w/ directio fail, it check bufferlist whether align. Move check bufferlist align into after direct-write which met error. Because check_align basilly don't met error. Signed-off-by: Jianpeng Ma --- diff --git a/src/os/filestore/FileJournal.cc b/src/os/filestore/FileJournal.cc index 74a0031d1ba..9956a1f213b 100644 --- a/src/os/filestore/FileJournal.cc +++ b/src/os/filestore/FileJournal.cc @@ -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;