提交 91e1f56a 编写于 作者: R Robbie Ko 提交者: Filipe Manana

Btrfs: fix leak of subvolume writers counter

When falling back from a nocow write to a regular cow write, we were
leaking the subvolume writers counter in 2 situations, preventing
snapshot creation from ever completing in the future, as it waits
for that counter to go down to zero before the snapshot creation
starts.
Signed-off-by: NRobbie Ko <robbieko@synology.com>
Reviewed-by: NFilipe Manana <fdmanana@suse.com>
[Improved changelog and subject]
Signed-off-by: NFilipe Manana <fdmanana@suse.com>
上级 6f546216
......@@ -1331,10 +1331,16 @@ static noinline int run_delalloc_nocow(struct inode *inode,
* either valid or do not exist.
*/
if (csum_exist_in_range(fs_info, disk_bytenr,
num_bytes))
num_bytes)) {
if (!nolock)
btrfs_end_write_no_snapshoting(root);
goto out_check;
if (!btrfs_inc_nocow_writers(fs_info, disk_bytenr))
}
if (!btrfs_inc_nocow_writers(fs_info, disk_bytenr)) {
if (!nolock)
btrfs_end_write_no_snapshoting(root);
goto out_check;
}
nocow = 1;
} else if (extent_type == BTRFS_FILE_EXTENT_INLINE) {
extent_end = found_key.offset +
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册