From: Ted Ts'o <tytso@mit.edu>
To: Jan Kara <jack@suse.cz>
Cc: linux-ext4@vger.kernel.org
Subject: Re: [PATCH] jbd2: Fix oops in jbd2_journal_remove_journal_head()
Date: Wed, 8 Jun 2011 10:09:14 -0400 [thread overview]
Message-ID: <20110608140914.GF30037@thunk.org> (raw)
In-Reply-To: <20110606141630.GK7180@thunk.org>
Ping?
- Ted
On Mon, Jun 06, 2011 at 10:16:30AM -0400, Ted Ts'o wrote:
> On Mon, May 30, 2011 at 05:12:58PM +0200, Jan Kara wrote:
> > /*
> > - * For the unlocked version of this call, also make sure that any
> > - * hanging journal_head is cleaned up if necessary.
> > + * For the unlocked version of this call, also drop buffer_head reference.
> > *
> > * __jbd2_journal_refile_buffer is usually called as part of a single locked
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>
> Doesn't this paragraph refer to jbd2_journal_refile_buffer(), not
> __jbd2_journal_refile_buffer()? Or am I missing something?
>
> > void jbd2_journal_refile_buffer(journal_t *journal, struct journal_head *jh)
> > {
> > struct buffer_head *bh = jh2bh(jh);
> >
> > + /* Get reference so that buffer cannot be freed before we unlock it */
> > + get_bh(bh);
>
> OK, so we're adding a get_bh(bh) call to jbd2_journal_refile_buffer(),
> which we're not freeing later in the function. So this means every
> single place where we call jbd2_journal_refile_buffer(), we'd better
> add put_bh(bh) or bhrelse(bh) call, right?
>
> So in fs/jbd2/commit.c, line 418, in jbd2_journal_commit_transaction(),
> I see a call to jbd2_journal_refile_buffer(), which the patch doesn't
> seem to adjust. Looks like this could cause a buffer leak?
>
> In your testing, have you checked to the slab cache to make sure there
> isn't any memory leakage going on with buffer heads?
>
> - Ted
next prev parent reply other threads:[~2011-06-08 14:09 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-05-30 15:12 [PATCH] jbd2: Fix oops in jbd2_journal_remove_journal_head() Jan Kara
2011-06-06 14:16 ` Ted Ts'o
2011-06-08 14:09 ` Ted Ts'o [this message]
2011-06-08 19:31 ` Jan Kara
2011-06-12 21:41 ` Ted Ts'o
2011-06-13 14:10 ` Jan Kara
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=20110608140914.GF30037@thunk.org \
--to=tytso@mit.edu \
--cc=jack@suse.cz \
--cc=linux-ext4@vger.kernel.org \
/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;
as well as URLs for NNTP newsgroup(s).