mirror of
https://github.com/torvalds/linux.git
synced 2025-12-07 20:06:24 +00:00
Merge branch 'for-linus-4.10' of git://git.kernel.org/pub/scm/linux/kernel/git/mason/linux-btrfs
Pull btrfs fixes from Chris Mason: "These are all over the place. The tracepoint part of the pull fixes a crash and adds a little more information to two tracepoints, while the rest are good old fashioned fixes" * 'for-linus-4.10' of git://git.kernel.org/pub/scm/linux/kernel/git/mason/linux-btrfs: btrfs: make tracepoint format strings more compact Btrfs: add truncated_len for ordered extent tracepoints Btrfs: add 'inode' for extent map tracepoint btrfs: fix crash when tracepoint arguments are freed by wq callbacks Btrfs: adjust outstanding_extents counter properly when dio write is split Btrfs: fix lockdep warning about log_mutex Btrfs: use down_read_nested to make lockdep silent btrfs: fix locking when we put back a delayed ref that's too new btrfs: fix error handling when run_delayed_extent_op fails btrfs: return the actual error value from from btrfs_uuid_tree_iterate
This commit is contained in:
@@ -7059,7 +7059,7 @@ insert:
|
||||
write_unlock(&em_tree->lock);
|
||||
out:
|
||||
|
||||
trace_btrfs_get_extent(root, em);
|
||||
trace_btrfs_get_extent(root, inode, em);
|
||||
|
||||
btrfs_free_path(path);
|
||||
if (trans) {
|
||||
@@ -7623,11 +7623,18 @@ static void adjust_dio_outstanding_extents(struct inode *inode,
|
||||
* within our reservation, otherwise we need to adjust our inode
|
||||
* counter appropriately.
|
||||
*/
|
||||
if (dio_data->outstanding_extents) {
|
||||
if (dio_data->outstanding_extents >= num_extents) {
|
||||
dio_data->outstanding_extents -= num_extents;
|
||||
} else {
|
||||
/*
|
||||
* If dio write length has been split due to no large enough
|
||||
* contiguous space, we need to compensate our inode counter
|
||||
* appropriately.
|
||||
*/
|
||||
u64 num_needed = num_extents - dio_data->outstanding_extents;
|
||||
|
||||
spin_lock(&BTRFS_I(inode)->lock);
|
||||
BTRFS_I(inode)->outstanding_extents += num_extents;
|
||||
BTRFS_I(inode)->outstanding_extents += num_needed;
|
||||
spin_unlock(&BTRFS_I(inode)->lock);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user