Bugzilla – Attachment 655735 Details for
Bug 950178
Can't rename files (on btrfs)
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Forgot Password
[patch]
btrfs kernel patch
0001-Btrfs-use-global-reserve-when-deleting-unused-block-.patch (text/plain), 1.73 KB, created by
Filipe Manana
on 2015-11-12 17:58:58 UTC
(
hide
)
Description:
btrfs kernel patch
Filename:
MIME Type:
Creator:
Filipe Manana
Created:
2015-11-12 17:58:58 UTC
Size:
1.73 KB
patch
obsolete
>From 55257cf0153d0ae74a8f5e0e276b3b2322fbef7d Mon Sep 17 00:00:00 2001 >From: Filipe Manana <fdmanana@suse.com> >Date: Thu, 12 Nov 2015 17:49:45 +0000 >Subject: [PATCH] Btrfs: use global reserve when deleting unused block group > after ENOSPC > >It's possible to reach a state where the cleaner kthread isn't able to >start a transaction to delete an unused block group due to lack of enough >metadata space. If this happens try to use space from the global block >group reserve just like we do for unlink operations. > >Signed-off-by: Filipe Manana <fdmanana@suse.com> >--- > fs/btrfs/extent-tree.c | 21 ++++++++++++++++++++- > 1 file changed, 20 insertions(+), 1 deletion(-) > >diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c >index acf3ed1..dfc9a3e 100644 >--- a/fs/btrfs/extent-tree.c >+++ b/fs/btrfs/extent-tree.c >@@ -10324,7 +10324,26 @@ void btrfs_delete_unused_bgs(struct btrfs_fs_info *fs_info) > */ > /* 1 for btrfs_orphan_reserve_metadata() */ > trans = btrfs_start_transaction(root, 1); >- if (IS_ERR(trans)) { >+ if (IS_ERR(trans) && PTR_ERR(trans) == -ENOSPC) { >+ u64 num_bytes = btrfs_calc_trans_metadata_size(root, 1); >+ >+ trans = btrfs_start_transaction(root, 0); >+ if (IS_ERR(trans)) { >+ btrfs_dec_block_group_ro(root, block_group); >+ ret = PTR_ERR(trans); >+ goto next; >+ } >+ ret = btrfs_cond_migrate_bytes(fs_info, >+ &fs_info->trans_block_rsv, >+ num_bytes, 1); >+ if (ret) { >+ btrfs_dec_block_group_ro(root, block_group); >+ ret = PTR_ERR(trans); >+ goto end_trans; >+ } >+ trans->block_rsv = &root->fs_info->trans_block_rsv; >+ trans->bytes_reserved = num_bytes; >+ } else if (IS_ERR(trans)) { > btrfs_dec_block_group_ro(root, block_group); > ret = PTR_ERR(trans); > goto next; >-- >2.1.3 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
Actions:
View
|
Diff
Attachments on
bug 950178
: 655735