nixpkgs/pkgs/os-specific/linux/kernel/btrfs-enospc.patch

22 lines
854 B
Diff
Raw Normal View History

Revert of http://git.kernel.org/?p=linux/kernel/git/mason/linux-btrfs.git;a=commit;h=5500cdbe14d7435e04f66ff3cfb8ecd8b8e44ebf
Btrfs mailing list where this patch comes from:
http://article.gmane.org/gmane.comp.file-systems.btrfs/16650
This change caused early ENOSPC, and should be integrated to some linux 3.3, but it is still
not there. That's what #btrfs people say.
diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c
index dc083f5..079e5a1 100644
--- a/fs/btrfs/extent-tree.c
+++ b/fs/btrfs/extent-tree.c
@@ -4108,7 +4108,7 @@ static u64 calc_global_metadata_size(struct btrfs_fs_info *fs_info)
num_bytes += div64_u64(data_used + meta_used, 50);
if (num_bytes * 3 > meta_used)
- num_bytes = div64_u64(meta_used, 3) * 2;
+ num_bytes = div64_u64(meta_used, 3);
return ALIGN(num_bytes, fs_info->extent_root->leafsize << 10);
}