diff mbox

Fix overflow in FileJournal::_open_file()

Message ID 20101209185322.GD21271@daedalus.cslab.ece.ntua.gr (mailing list archive)
State New, archived
Headers show

Commit Message

Vangelis Koukis Dec. 9, 2010, 6:53 p.m. UTC
None
diff mbox

Patch

diff --git a/src/os/FileJournal.cc b/src/os/FileJournal.cc
index 3bb38a8..cd0808f 100644
--- a/src/os/FileJournal.cc
+++ b/src/os/FileJournal.cc
@@ -223,7 +223,7 @@  int FileJournal::_open_file(int64_t oldsize, blksize_t blksize,
   }

   if (create && (oldsize < conf_journal_sz)) {
-    uint64_t newsize = g_conf.osd_journal_size << 20;
+    uint64_t newsize = (uint64_t)g_conf.osd_journal_size << 20;
     dout(10) << "_open extending to " << newsize << " bytes" << dendl;
     ret = ::ftruncate(fd, newsize);
     if (ret < 0) {