提交 3eda41df 编写于 作者: E Eric Whitney 提交者: Theodore Ts'o

Revert "ext4: enforce buffer head state assertion in ext4_da_map_blocks"

This reverts commit 948ca5f3.

Two crash reports from users running variations on 5.15-rc4 kernels
suggest that it is premature to enforce the state assertion in the
original commit.  Both crashes were triggered by BUG calls in that
code, indicating that under some rare circumstance the buffer head
state did not match a delayed allocated block at the time the
block was written out.  No reproducer is available.  Resolving this
problem will require more time than remains in the current release
cycle, so reverting the original patch for the time being is necessary
to avoid any instability it may cause.
Signed-off-by: NEric Whitney <enwlinux@gmail.com>
Link: https://lore.kernel.org/r/20211012171901.5352-1-enwlinux@gmail.com
Fixes: 948ca5f3 ("ext4: enforce buffer head state assertion in ext4_da_map_blocks")
Signed-off-by: NTheodore Ts'o <tytso@mit.edu>
Cc: stable@kernel.org
上级 9e1ff307
...@@ -1711,16 +1711,13 @@ static int ext4_da_map_blocks(struct inode *inode, sector_t iblock, ...@@ -1711,16 +1711,13 @@ static int ext4_da_map_blocks(struct inode *inode, sector_t iblock,
} }
/* /*
* the buffer head associated with a delayed and not unwritten * Delayed extent could be allocated by fallocate.
* block found in the extent status cache must contain an * So we need to check it.
* invalid block number and have its BH_New and BH_Delay bits
* set, reflecting the state assigned when the block was
* initially delayed allocated
*/ */
if (ext4_es_is_delonly(&es)) { if (ext4_es_is_delayed(&es) && !ext4_es_is_unwritten(&es)) {
BUG_ON(bh->b_blocknr != invalid_block); map_bh(bh, inode->i_sb, invalid_block);
BUG_ON(!buffer_new(bh)); set_buffer_new(bh);
BUG_ON(!buffer_delay(bh)); set_buffer_delay(bh);
return 0; return 0;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册