Skip to content

Commit 9c1db77

Browse files
committed
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
2 parents 6f2a1c1 + a2aa75e commit 9c1db77

File tree

4 files changed

+9
-8
lines changed

4 files changed

+9
-8
lines changed

fs/btrfs/compression.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1010,6 +1010,8 @@ int btrfs_decompress_buf2page(char *buf, unsigned long buf_start,
10101010
bytes = min(bytes, working_bytes);
10111011
kaddr = kmap_atomic(page_out);
10121012
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);
10131015
kunmap_atomic(kaddr);
10141016
flush_dcache_page(page_out);
10151017

fs/btrfs/extent-tree.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2385,6 +2385,7 @@ static noinline int __btrfs_run_delayed_refs(struct btrfs_trans_handle *trans,
23852385
spin_unlock(&delayed_refs->lock);
23862386
locked_ref = NULL;
23872387
cond_resched();
2388+
count++;
23882389
continue;
23892390
}
23902391

fs/btrfs/ioctl.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4525,7 +4525,7 @@ static int btrfs_ioctl_set_fslabel(struct file *file, void __user *arg)
45254525
spin_lock(&root->fs_info->super_lock);
45264526
strcpy(super_block->label, label);
45274527
spin_unlock(&root->fs_info->super_lock);
4528-
ret = btrfs_end_transaction(trans, root);
4528+
ret = btrfs_commit_transaction(trans, root);
45294529

45304530
out_unlock:
45314531
mnt_drop_write_file(file);
@@ -4668,7 +4668,7 @@ static int btrfs_ioctl_set_features(struct file *file, void __user *arg)
46684668
if (ret)
46694669
return ret;
46704670

4671-
trans = btrfs_start_transaction(root, 1);
4671+
trans = btrfs_start_transaction(root, 0);
46724672
if (IS_ERR(trans))
46734673
return PTR_ERR(trans);
46744674

@@ -4689,7 +4689,7 @@ static int btrfs_ioctl_set_features(struct file *file, void __user *arg)
46894689
btrfs_set_super_incompat_flags(super_block, newflags);
46904690
spin_unlock(&root->fs_info->super_lock);
46914691

4692-
return btrfs_end_transaction(trans, root);
4692+
return btrfs_commit_transaction(trans, root);
46934693
}
46944694

46954695
long btrfs_ioctl(struct file *file, unsigned int

fs/btrfs/send.c

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2774,8 +2774,6 @@ static int add_waiting_dir_move(struct send_ctx *sctx, u64 ino)
27742774
return 0;
27752775
}
27762776

2777-
#ifdef CONFIG_BTRFS_ASSERT
2778-
27792777
static int del_waiting_dir_move(struct send_ctx *sctx, u64 ino)
27802778
{
27812779
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)
27962794
return -ENOENT;
27972795
}
27982796

2799-
#endif
2800-
28012797
static int add_pending_dir_move(struct send_ctx *sctx, u64 parent_ino)
28022798
{
28032799
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)
29022898
}
29032899

29042900
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+
29062904
ret = get_cur_path(sctx, pm->ino, pm->gen, to_path);
29072905
if (ret < 0)
29082906
goto out;

0 commit comments

Comments
 (0)