From: Sunil Mushran <sunil.mushran@oracle.com>
To: ocfs2-devel@oss.oracle.com
Subject: [Ocfs2-devel] Large (> 16TiB) volumes revisited
Date: Mon, 28 Jun 2010 17:47:32 -0700 [thread overview]
Message-ID: <4C2942A4.1050901@oracle.com> (raw)
In-Reply-To: <AANLkTikJOtSn1ohvfPgCrKEfBOYsmmYDNe_aFUAsGgZb@mail.gmail.com>
On 06/28/2010 03:32 PM, Patrick J. LoPresti wrote:
> Current version of my proposed patch is appended.
>
> The good news is that I have tested it, and it "works for me".
>
> The bad news is that it performs the check fairly late (in
> ocfs2_check_volume(), just after the call to ocfs2_journal_load()),
> because this is the earliest I have the journal flags available to
> test.
>
>
That should be ok. Afterall we have to handle journal_load()
failing for other reasons too. BTW, have you tested with cleared
INCOMPAT_64BIT journal flag?
Hopefully, we'll never trigger this condition... that is if we are
careful when making the same change in mkfs/tunefs.
> We can:
>
> (a) Run with this patch pretty much as-is; or
> (b) Move the jbd2_journal_load() call out of ocfs2_journal_load() so
> that the flags will be in memory sooner; or
> (c) Do something else (ideas welcome)
>
> Let me know what you think. Thanks!
>
> - Pat
>
>
> diff --git a/fs/ocfs2/super.c b/fs/ocfs2/super.c
> index 0eaa929..3db233d 100644
> --- a/fs/ocfs2/super.c
> +++ b/fs/ocfs2/super.c
> @@ -1991,6 +1991,47 @@ static int ocfs2_setup_osb_uuid(struct
> ocfs2_super *osb, const unsigned char *uu
> return 0;
> }
>
> +/* Check to make sure entire volume is addressable on this system.
> + Requires osb_clusters_at_boot to be valid and for the journal to
> + have been read by jbd2_journal_load(). */
> +static int ocfs2_check_addressable(struct ocfs2_super *osb)
> +{
> + int status = 0;
> + u64 max_block =
> + ocfs2_clusters_to_blocks(osb->sb,
> + osb->osb_clusters_at_boot) - 1;
> +
> + /* Absolute addressability check (borrowed from ext4/super.c) */
> + if ((max_block>
> + (sector_t)(~0LL)>> (osb->sb->s_blocksize_bits - 9)) ||
> + (max_block> (pgoff_t)(~0LL)>> (PAGE_CACHE_SHIFT -
> + osb->sb->s_blocksize_bits))) {
> + mlog(ML_ERROR, "Volume too large "
> + "to mount safely on this system");
> + status = -EFBIG;
> + goto out;
> + }
> +
> + /* 32-bit block number is always OK. */
> + if (max_block<= (u32)~0UL)
> + goto out;
> +
> + /* Volume is "huge", so see if our journal is new enough to
> + support it. */
> + if (!(OCFS2_HAS_COMPAT_FEATURE(osb->sb,
> + OCFS2_FEATURE_COMPAT_JBD2_SB)&&
> + jbd2_journal_check_used_features(osb->journal->j_journal, 0, 0,
> + JBD2_FEATURE_INCOMPAT_64BIT))) {
> + mlog(ML_ERROR, "The journal cannot address the entire volume. "
> + "Enable the 'block64' journal option with tunefs.ocfs2");
> + status = -EFBIG;
> + goto out;
> + }
> +
> + out:
> + return status;
> +}
> +
> static int ocfs2_initialize_super(struct super_block *sb,
> struct buffer_head *bh,
> int sector_size,
> @@ -2215,14 +2256,6 @@ static int ocfs2_initialize_super(struct super_block *sb,
> goto bail;
> }
>
> - if (ocfs2_clusters_to_blocks(osb->sb, le32_to_cpu(di->i_clusters) - 1)
> - > (u32)~0UL) {
> - mlog(ML_ERROR, "Volume might try to write to blocks beyond "
> - "what jbd can address in 32 bits.\n");
> - status = -EINVAL;
> - goto bail;
> - }
> -
> if (ocfs2_setup_osb_uuid(osb, di->id2.i_super.s_uuid,
> sizeof(di->id2.i_super.s_uuid))) {
> mlog(ML_ERROR, "Out of memory trying to setup our uuid.\n");
> @@ -2404,6 +2437,12 @@ static int ocfs2_check_volume(struct ocfs2_super *osb)
> goto finally;
> }
>
> + /* Now that journal has been loaded, check to make sure entire
> + volume is addressable. */
> + status = ocfs2_check_addressable(osb);
> + if (status)
> + goto finally;
> +
> if (dirty) {
> /* recover my local alloc if we didn't unmount cleanly. */
> status = ocfs2_begin_local_alloc_recovery(osb,
>
> _______________________________________________
> Ocfs2-devel mailing list
> Ocfs2-devel at oss.oracle.com
> http://oss.oracle.com/mailman/listinfo/ocfs2-devel
>
next prev parent reply other threads:[~2010-06-29 0:47 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-06-23 0:11 [Ocfs2-devel] Large (> 16TiB) volumes revisited Patrick J. LoPresti
2010-06-23 0:49 ` Joel Becker
2010-06-23 1:12 ` Patrick J. LoPresti
2010-06-23 1:36 ` Joel Becker
2010-06-24 0:04 ` Patrick J. LoPresti
2010-06-24 0:14 ` Joel Becker
2010-06-24 0:45 ` Patrick J. LoPresti
2010-06-24 0:55 ` Joel Becker
2010-06-24 16:53 ` Patrick J. LoPresti
2010-06-24 23:53 ` Patrick J. LoPresti
2010-06-26 16:49 ` Patrick J. LoPresti
2010-06-27 19:02 ` Patrick J. LoPresti
2010-06-28 22:32 ` Patrick J. LoPresti
2010-06-29 0:47 ` Sunil Mushran [this message]
2010-06-29 1:15 ` Patrick J. LoPresti
2010-06-29 1:54 ` Sunil Mushran
2010-06-29 2:50 ` Patrick J. LoPresti
2010-06-29 4:21 ` Sunil Mushran
2010-06-29 19:43 ` Patrick J. LoPresti
2010-06-29 20:22 ` Sunil Mushran
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:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4C2942A4.1050901@oracle.com \
--to=sunil.mushran@oracle.com \
--cc=ocfs2-devel@oss.oracle.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* 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.