History

Merge tag 'for-4.17-rc3-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux

Pull btrfs fixes from David Sterba: "Two regression fixes and one fix for stable" * tag 'for-4.17-rc3-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux: Btrfs: send, fix missing truncate for inode with prealloc extent past eof btrfs: Take trans lock before access running trans in check_delayed_ref btrfs: Fix wrong first_key parameter in replace_path

Linus Torvalds committed 8 years ago

Commit 4148d382 parents 625e200 a6aa10c3 files · +12 −1Browse files

Unified · Split

3 files
  1. fs/btrfs/extent-tree.c +7 −0
  2. fs/btrfs/relocation.c +1 −1
  3. fs/btrfs/send.c +4 −0
fs/btrfs/extent-tree.c+7−0
@@ -3142,7 +3142,11 @@ static noinline int check_delayed_ref(struct btrfs_root *root, · 3141 unmodified lines
31423142 struct rb_node *node;
31433143 int ret = 0;
31443144
3145+ spin_lock(&root->fs_info->trans_lock);
31453146 cur_trans = root->fs_info->running_transaction;
3147+ if (cur_trans)
3148+ refcount_inc(&cur_trans->use_count);
3149+ spin_unlock(&root->fs_info->trans_lock);
31463150 if (!cur_trans)
31473151 return 0;
31483152
@@ -3151,6 +3155,7 @@ static noinline int check_delayed_ref(struct btrfs_root *root, · 2 unmodified lines
31513155 head = btrfs_find_delayed_ref_head(delayed_refs, bytenr);
31523156 if (!head) {
31533157 spin_unlock(&delayed_refs->lock);
3158+ btrfs_put_transaction(cur_trans);
31543159 return 0;
31553160 }
31563161
@@ -3167,6 +3172,7 @@ static noinline int check_delayed_ref(struct btrfs_root *root, · 10 unmodified lines
31673172 mutex_lock(&head->mutex);
31683173 mutex_unlock(&head->mutex);
31693174 btrfs_put_delayed_ref_head(head);
3175+ btrfs_put_transaction(cur_trans);
31703176 return -EAGAIN;
31713177 }
31723178 spin_unlock(&delayed_refs->lock);
@@ -3199,6 +3205,7 @@ static noinline int check_delayed_ref(struct btrfs_root *root, · 26 unmodified lines
31993205 }
32003206 spin_unlock(&head->lock);
32013207 mutex_unlock(&head->mutex);
3208+ btrfs_put_transaction(cur_trans);
32023209 return ret;
32033210 }
32043211
fs/btrfs/relocation.c+1−1
@@ -1841,7 +1841,7 @@ again: · 1840 unmodified lines
18411841 old_bytenr = btrfs_node_blockptr(parent, slot);
18421842 blocksize = fs_info->nodesize;
18431843 old_ptr_gen = btrfs_node_ptr_generation(parent, slot);
1844− btrfs_node_key_to_cpu(parent, &key, slot);
1844+ btrfs_node_key_to_cpu(parent, &first_key, slot);
18451845
18461846 if (level <= max_level) {
18471847 eb = path->nodes[level];
fs/btrfs/send.c+4−0
@@ -5236,6 +5236,10 @@ static int send_write_or_clone(struct send_ctx *sctx, · 5235 unmodified lines
52365236 len = btrfs_file_extent_num_bytes(path->nodes[0], ei);
52375237 }
52385238
5239+ if (offset >= sctx->cur_inode_size) {
5240+ ret = 0;
5241+ goto out;
5242+ }
52395243 if (offset + len > sctx->cur_inode_size)
52405244 len = sctx->cur_inode_size - offset;
52415245 if (len == 0) {

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t