From: Andreas Dilger <adilger@sun.com>
To: Frank Mayhar <fmayhar@google.com>
Cc: linux-ext4@vger.kernel.org, Michael Rubin <mrubin@google.com>
Subject: Re: [RFC PATCH 1/1] Allow ext4 to run without a journal.
Date: Tue, 04 Nov 2008 16:38:54 -0700 [thread overview]
Message-ID: <20081104233854.GA3184@webber.adilger.int> (raw)
In-Reply-To: <1225833701.7133.17.camel@bobble.smo.corp.google.com>
On Nov 04, 2008 13:21 -0800, Frank Mayhar wrote:
> On Thu, 2008-10-30 at 17:40 -0600, Andreas Dilger wrote:
> > One option is to start with a wrapper like "ext4_handle_valid(handle)"
> > instead of checking "handle == NULL" everywhere. Then, we could put
> > a magic value into "handle" and current->journal_info (maybe the
> > the ext3_sb_info pointer). Put a magic value at the start of ext4_sb_info
> > that can be validated as never belonging to a journal handle, and then you
> > don't need to pass "sb" everywhere. It also allows you to distinguish
> > between the "no handle was ever started" case and "running unjournalled".
>
> Okay, yeah, this sounds like the way to go. I had seen the previous
> handle==NULL case but had put it aside to get a proof-of-concept
> implementation going as quickly as possible. Your explanation here
> clears things up.
True - my inspection was from the "what is needed to make this acceptable
for inclusion". The code definitely looks reasonable for performance
testing under different loads.
> My suggestion is, for the non-journalling flag, set the first field
> (which in the handle is a pointer to the transaction) to NULL to
> distinguish it from a real handle. As far as I can tell from browsing
> the code the h_transaction pointer in a real handle should never be
> NULL. Please let me know if this is not the case. And maybe offer
> another suggestion...?
I'm not dead set on a "magic number" solution either, just something
I thought of while looking through the patch. It would definitely
help find places where the code is not doing matching start/stop of
the handle. That isn't important if you are doing a lot of testing
with journals enabled, but it
> (As an aside, this particular situation is one of the reasons a friend
> of mine, Tom Van Vleck, strongly insists on putting magic numbers and
> versions into structures. I'm not as insistent about it as he is but it
> certainly would have helped here.)
>
> > In any case, I'm not sure if this code is completely correct, since the
> > previous code allowed calling ext4_dirty_inode() without first starting
> > a journal handle, and now it would just silently do nothing and cause
> > filesystem corruption for the journalled case.
>
> So now handle==NULL will only refer to this case, correct? And I infer
> from your comment that handle != NULL refers to a started handle, that
> is, a handle that has a non-NULL h_transaction pointer (for my
> purposes).
Right. It might even be worthwhile to add in some debugging to see
if ext4_dirty_inode() is EVER called with handle != NULL, or if this
conditional behaviour is just a residual from days of yore. It seems
the only callsite is from the VFS and there may never be a transaction
started at that point, I'm not sure.
Cheers, Andreas
--
Andreas Dilger
Sr. Staff Engineer, Lustre Group
Sun Microsystems of Canada, Inc.
next prev parent reply other threads:[~2008-11-04 23:39 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-10-30 20:08 [RFC PATCH 1/1] Allow ext4 to run without a journal Frank Mayhar
2008-10-30 23:40 ` Andreas Dilger
2008-10-31 0:06 ` Michael Rubin
2008-10-31 4:20 ` Frank Mayhar
2008-10-31 21:55 ` Frank Mayhar
2008-11-04 21:21 ` Frank Mayhar
2008-11-04 23:38 ` Andreas Dilger [this message]
2008-11-11 19:18 ` [RFC PATCH 1/1] Allow ext4 to run without a journal, take 2 Frank Mayhar
2008-11-17 0:04 ` Andreas Dilger
2008-11-17 17:20 ` Frank Mayhar
2008-11-17 18:08 ` Andreas Dilger
2008-11-17 18:11 ` Frank Mayhar
2008-11-27 7:57 ` Peng Tao
2008-12-01 17:33 ` Frank Mayhar
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=20081104233854.GA3184@webber.adilger.int \
--to=adilger@sun.com \
--cc=fmayhar@google.com \
--cc=linux-ext4@vger.kernel.org \
--cc=mrubin@google.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.