lkml.org 
[lkml]   [2019]   [Feb]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH] block: fix inconsistent page index
On Thu, Feb 21, 2019 at 11:27 AM Francesco Ruggeri <fruggeri@arista.com> wrote:
>
> __find_get_block_slow() and grow_buffers() use different methods to compute
> a page index for a given block: __find_get_block_slow() computes it from
> bd_inode->i_blkbits, while grow_buffers() computes it from the block size
> argument.
> The two can get out of sync, for example if bd_inode->i_blkbits is modified
> while a isofs_fill_super() (in mount) is between sb_min_blocksize() and
> sb_read/__bread_gfp/__getblk_gfp/__getblk_slow.
> The script below can reproduce such a scenario, resulting in an infinite
> loop in __getblk_slow(), as grow_buffers() allocates a page but
> __find_get_block() keeps looking for a different one.
> This patch changes __find_get_block_slow() to also use the block size.
> It implicitly relies on size being a power of 2 in the 256..PAGE_SIZE
> range.
>

Any comments?

Thanks,
Francesco Ruggeri

\
 
 \ /
  Last update: 2019-02-25 05:18    [W:0.116 / U:0.252 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site