public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Alberto Bertogli <albertito@blitiri.com.ar>
To: Theodore Tso <tytso@mit.edu>,
	linux-ext4@vger.kernel.org, linux-kernel@vger.kernel.org,
	dm-devel@redhat.com
Subject: Re: jbd2 inside a device mapper module
Date: Thu, 25 Dec 2008 22:00:05 -0200	[thread overview]
Message-ID: <20081226000005.GB4127@blitiri.com.ar> (raw)
In-Reply-To: <20081225155248.GJ9871@mit.edu>

On Thu, Dec 25, 2008 at 10:52:48AM -0500, Theodore Tso wrote:
> On Thu, Dec 25, 2008 at 12:35:35PM -0200, Alberto Bertogli wrote:
> >  - What is the reason behind the j_inode check in jbd2_journal_create()?
> 
> jbd2_journal_create was only designed for creating inode-based
> journals, and it's a deprecated function that will likely be removed
> soon.

Thanks, I didn't know that!


> >  - Does mke2fs -O journal_dev creates a journal that jbd2_journal_load()
> >    is supposed to read without any knowledge of ext2/3/4 stuff? If not,
> >    how can I create such a journal? I'll be looking at the e2fsprogs
> >    code for the answer to this question later today (I haven't looked at
> >    it yet).
> 
> mke2fs -O journal_dev creates an external journal, but when you create
> a filesystem, you need to specify need to specify location of the
> external journal.    Hence:
> 
> 	 mke2fs -O journal_dev /dev/extern_journal_dev
> 	 mke2fs -t ext4 -J device=/dev/extern_journal_dev /dev/filesystem_dev
> 
> As I said in my last message.  I've tested it, and it works Just Fine.

I think I'm not explaining myself correctly. My code has _nothing_ to do
with ext2/3/4 (or any other filesystem) whatsoever. I'm not using the
journal as an external one for a filesystem. I want to use it to be able
to do atomic writes in my own, filesystem independant, device-mapper
code.

After what you told me (both this and the deprecation of
jbd2_journal_create()), I took a look at e2fsprogs' source. From what I
could see, "mke2fs -O journal_dev" creates the external journal inside
some ext2/3/4 structures, which caused my journal-loading code to fail
(because it doesn't know about ext stuff).

So, I wrote a small "mkjournal" utility that creates a journal on the
block device without any ext2/3/4 stuff. It's based on e2fsprogs'
mkjournal.c, except it doesn't have any ext2 stuff. And it worked great!
I'm now able to load the journal just fine.

Thanks a lot for all the help!

		Alberto


  reply	other threads:[~2008-12-26  0:02 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20081224211038.GT4127@blitiri.com.ar>
2008-12-24 22:38 ` jbd2 inside a device mapper module Alberto Bertogli
     [not found] ` <20081224234915.GA23723@mit.edu>
2008-12-25 14:35   ` Alberto Bertogli
2008-12-25 15:52     ` Theodore Tso
2008-12-26  0:00       ` Alberto Bertogli [this message]
2008-12-26  3:37         ` Theodore Tso
2008-12-26 16:17           ` Alberto Bertogli
2008-12-26 18:06             ` Theodore Tso
2008-12-27  3:00               ` Alberto Bertogli
2008-12-27 19:29                 ` Theodore Tso
2008-12-29 21:30                   ` Alberto Bertogli
2008-12-27 20:01     ` Andreas Dilger
     [not found]       ` <46A00B48CC54E4468EF6911F877AC4CA01DDBB66@blrx3m10.blr.amer.dell.com>
2008-12-29 21:05         ` [dm-devel] " Alberto Bertogli
2008-12-30  6:55           ` Alex Tomas
2008-12-30 13:51             ` Alberto Bertogli

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=20081226000005.GB4127@blitiri.com.ar \
    --to=albertito@blitiri.com.ar \
    --cc=dm-devel@redhat.com \
    --cc=linux-ext4@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tytso@mit.edu \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox