mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Suparna Bhattacharya <suparna@in.ibm.com>
To: Hugh Dickins <hugh@veritas.com>
Cc: Andrew Morton <akpm@digeo.com>, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] lock_buffer_wq do lock
Date: Mon, 16 Jun 2003 19:39:07 +0530	[thread overview]
Message-ID: <20030616193907.A10977@in.ibm.com> (raw)
In-Reply-To: <Pine.LNX.4.44.0306161435110.1846-100000@localhost.localdomain>; from hugh@veritas.com on Mon, Jun 16, 2003 at 02:47:32PM +0100

On Mon, Jun 16, 2003 at 02:47:32PM +0100, Hugh Dickins wrote:
> I've twice got fs/buffer.c:2668 submit_bh BUG_ON(!buffer_locked(bh)):
> when called from sync_dirty_buffer which clearly does the lock_buffer.
> My suspicion falls on lock_buffer_wq (whereas __lock_page_wq looks OK).
> 
> I'm leaving a test running,
> can't judge until tomorrow whether this is indeed the fix to that.
> 
> Hugh
> 
> --- 2.5.71-mm1/include/linux/buffer_head.h	Sun Jun 15 12:36:11 2003
> +++ linux/include/linux/buffer_head.h	Mon Jun 16 14:13:25 2003
> @@ -291,9 +291,11 @@
>  
>  static inline int lock_buffer_wq(struct buffer_head *bh, wait_queue_t *wait)
>  {
> -	if (test_set_buffer_locked(bh))
> -		return __wait_on_buffer_wq(bh, wait);
> -
> +	while (test_set_buffer_locked(bh)) {
> +		int ret = __wait_on_buffer_wq(bh, wait);
> +		if (ret)
> +			return ret;
> +	}
>  	return 0;
>  }

You are right - this should be a while loop mirroring what
lock_buffer does.

Actually, I probably ought to just avoid the dual paths,
and make lock_buffer a wrapper for lock_buffer_wq -- less
chances of divergence between the two. 

Regards
Suparna

-- 
Suparna Bhattacharya (suparna@in.ibm.com)
Linux Technology Center
IBM Software Labs, India


      reply	other threads:[~2003-06-16 13:50 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-06-16 13:47 Hugh Dickins
2003-06-16 14:09 ` Suparna Bhattacharya [this message]

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=20030616193907.A10977@in.ibm.com \
    --to=suparna@in.ibm.com \
    --cc=akpm@digeo.com \
    --cc=hugh@veritas.com \
    --cc=linux-kernel@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

all inboxes | Powered by JetHome®