linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ext4: fix double unlock buffer mess during fs-resize
@ 2012-09-07 10:14 Dmitry Monakhov
  2012-09-25 15:25 ` [PATCH] PING " Dmitry Monakhov
  2012-09-26  3:26 ` [PATCH] " Theodore Ts'o
  0 siblings, 2 replies; 3+ messages in thread
From: Dmitry Monakhov @ 2012-09-07 10:14 UTC (permalink / raw)
  To: linux-ext4; +Cc: tytso, djwong, Dmitry Monakhov

bh_submit_read() is responsible for unlock bh on endio

Signed-off-by: Dmitry Monakhov <dmonakhov@openvz.org>
---
 fs/ext4/resize.c |   15 +++++----------
 1 files changed, 5 insertions(+), 10 deletions(-)

diff --git a/fs/ext4/resize.c b/fs/ext4/resize.c
index 41f6ef6..3b05198 100644
--- a/fs/ext4/resize.c
+++ b/fs/ext4/resize.c
@@ -1076,17 +1076,12 @@ static struct buffer_head *ext4_get_bitmap(struct super_block *sb, __u64 block)
 	struct buffer_head *bh = sb_getblk(sb, block);
 	if (!bh)
 		return NULL;
-
-	if (bitmap_uptodate(bh))
-		return bh;

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] PING  ext4: fix double unlock buffer mess during fs-resize
  2012-09-07 10:14 [PATCH] ext4: fix double unlock buffer mess during fs-resize Dmitry Monakhov
@ 2012-09-25 15:25 ` Dmitry Monakhov
  2012-09-26  3:26 ` [PATCH] " Theodore Ts'o
  1 sibling, 0 replies; 3+ messages in thread
From: Dmitry Monakhov @ 2012-09-25 15:25 UTC (permalink / raw)
  To: linux-ext4; +Cc: tytso, djwong

On Fri,  7 Sep 2012 14:14:44 +0400, Dmitry Monakhov <dmonakhov@openvz.org> wrote:
> bh_submit_read() is responsible for unlock bh on endio
> 
Hi, are any objections against this fix?
> Signed-off-by: Dmitry Monakhov <dmonakhov@openvz.org>
> ---
>  fs/ext4/resize.c |   15 +++++----------
>  1 files changed, 5 insertions(+), 10 deletions(-)
> 
> diff --git a/fs/ext4/resize.c b/fs/ext4/resize.c
> index 41f6ef6..3b05198 100644
> --- a/fs/ext4/resize.c
> +++ b/fs/ext4/resize.c
> @@ -1076,17 +1076,12 @@ static struct buffer_head *ext4_get_bitmap(struct super_block *sb, __u64 block)
>  	struct buffer_head *bh = sb_getblk(sb, block);
>  	if (!bh)
>  		return NULL;
> -
> -	if (bitmap_uptodate(bh))
> -		return bh;
> -
> -	lock_buffer(bh);
> -	if (bh_submit_read(bh) < 0) {
> -		unlock_buffer(bh);
> -		brelse(bh);
> -		return NULL;
> +	if (!bh_uptodate_or_lock(bh)) {
> +		if (bh_submit_read(bh) < 0) {
> +			brelse(bh);
> +			return NULL;
> +		}
>  	}
> -	unlock_buffer(bh);
>  
>  	return bh;
>  }
> -- 
> 1.7.7.6
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] ext4: fix double unlock buffer mess during fs-resize
  2012-09-07 10:14 [PATCH] ext4: fix double unlock buffer mess during fs-resize Dmitry Monakhov
  2012-09-25 15:25 ` [PATCH] PING " Dmitry Monakhov
@ 2012-09-26  3:26 ` Theodore Ts'o
  1 sibling, 0 replies; 3+ messages in thread
From: Theodore Ts'o @ 2012-09-26  3:26 UTC (permalink / raw)
  To: Dmitry Monakhov; +Cc: linux-ext4, djwong

On Fri, Sep 07, 2012 at 02:14:44PM +0400, Dmitry Monakhov wrote:
> bh_submit_read() is responsible for unlock bh on endio
> 
> Signed-off-by: Dmitry Monakhov <dmonakhov@openvz.org>

Thanks, applied.  

BTW, I was checking the call sites for ext4_get_bitmap() in
fs/ext/resize.c, and we doing some extra work in
ext4_set_bitmap_checksums(); if the bitmap is uninitialized, then
there's no point in generating a checksum for it.

Something we can fix later, since it's harmless, although it is extra
unnecessary work.

					- Ted

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2012-09-26  3:26 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-09-07 10:14 [PATCH] ext4: fix double unlock buffer mess during fs-resize Dmitry Monakhov
2012-09-25 15:25 ` [PATCH] PING " Dmitry Monakhov
2012-09-26  3:26 ` [PATCH] " Theodore Ts'o

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).