All of
 help / color / mirror / Atom feed
From: Yehuda Sadeh Weinraub <>
To: Phil Carns <>
Subject: Re: minor file journal size bug
Date: Mon, 14 Jun 2010 10:37:53 -0700	[thread overview]
Message-ID: <> (raw)
In-Reply-To: <>

On Mon, Jun 14, 2010 at 7:19 AM, Phil Carns <> wrote:
> Hi,
> I ran into a minor problem when configuring the ObjectStore to use a file
> journal that was 10 gigabytes in size (osd_journal_size = 10240).  The
> osd_journal_size configuration parameter is an integer.  This would normally
> be fine since the units are in megabytes, but it can overflow when bit
> shifted in  This causes the journal to fall back to trying
> to detect a raw block device journal.
> I've attached a small patch that fixes the problem for me, but there is
> probably a cleaner way to do it.


Just defining osd_journal_size as a long long would do the trick (as
follows), although I'm not sure whether we need to be able to define
journals that are bigger than 2^32 MB. So I guess that in this case we
should probably go with your solution, and also go over the code and
check to see whether we have some other places where we do the same.
We should really be using some macro that does this conversion with a
correct cast.


diff --git a/src/ b/src/
index 9615186..bb4e2c9 100644
--- a/src/
+++ b/src/
@@ -431,7 +431,7 @@ static struct config_option config_optionsp[] = {
        OPTION(mds_kill_import_at, 0, OPT_INT, 0),
        OPTION(osd_data, 0, OPT_STR, ""),
        OPTION(osd_journal, 0, OPT_STR, ""),
-       OPTION(osd_journal_size, 0, OPT_INT, 0),         // in mb
+       OPTION(osd_journal_size, 0, OPT_LONGLONG, 0),         // in mb
        OPTION(osd_balance_reads, 0, OPT_BOOL, false),
        OPTION(osd_flash_crowd_iat_threshold, 0, OPT_INT, 0),
        OPTION(osd_flash_crowd_iat_alpha, 0, OPT_DOUBLE, 0.125),
diff --git a/src/config.h b/src/config.h
index 68dca6f..45206f6 100644
--- a/src/config.h
+++ b/src/config.h
@@ -290,7 +290,7 @@ struct md_config_t {
   // osd
   const char *osd_data;
   const char *osd_journal;
-  int osd_journal_size;  // in mb
+  long long osd_journal_size;  // in mb
   bool osd_balance_reads;
   int osd_flash_crowd_iat_threshold;  // flash crowd interarrival
time threshold in ms
   double osd_flash_crowd_iat_alpha;
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in
the body of a message to
More majordomo info at

  reply	other threads:[~2010-06-14 17:37 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-06-14 14:19 minor file journal size bug Phil Carns
2010-06-14 17:37 ` Yehuda Sadeh Weinraub [this message]
2010-06-15 18:29   ` Phil Carns

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \ \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.