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: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <AANLkTin-6wZJ=YAwYN+MYH8uNV4=rNuSHrnB4wVCYov7@mail.gmail.com>
Date:	Wed, 15 Sep 2010 16:14:43 +0800
From:	McPacino <mcpacino@...il.com>
To:	Andrew Morton <akpm@...ux-foundation.org>
Cc:	Alexander Viro <viro@...iv.linux.org.uk>,
	Christoph Hellwig <hch@....de>,
	Nick Piggin <npiggin@...nel.dk>, linux-fsdevel@...r.kernel.org,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH] vfs: calculate block-size correctly

On Tue, Sep 14, 2010 at 7:09 AM, Andrew Morton
<akpm@...ux-foundation.org> wrote:
>
> On Wed, 8 Sep 2010 18:07:10 +0800
> Cong Meng <mcpacino@...il.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?
>

I am working on a new multi-version snapshot target module for device-mapper
which is almost done.  It's on-disk metadata block size is fixed 4K, no matter
what the actual disk block size is. So I call __getblk(bdev, block,
4096) to buffer
the metedata.

This is how I hit it.

grow_dev_page(), the main routine of grow_buffers(), has already supported to
grow page buffer of different size.

If we adapt grow_buffer() this way, imho, It's flexible that make
__getblk() get
buffer head of different size. why not?

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

What does this mean?

(sorry for sneding again. this is plain text.)

Thanks.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ