Revert "nilfs2: fix potential null-ptr-deref in nilfs_btree_insert()"

This reverts commit 8bb2d85f57.
This commit is contained in:
Ksawlii 2024-11-24 00:23:22 +01:00
parent 83721b0c9f
commit c3584f20ca

View file

@ -381,8 +381,7 @@ static int nilfs_btree_root_broken(const struct nilfs_btree_node *node,
if (unlikely(level < NILFS_BTREE_LEVEL_NODE_MIN ||
level >= NILFS_BTREE_LEVEL_MAX ||
nchildren < 0 ||
nchildren > NILFS_BTREE_ROOT_NCHILDREN_MAX ||
(nchildren == 0 && level > NILFS_BTREE_LEVEL_NODE_MIN))) {
nchildren > NILFS_BTREE_ROOT_NCHILDREN_MAX)) {
nilfs_crit(inode->i_sb,
"bad btree root (ino=%lu): level = %d, flags = 0x%x, nchildren = %d",
inode->i_ino, level, flags, nchildren);