Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/mason/btrfs-unstable

* 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/mason/btrfs-unstable:
Btrfs: make sure the chunk allocator doesn't create zero length chunks
Btrfs: fix data enospc check overflow

+21 -5
+15 -5
fs/btrfs/extent-tree.c
··· 3235 3235 u64 bytes) 3236 3236 { 3237 3237 struct btrfs_space_info *data_sinfo; 3238 - int ret = 0, committed = 0; 3238 + u64 used; 3239 + int ret = 0, committed = 0, flushed = 0; 3239 3240 3240 3241 /* make sure bytes are sectorsize aligned */ 3241 3242 bytes = (bytes + root->sectorsize - 1) & ~((u64)root->sectorsize - 1); ··· 3248 3247 again: 3249 3248 /* make sure we have enough space to handle the data first */ 3250 3249 spin_lock(&data_sinfo->lock); 3251 - if (data_sinfo->total_bytes - data_sinfo->bytes_used - 3252 - data_sinfo->bytes_delalloc - data_sinfo->bytes_reserved - 3253 - data_sinfo->bytes_pinned - data_sinfo->bytes_readonly - 3254 - data_sinfo->bytes_may_use - data_sinfo->bytes_super < bytes) { 3250 + used = data_sinfo->bytes_used + data_sinfo->bytes_delalloc + 3251 + data_sinfo->bytes_reserved + data_sinfo->bytes_pinned + 3252 + data_sinfo->bytes_readonly + data_sinfo->bytes_may_use + 3253 + data_sinfo->bytes_super; 3254 + 3255 + if (used + bytes > data_sinfo->total_bytes) { 3255 3256 struct btrfs_trans_handle *trans; 3257 + 3258 + if (!flushed) { 3259 + spin_unlock(&data_sinfo->lock); 3260 + flush_delalloc(root, data_sinfo); 3261 + flushed = 1; 3262 + goto again; 3263 + } 3256 3264 3257 3265 /* 3258 3266 * if we don't have enough free bytes in this space then we need
+6
fs/btrfs/volumes.c
··· 2250 2250 if (!looped) 2251 2251 calc_size = max_t(u64, min_stripe_size, calc_size); 2252 2252 2253 + /* 2254 + * we're about to do_div by the stripe_len so lets make sure 2255 + * we end up with something bigger than a stripe 2256 + */ 2257 + calc_size = max_t(u64, calc_size, stripe_len * 4); 2258 + 2253 2259 do_div(calc_size, stripe_len); 2254 2260 calc_size *= stripe_len; 2255 2261