From 80fe580c8db02059d833d2ded6143e90641184ab Mon Sep 17 00:00:00 2001 From: Kent Overstreet Date: Mon, 24 Oct 2022 15:10:14 -0400 Subject: [PATCH] bcachefs: Fix a spurious warning Fixes fstests generic/648 Signed-off-by: Kent Overstreet --- fs/bcachefs/fs-io.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/fs/bcachefs/fs-io.c b/fs/bcachefs/fs-io.c index 49b0fb6522e70..9e9ada8f007a2 100644 --- a/fs/bcachefs/fs-io.c +++ b/fs/bcachefs/fs-io.c @@ -1428,7 +1428,8 @@ do_io: /* Check for writing past i_size: */ WARN_ON_ONCE((bio_end_sector(&w->io->op.wbio.bio) << 9) > - round_up(i_size, block_bytes(c))); + round_up(i_size, block_bytes(c)) && + !test_bit(BCH_FS_EMERGENCY_RO, &c->flags)); w->io->op.res.sectors += reserved_sectors; w->io->op.i_sectors_delta -= dirty_sectors; -- 2.30.2