summaryrefslogtreecommitdiffstats
path: root/fs/btrfs/tree-log.c
diff options
context:
space:
mode:
authorChris Mason2014-12-17 18:41:04 +0100
committerChris Mason2015-04-10 23:00:14 +0200
commit28ed1345a50491d78e1454ad4005dc5d3557a69e (patch)
treebd620b07d9b964680dca517d7dd052f294c13a2c /fs/btrfs/tree-log.c
parentfs: btrfs: Add missing include file (diff)
downloadkernel-qcow2-linux-28ed1345a50491d78e1454ad4005dc5d3557a69e.tar.gz
kernel-qcow2-linux-28ed1345a50491d78e1454ad4005dc5d3557a69e.tar.xz
kernel-qcow2-linux-28ed1345a50491d78e1454ad4005dc5d3557a69e.zip
btrfs: actively run the delayed refs while deleting large files
When we are deleting large files with large extents, we are building up a huge set of delayed refs for processing. Truncate isn't checking often enough to see if we need to back off and process those, or let a commit proceed. The end result is long stalls after the rm, and very long commit times. During the commits, other processes back up waiting to start new transactions and we get into trouble. Signed-off-by: Chris Mason <clm@fb.com>
Diffstat (limited to 'fs/btrfs/tree-log.c')
-rw-r--r--fs/btrfs/tree-log.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/fs/btrfs/tree-log.c b/fs/btrfs/tree-log.c
index 016c90fc85db..a089b5944efc 100644
--- a/fs/btrfs/tree-log.c
+++ b/fs/btrfs/tree-log.c
@@ -4251,8 +4251,12 @@ static int btrfs_log_inode(struct btrfs_trans_handle *trans,
&BTRFS_I(inode)->runtime_flags);
clear_bit(BTRFS_INODE_COPY_EVERYTHING,
&BTRFS_I(inode)->runtime_flags);
- ret = btrfs_truncate_inode_items(trans, log,
- inode, 0, 0);
+ while(1) {
+ ret = btrfs_truncate_inode_items(trans,
+ log, inode, 0, 0);
+ if (ret != -EAGAIN)
+ break;
+ }
}
} else if (test_and_clear_bit(BTRFS_INODE_COPY_EVERYTHING,
&BTRFS_I(inode)->runtime_flags) ||