mirror of https://github.com/vitalif/e2fsprogs
libext2fs: don't hang on to unmapped block if extent tree update fails
If we're doing a BMAP_ALLOC allocation and the extent tree update fails, there's no point in hanging on to the newly allocated block. So, free it to make fsck happy. Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com> Reviewed-by: Zheng Liu <wenqing.lz@taobao.com> Signed-off-by: Theodore Ts'o <tytso@mit.edu>maint-test
parent
3c890ee96e
commit
6225a154d2
|
@ -255,8 +255,10 @@ got_block:
|
|||
set_extent:
|
||||
retval = ext2fs_extent_set_bmap(handle, block,
|
||||
blk64, 0);
|
||||
if (retval)
|
||||
if (retval) {
|
||||
ext2fs_block_alloc_stats2(fs, blk64, -1);
|
||||
return retval;
|
||||
}
|
||||
/* Update inode after setting extent */
|
||||
retval = ext2fs_read_inode(fs, ino, inode);
|
||||
if (retval)
|
||||
|
|
Loading…
Reference in New Issue