linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Francesco Ruggeri <fruggeri@arista.com>
To: viro@zeniv.linux.org.uk, linux-kernel@vger.kernel.org,
	linux-fsdevel@vger.kernel.org,
	Francesco Ruggeri <fruggeri@arista.com>
Subject: Re: [PATCH] block: fix inconsistent page index
Date: Sun, 24 Feb 2019 20:17:10 -0800	[thread overview]
Message-ID: <CA+HUmGi=M=86kJTDc0DrBY-CbtGKP+qAzmGEO+KPkdi9fLm+OQ@mail.gmail.com> (raw)
In-Reply-To: <20190221192712.E5CD895C343F@us180.sjc.aristanetworks.com>

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

      reply	other threads:[~2019-02-25  4:17 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-21 19:27 [PATCH] block: fix inconsistent page index Francesco Ruggeri
2019-02-25  4:17 ` Francesco Ruggeri [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='CA+HUmGi=M=86kJTDc0DrBY-CbtGKP+qAzmGEO+KPkdi9fLm+OQ@mail.gmail.com' \
    --to=fruggeri@arista.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --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).