aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2014-02-09 14:12:26 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2014-02-09 14:12:26 -0500
commit9c1db7798141e2658e4b5bb170128dfdc3270ff4 (patch)
tree1b582ab69b70f0a91f6ec2a5b4d3c0b963822cc1 /fs
parent6f2a1c1e78771a78c1696f5a67e8320e76a8dc0b (diff)
parenta2aa75e18a21b21952dc6daa9bac7c9f4426f81f (diff)
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mason/linux-btrfs
Pull btrfs fixes from Chris Mason: "This is a small collection of fixes" * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mason/linux-btrfs: Btrfs: fix data corruption when reading/updating compressed extents Btrfs: don't loop forever if we can't run because of the tree mod log btrfs: reserve no transaction units in btrfs_ioctl_set_features btrfs: commit transaction after setting label and features Btrfs: fix assert screwup for the pending move stuff
Diffstat (limited to 'fs')
-rw-r--r--fs/btrfs/compression.c2
-rw-r--r--fs/btrfs/extent-tree.c1
-rw-r--r--fs/btrfs/ioctl.c6
-rw-r--r--fs/btrfs/send.c8
4 files changed, 9 insertions, 8 deletions
diff --git a/fs/btrfs/compression.c b/fs/btrfs/compression.c
index e2600cdb6c25..b01fb6c527e3 100644
--- a/fs/btrfs/compression.c
+++ b/fs/btrfs/compression.c
@@ -1010,6 +1010,8 @@ int btrfs_decompress_buf2page(char *buf, unsigned long buf_start,
1010 bytes = min(bytes, working_bytes); 1010 bytes = min(bytes, working_bytes);
1011 kaddr = kmap_atomic(page_out); 1011 kaddr = kmap_atomic(page_out);
1012 memcpy(kaddr + *pg_offset, buf + buf_offset, bytes); 1012 memcpy(kaddr + *pg_offset, buf + buf_offset, bytes);
1013 if (*pg_index == (vcnt - 1) && *pg_offset == 0)
1014 memset(kaddr + bytes, 0, PAGE_CACHE_SIZE - bytes);
1013 kunmap_atomic(kaddr); 1015 kunmap_atomic(kaddr);
1014 flush_dcache_page(page_out); 1016 flush_dcache_page(page_out);
1015 1017
diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c
index 9c9ecc93ae2c..32312e09f0f5 100644
--- a/fs/btrfs/extent-tree.c
+++ b/fs/btrfs/extent-tree.c
@@ -2385,6 +2385,7 @@ static noinline int __btrfs_run_delayed_refs(struct btrfs_trans_handle *trans,
2385 spin_unlock(&delayed_refs->lock); 2385 spin_unlock(&delayed_refs->lock);
2386 locked_ref = NULL; 2386 locked_ref = NULL;
2387 cond_resched(); 2387 cond_resched();
2388 count++;
2388 continue; 2389 continue;
2389 } 2390 }
2390 2391
diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c
index b0134892dc70..383ab455bfa7 100644
--- a/fs/btrfs/ioctl.c
+++ b/fs/btrfs/ioctl.c
@@ -4525,7 +4525,7 @@ static int btrfs_ioctl_set_fslabel(struct file *file, void __user *arg)
4525 spin_lock(&root->fs_info->super_lock); 4525 spin_lock(&root->fs_info->super_lock);
4526 strcpy(super_block->label, label); 4526 strcpy(super_block->label, label);
4527 spin_unlock(&root->fs_info->super_lock); 4527 spin_unlock(&root->fs_info->super_lock);
4528 ret = btrfs_end_transaction(trans, root); 4528 ret = btrfs_commit_transaction(trans, root);
4529 4529
4530out_unlock: 4530out_unlock:
4531 mnt_drop_write_file(file); 4531 mnt_drop_write_file(file);
@@ -4668,7 +4668,7 @@ static int btrfs_ioctl_set_features(struct file *file, void __user *arg)
4668 if (ret) 4668 if (ret)
4669 return ret; 4669 return ret;
4670 4670
4671 trans = btrfs_start_transaction(root, 1); 4671 trans = btrfs_start_transaction(root, 0);
4672 if (IS_ERR(trans)) 4672 if (IS_ERR(trans))
4673 return PTR_ERR(trans); 4673 return PTR_ERR(trans);
4674 4674
@@ -4689,7 +4689,7 @@ static int btrfs_ioctl_set_features(struct file *file, void __user *arg)
4689 btrfs_set_super_incompat_flags(super_block, newflags); 4689 btrfs_set_super_incompat_flags(super_block, newflags);
4690 spin_unlock(&root->fs_info->super_lock); 4690 spin_unlock(&root->fs_info->super_lock);
4691 4691
4692 return btrfs_end_transaction(trans, root); 4692 return btrfs_commit_transaction(trans, root);
4693} 4693}
4694 4694
4695long btrfs_ioctl(struct file *file, unsigned int 4695long btrfs_ioctl(struct file *file, unsigned int
diff --git a/fs/btrfs/send.c b/fs/btrfs/send.c
index cf9107a64204..9c8d1a3fdc3a 100644
--- a/fs/btrfs/send.c
+++ b/fs/btrfs/send.c
@@ -2774,8 +2774,6 @@ static int add_waiting_dir_move(struct send_ctx *sctx, u64 ino)
2774 return 0; 2774 return 0;
2775} 2775}
2776 2776
2777#ifdef CONFIG_BTRFS_ASSERT
2778
2779static int del_waiting_dir_move(struct send_ctx *sctx, u64 ino) 2777static int del_waiting_dir_move(struct send_ctx *sctx, u64 ino)
2780{ 2778{
2781 struct rb_node *n = sctx->waiting_dir_moves.rb_node; 2779 struct rb_node *n = sctx->waiting_dir_moves.rb_node;
@@ -2796,8 +2794,6 @@ static int del_waiting_dir_move(struct send_ctx *sctx, u64 ino)
2796 return -ENOENT; 2794 return -ENOENT;
2797} 2795}
2798 2796
2799#endif
2800
2801static int add_pending_dir_move(struct send_ctx *sctx, u64 parent_ino) 2797static int add_pending_dir_move(struct send_ctx *sctx, u64 parent_ino)
2802{ 2798{
2803 struct rb_node **p = &sctx->pending_dir_moves.rb_node; 2799 struct rb_node **p = &sctx->pending_dir_moves.rb_node;
@@ -2902,7 +2898,9 @@ static int apply_dir_move(struct send_ctx *sctx, struct pending_dir_move *pm)
2902 } 2898 }
2903 2899
2904 sctx->send_progress = sctx->cur_ino + 1; 2900 sctx->send_progress = sctx->cur_ino + 1;
2905 ASSERT(del_waiting_dir_move(sctx, pm->ino) == 0); 2901 ret = del_waiting_dir_move(sctx, pm->ino);
2902 ASSERT(ret == 0);
2903
2906 ret = get_cur_path(sctx, pm->ino, pm->gen, to_path); 2904 ret = get_cur_path(sctx, pm->ino, pm->gen, to_path);
2907 if (ret < 0) 2905 if (ret < 0)
2908 goto out; 2906 goto out;