diff options
author | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2010-02-17 10:00:42 +1100 |
---|---|---|
committer | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2010-02-17 10:00:42 +1100 |
commit | ec144a81ade915b5b38adedf10e84690813ed768 (patch) | |
tree | c94b53c971ab2c39e27433267318b3c7bc86ff1b /fs/btrfs/file.c | |
parent | b919ee827e048826786fd7e889a2b04f63382fe6 (diff) | |
parent | 88626272549b94310975932a9970d11a9b362a16 (diff) | |
download | op-kernel-dev-ec144a81ade915b5b38adedf10e84690813ed768.zip op-kernel-dev-ec144a81ade915b5b38adedf10e84690813ed768.tar.gz |
Merge commit 'origin/master' into next
Diffstat (limited to 'fs/btrfs/file.c')
-rw-r--r-- | fs/btrfs/file.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/fs/btrfs/file.c b/fs/btrfs/file.c index c020335..6ed434a 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, @@ -1133,7 +1135,7 @@ int btrfs_sync_file(struct file *file, struct dentry *dentry, int datasync) } mutex_lock(&dentry->d_inode->i_mutex); out: - return ret > 0 ? EIO : ret; + return ret > 0 ? -EIO : ret; } static const struct vm_operations_struct btrfs_file_vm_ops = { |