Btrfs: make sure btrfs_remove_free_space doesn't leak EAGAIN
btrfs_remove_free_space needs to make sure to set ret back to a valid return value after setting it to EAGAIN, otherwise we return it to the callers. Signed-off-by: Chris Mason <chris.mason@oracle.com>
This commit is contained in:
parent
cd354ad613
commit
1eae31e918
@ -1868,6 +1868,7 @@ again:
|
|||||||
ctl->total_bitmaps--;
|
ctl->total_bitmaps--;
|
||||||
}
|
}
|
||||||
kmem_cache_free(btrfs_free_space_cachep, info);
|
kmem_cache_free(btrfs_free_space_cachep, info);
|
||||||
|
ret = 0;
|
||||||
goto out_lock;
|
goto out_lock;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1875,7 +1876,8 @@ again:
|
|||||||
unlink_free_space(ctl, info);
|
unlink_free_space(ctl, info);
|
||||||
info->offset += bytes;
|
info->offset += bytes;
|
||||||
info->bytes -= bytes;
|
info->bytes -= bytes;
|
||||||
link_free_space(ctl, info);
|
ret = link_free_space(ctl, info);
|
||||||
|
WARN_ON(ret);
|
||||||
goto out_lock;
|
goto out_lock;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user