[PATCH] os/FileJournal: Update the journal header when closing journal

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



When closing journal, it should check must_write_header and update
journal header if must_write_header alreay set.
It can reduce the nosense journal-replay after restarting osd.

Signed-off-by: Ma Jianpeng <jianpeng.ma@xxxxxxxxx>
---
 src/os/FileJournal.cc | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/os/FileJournal.cc b/src/os/FileJournal.cc
index 7eb7927..5649e6d 100644
--- a/src/os/FileJournal.cc
+++ b/src/os/FileJournal.cc
@@ -544,6 +544,7 @@ void FileJournal::close()

   // close
   assert(writeq_empty());
+  assert(!must_write_header);
   assert(fd >= 0);
   VOID_TEMP_FAILURE_RETRY(::close(fd));
   fd = -1;
@@ -1102,7 +1103,7 @@ void FileJournal::write_thread_entry()
   while (1) {
     {
       Mutex::Locker locker(writeq_lock);
-      if (writeq.empty()) {
+      if (writeq.empty() && !must_write_header) {
        if (write_stop)
          break;
        dout(20) << "write_thread_entry going to sleep" << dendl;
--
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [CEPH Users]     [Ceph Large]     [Ceph Dev]     [Information on CEPH]     [Linux BTRFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux