Do not free bufs in case of extents metadata blocks + remove unneeded asserts.

Approved by:    pfg (mentor)
MFC after:      6 months
This commit is contained in:
Fedor Uporov 2017-10-24 19:14:33 +00:00
parent 3a757e5403
commit f0a993bbdb

View File

@ -420,7 +420,7 @@ ext4_ext_find_extent(struct inode *ip, daddr_t block,
}
ext4_ext_fill_path_bdata(&path[ppos], bp, blk);
brelse(bp);
bqrelse(bp);
eh = ext4_ext_block_header(path[ppos].ep_data);
error = ext4_ext_check_header(ip, eh);
@ -1228,7 +1228,7 @@ ext4_ext_get_blocks(struct inode *ip, e4fs_daddr_t iblk,
}
if ((ex = path[depth].ep_ext)) {
uint64_t lblk = ex->e_blk;
uint64_t lblk = ex->e_blk;
uint16_t e_len = ex->e_len;
e4fs_daddr_t e_start = ext4_ext_extent_pblock(ex);
@ -1397,9 +1397,6 @@ ext4_ext_rm_leaf(struct inode *ip, struct ext4_extent_path *path,
/* Remove whole extent. */
block = ex_blk;
num = 0;
KASSERT(a == ex_blk, ("ext4_ext_rm_leaf: bad a"));
KASSERT(b != ex_blk + ex_len - 1,
("ext4_ext_rm_leaf: bad b"));
}
if (ex == EXT_FIRST_EXTENT(eh))
@ -1508,7 +1505,7 @@ ext4_ext_remove_space(struct inode *ip, off_t length, int flags,
return (error);
path = malloc(sizeof(struct ext4_extent_path) * (depth + 1),
M_EXT2EXTENTS, M_WAITOK | M_ZERO);
M_EXT2EXTENTS, M_WAITOK | M_ZERO);
if (!path)
return (ENOMEM);