mirror of https://github.com/torvalds/linux.git
iomap: remove pos+len BUG_ON() to after folio lookup
The bug checks at the top of iomap_write_begin() assume the pos/len reflect exactly the next range to process. This may no longer be the case once the get folio path is able to process a folio batch from the filesystem. On top of that, len is already trimmed to within the iomap/srcmap by iomap_length(), so these checks aren't terribly useful. Remove the unnecessary BUG_ON() checks. Signed-off-by: Brian Foster <bfoster@redhat.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Darrick J. Wong <djwong@kernel.org> Signed-off-by: Christian Brauner <brauner@kernel.org>
This commit is contained in:
parent
f8d98072fe
commit
49590716be
|
|
@ -826,15 +826,12 @@ static int iomap_write_begin(struct iomap_iter *iter,
|
||||||
size_t *poffset, u64 *plen)
|
size_t *poffset, u64 *plen)
|
||||||
{
|
{
|
||||||
const struct iomap *srcmap = iomap_iter_srcmap(iter);
|
const struct iomap *srcmap = iomap_iter_srcmap(iter);
|
||||||
loff_t pos = iter->pos;
|
loff_t pos;
|
||||||
u64 len = min_t(u64, SIZE_MAX, iomap_length(iter));
|
u64 len = min_t(u64, SIZE_MAX, iomap_length(iter));
|
||||||
struct folio *folio;
|
struct folio *folio;
|
||||||
int status = 0;
|
int status = 0;
|
||||||
|
|
||||||
len = min_not_zero(len, *plen);
|
len = min_not_zero(len, *plen);
|
||||||
BUG_ON(pos + len > iter->iomap.offset + iter->iomap.length);
|
|
||||||
if (srcmap != &iter->iomap)
|
|
||||||
BUG_ON(pos + len > srcmap->offset + srcmap->length);
|
|
||||||
|
|
||||||
if (fatal_signal_pending(current))
|
if (fatal_signal_pending(current))
|
||||||
return -EINTR;
|
return -EINTR;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue