linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: Cong Meng <mcpacino@gmail.com>
Cc: Alexander Viro <viro@zeniv.linux.org.uk>,
	Christoph Hellwig <hch@lst.de>, Nick Piggin <npiggin@kernel.dk>,
	linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] vfs: calculate block-size correctly
Date: Mon, 13 Sep 2010 16:09:05 -0700	[thread overview]
Message-ID: <20100913160905.332ff633.akpm@linux-foundation.org> (raw)
In-Reply-To: <20100908100710.GA26365@zhongling.bej.apac.novell.com>

On Wed, 8 Sep 2010 18:07:10 +0800
Cong Meng <mcpacino@gmail.com> wrote:

> I sent this patch half mount ago, but no response at all. If anything is
> wrong, please tell me. Thanks a lots. This is my first time to send patch
> to linux kernel.
> 
> The invocation of __getblk(bdev, block, size) will cause kernel stall if
> the @size parameter is not equal to the blockr-size of @bdev, which is saved
> in bdev->bd_inode->i_blkbits.
> 
> submit_bh() has the similar problem.
> 
> This patch calculates the block-size using i_blkbits.
> So that, for example, __getblk() can get a 4K buffer head while the
> block-size of @bdev is 1K.
> 

This comes up every couple of years and iirc we always decided that
it's a bug in the calling code somewhere.  How did you hit it?


> --- a/fs/buffer.c
> +++ b/fs/buffer.c
> @@ -1051,10 +1051,7 @@ grow_buffers(struct block_device *bdev, sector_t block, int size)
>  	pgoff_t index;
>  	int sizebits;
>  
> -	sizebits = -1;
> -	do {
> -		sizebits++;
> -	} while ((size << sizebits) < PAGE_SIZE);

I'm sure the existing code could use __roundup_pow_of_two() here.

  reply	other threads:[~2010-09-13 23:09 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-09-08 10:07 [PATCH] vfs: calculate block-size correctly Cong Meng
2010-09-13 23:09 ` Andrew Morton [this message]
2010-09-15  8:14   ` McPacino

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=20100913160905.332ff633.akpm@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=hch@lst.de \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mcpacino@gmail.com \
    --cc=npiggin@kernel.dk \
    --cc=viro@zeniv.linux.org.uk \
    /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).