From: Jan Kara <jack@suse.cz>
To: Zhu Yanhai <zhu.yanhai@gmail.com>
Cc: linux-ext4@vger.kernel.org,
Andrew Morton <akpm@linux-foundation.org>,
Jan Kara <jack@suse.cz>, Zhu Yanhai <gaoyang.zyh@taobao.com>,
tytso@mit.edu
Subject: Re: [PATCH] jbd2: Move bdget out of critical section
Date: Sun, 3 Apr 2011 11:40:58 +0200 [thread overview]
Message-ID: <20110403094058.GA5141@quack.suse.cz> (raw)
In-Reply-To: <1301734876-22207-1-git-send-email-gaoyang.zyh@taobao.com>
On Sat 02-04-11 17:01:16, Zhu Yanhai wrote:
> bdget() should not be called when we hold spinlocks since
> it might sleep.
>
> Signed-off-by: Zhu Yanhai <gaoyang.zyh@taobao.com>
Looks good.
Acked-by: Jan Kara <jack@suse.cz>
PS: Added Ted to CC since he merges JBD2 patches.
Honza
> ---
> fs/jbd2/journal.c | 3 ++-
> 1 files changed, 2 insertions(+), 1 deletions(-)
>
> diff --git a/fs/jbd2/journal.c b/fs/jbd2/journal.c
> index 90407b8..33dd3ef 100644
> --- a/fs/jbd2/journal.c
> +++ b/fs/jbd2/journal.c
> @@ -2413,10 +2413,12 @@ const char *jbd2_dev_to_name(dev_t device)
> new_dev = kmalloc(sizeof(struct devname_cache), GFP_KERNEL);
> if (!new_dev)
> return "NODEV-ALLOCFAILURE"; /* Something non-NULL */
> + bd = bdget(device);
> spin_lock(&devname_cache_lock);
> if (devcache[i]) {
> if (devcache[i]->device == device) {
> kfree(new_dev);
> + bdput(bd);
> ret = devcache[i]->devname;
> spin_unlock(&devname_cache_lock);
> return ret;
> @@ -2425,7 +2427,6 @@ const char *jbd2_dev_to_name(dev_t device)
> }
> devcache[i] = new_dev;
> devcache[i]->device = device;
> - bd = bdget(device);
> if (bd) {
> bdevname(bd, devcache[i]->devname);
> bdput(bd);
> --
> 1.7.4
>
--
Jan Kara <jack@suse.cz>
SUSE Labs, CR
next prev parent reply other threads:[~2011-04-04 0:37 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-04-02 9:01 [PATCH] jbd2: Move bdget out of critical section Zhu Yanhai
2011-04-03 9:40 ` Jan Kara [this message]
2011-04-04 16:36 ` Ted Ts'o
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=20110403094058.GA5141@quack.suse.cz \
--to=jack@suse.cz \
--cc=akpm@linux-foundation.org \
--cc=gaoyang.zyh@taobao.com \
--cc=linux-ext4@vger.kernel.org \
--cc=tytso@mit.edu \
--cc=zhu.yanhai@gmail.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 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).