From 7c701962bba8e2ee1bfbb73cea588df397350117 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Tue, 3 Apr 2018 10:06:19 -0500 Subject: [PATCH] os/filestore/FileJournal: avoid push_front Signed-off-by: Sage Weil --- src/os/filestore/FileJournal.cc | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/os/filestore/FileJournal.cc b/src/os/filestore/FileJournal.cc index e52ed031d087..0c0940dc506d 100644 --- a/src/os/filestore/FileJournal.cc +++ b/src/os/filestore/FileJournal.cc @@ -1079,7 +1079,10 @@ void FileJournal::do_write(bufferlist& bl) // header too? if (hbp.length()) { // be sneaky: include the header in the second fragment - second.push_front(hbp); + bufferlist tmp; + tmp.push_back(hbp); + tmp.claim_append(second); + second.swap(tmp); pos = 0; // we included the header } // Write the second portion first possible with the header, so @@ -1335,7 +1338,10 @@ void FileJournal::do_aio_write(bufferlist& bl) assert(pos == header.max_size); if (hbp.length()) { // be sneaky: include the header in the second fragment - second.push_front(hbp); + bufferlist tmp; + tmp.push_back(hbp); + tmp.claim_append(second); + second.swap(tmp); pos = 0; // we included the header } else pos = get_top(); // no header, start after that -- 2.47.3