diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2016-07-31 21:27:32 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2016-07-31 21:27:32 -0400 |
commit | ba929b6646c5b87c7bb15cd8d3e51617725c983b (patch) | |
tree | 153731dffbd8353369fd37a846f2de91f6662717 /fs/btrfs/file.c | |
parent | c9b95e5961c0294e0efffeaa847c1a1e6369204c (diff) | |
parent | 8b8b08cbfb9021af4b54b4175fc4c51d655aac8c (diff) |
Merge branch 'for-linus-4.8' of git://git.kernel.org/pub/scm/linux/kernel/git/mason/linux-btrfs
Pull btrfs updates from Chris Mason:
"This pull is dedicated to Josef's enospc rework, which we've been
testing for a few releases now. It fixes some early enospc problems
and is dramatically faster.
This also includes an updated fix for the delalloc accounting that
happens after a fault in copy_from_user. My patch in v4.7 was almost
but not quite enough"
* 'for-linus-4.8' of git://git.kernel.org/pub/scm/linux/kernel/git/mason/linux-btrfs:
Btrfs: fix delalloc accounting after copy_from_user faults
Btrfs: avoid deadlocks during reservations in btrfs_truncate_block
Btrfs: use FLUSH_LIMIT for relocation in reserve_metadata_bytes
Btrfs: fill relocation block rsv after allocation
Btrfs: always use trans->block_rsv for orphans
Btrfs: change how we calculate the global block rsv
Btrfs: use root when checking need_async_flush
Btrfs: don't bother kicking async if there's nothing to reclaim
Btrfs: fix release reserved extents trace points
Btrfs: add fsid to some tracepoints
Btrfs: add tracepoints for flush events
Btrfs: fix delalloc reservation amount tracepoint
Btrfs: trace pinned extents
Btrfs: introduce ticketed enospc infrastructure
Btrfs: add tracepoint for adding block groups
Btrfs: warn_on for unaccounted spaces
Btrfs: change delayed reservation fallback behavior
Btrfs: always reserve metadata for delalloc extents
Btrfs: fix callers of btrfs_block_rsv_migrate
Btrfs: add bytes_readonly to the spaceinfo at once
Diffstat (limited to 'fs/btrfs/file.c')
-rw-r--r-- | fs/btrfs/file.c | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/fs/btrfs/file.c b/fs/btrfs/file.c index 2234e88cf674..bcfb4a27ddd4 100644 --- a/fs/btrfs/file.c +++ b/fs/btrfs/file.c | |||
@@ -1629,13 +1629,11 @@ again: | |||
1629 | * managed to copy. | 1629 | * managed to copy. |
1630 | */ | 1630 | */ |
1631 | if (num_sectors > dirty_sectors) { | 1631 | if (num_sectors > dirty_sectors) { |
1632 | /* | 1632 | |
1633 | * we round down because we don't want to count | 1633 | /* release everything except the sectors we dirtied */ |
1634 | * any partial blocks actually sent through the | 1634 | release_bytes -= dirty_sectors << |
1635 | * IO machines | 1635 | root->fs_info->sb->s_blocksize_bits; |
1636 | */ | 1636 | |
1637 | release_bytes = round_down(release_bytes - copied, | ||
1638 | root->sectorsize); | ||
1639 | if (copied > 0) { | 1637 | if (copied > 0) { |
1640 | spin_lock(&BTRFS_I(inode)->lock); | 1638 | spin_lock(&BTRFS_I(inode)->lock); |
1641 | BTRFS_I(inode)->outstanding_extents++; | 1639 | BTRFS_I(inode)->outstanding_extents++; |
@@ -2479,7 +2477,7 @@ static int btrfs_punch_hole(struct inode *inode, loff_t offset, loff_t len) | |||
2479 | } | 2477 | } |
2480 | 2478 | ||
2481 | ret = btrfs_block_rsv_migrate(&root->fs_info->trans_block_rsv, rsv, | 2479 | ret = btrfs_block_rsv_migrate(&root->fs_info->trans_block_rsv, rsv, |
2482 | min_size); | 2480 | min_size, 0); |
2483 | BUG_ON(ret); | 2481 | BUG_ON(ret); |
2484 | trans->block_rsv = rsv; | 2482 | trans->block_rsv = rsv; |
2485 | 2483 | ||
@@ -2522,7 +2520,7 @@ static int btrfs_punch_hole(struct inode *inode, loff_t offset, loff_t len) | |||
2522 | } | 2520 | } |
2523 | 2521 | ||
2524 | ret = btrfs_block_rsv_migrate(&root->fs_info->trans_block_rsv, | 2522 | ret = btrfs_block_rsv_migrate(&root->fs_info->trans_block_rsv, |
2525 | rsv, min_size); | 2523 | rsv, min_size, 0); |
2526 | BUG_ON(ret); /* shouldn't happen */ | 2524 | BUG_ON(ret); /* shouldn't happen */ |
2527 | trans->block_rsv = rsv; | 2525 | trans->block_rsv = rsv; |
2528 | 2526 | ||