lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Sun, 3 Apr 2011 11:40:58 +0200
From:	Jan Kara <jack@...e.cz>
To:	Zhu Yanhai <zhu.yanhai@...il.com>
Cc:	linux-ext4@...r.kernel.org,
	Andrew Morton <akpm@...ux-foundation.org>,
	Jan Kara <jack@...e.cz>, Zhu Yanhai <gaoyang.zyh@...bao.com>,
	tytso@....edu
Subject: Re: [PATCH] jbd2: Move bdget out of critical section

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@...bao.com>
  Looks good.
Acked-by: Jan Kara <jack@...e.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@...e.cz>
SUSE Labs, CR
--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ