diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2010-02-15 19:56:21 -0800 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-02-15 19:56:21 -0800 |
commit | 0813e22d4e0d618eac9b47bec942bf856adca4c5 (patch) | |
tree | 4d2b1a9717e6cdbab7966ce2d0ae698a52d46ae0 /fs/btrfs | |
parent | 382640b3372405c40b7646c68a50ca91358027e4 (diff) | |
parent | 3f6fae9559225741c91f1320090b285da1413290 (diff) | |
download | linux-0813e22d4e0d618eac9b47bec942bf856adca4c5.tar.gz linux-0813e22d4e0d618eac9b47bec942bf856adca4c5.tar.bz2 linux-0813e22d4e0d618eac9b47bec942bf856adca4c5.zip |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/mason/btrfs-unstable
* git://git.kernel.org/pub/scm/linux/kernel/git/mason/btrfs-unstable:
Btrfs: btrfs_mark_extent_written uses the wrong slot
Diffstat (limited to 'fs/btrfs')
-rw-r--r-- | fs/btrfs/file.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/fs/btrfs/file.c b/fs/btrfs/file.c index 9d0809629967..6ed434ac037f 100644 --- a/fs/btrfs/file.c +++ b/fs/btrfs/file.c @@ -720,13 +720,15 @@ again: inode->i_ino, orig_offset); BUG_ON(ret); } - fi = btrfs_item_ptr(leaf, path->slots[0], - struct btrfs_file_extent_item); if (del_nr == 0) { + fi = btrfs_item_ptr(leaf, path->slots[0], + struct btrfs_file_extent_item); btrfs_set_file_extent_type(leaf, fi, BTRFS_FILE_EXTENT_REG); btrfs_mark_buffer_dirty(leaf); } else { + fi = btrfs_item_ptr(leaf, del_slot - 1, + struct btrfs_file_extent_item); btrfs_set_file_extent_type(leaf, fi, BTRFS_FILE_EXTENT_REG); btrfs_set_file_extent_num_bytes(leaf, fi, |