mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-11-01 17:08:10 +00:00
bcachefs: Convert a BUG_ON() to a warning
We shouldn't ever be writing past i_size - but, apparently there's still a bug to track down. Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
This commit is contained in:
parent
fe9cdf61cc
commit
fb472ac528
1 changed files with 5 additions and 2 deletions
|
@ -757,6 +757,9 @@ static void bch2_set_page_dirty(struct bch_fs *c,
|
|||
struct bch_page_state *s = bch2_page_state(page);
|
||||
unsigned i, dirty_sectors = 0;
|
||||
|
||||
WARN_ON(page_offset(page) + offset + len >
|
||||
round_up(i_size_read(&inode->v), block_bytes(c)));
|
||||
|
||||
for (i = round_down(offset, block_bytes(c)) >> 9;
|
||||
i < round_up(offset + len, block_bytes(c)) >> 9;
|
||||
i++) {
|
||||
|
@ -1442,8 +1445,8 @@ static int __bch2_writepage(struct folio *folio,
|
|||
sectors << 9, offset << 9));
|
||||
|
||||
/* Check for writing past i_size: */
|
||||
BUG_ON((bio_end_sector(&w->io->op.op.wbio.bio) << 9) >
|
||||
round_up(i_size, block_bytes(c)));
|
||||
WARN_ON((bio_end_sector(&w->io->op.op.wbio.bio) << 9) >
|
||||
round_up(i_size, block_bytes(c)));
|
||||
|
||||
w->io->op.op.res.sectors += reserved_sectors;
|
||||
w->io->op.new_i_size = i_size;
|
||||
|
|
Loading…
Reference in a new issue