]> git.hungrycats.org Git - linux/commitdiff
Revert "Btrfs: add missing inode item update in fallocate()"
authorZygo Blaxell <zblaxell@thirteen.furryterror.org>
Mon, 27 Jul 2015 16:23:13 +0000 (12:23 -0400)
committerZygo Blaxell <zblaxell@thirteen.furryterror.org>
Mon, 27 Jul 2015 16:23:13 +0000 (12:23 -0400)
This reverts commit e2bd43b59b269f8dd15358bf9a3c6f5954bf0cbf.

fs/btrfs/file.c

index f3c96d6ac601bfcfb2a584351236d9e5c4628fb3..30982bbd31c30c2b154836b0f51b94c37e22923c 100644 (file)
@@ -2673,34 +2673,23 @@ static long btrfs_fallocate(struct file *file, int mode,
                                                        1 << inode->i_blkbits,
                                                        offset + len,
                                                        &alloc_hint);
+
+                       if (ret < 0) {
+                               free_extent_map(em);
+                               break;
+                       }
                } else if (actual_end > inode->i_size &&
                           !(mode & FALLOC_FL_KEEP_SIZE)) {
-                       struct btrfs_trans_handle *trans;
-
                        /*
                         * We didn't need to allocate any more space, but we
                         * still extended the size of the file so we need to
-                        * update i_size and the inode item.
+                        * update i_size.
                         */
-                       trans = btrfs_start_transaction(root, 1);
-                       if (IS_ERR(trans)) {
-                               ret = PTR_ERR(trans);
-                       } else {
-                               inode->i_ctime = CURRENT_TIME;
-                               i_size_write(inode, actual_end);
-                               btrfs_ordered_update_i_size(inode, actual_end,
-                                                           NULL);
-                               ret = btrfs_update_inode(trans, root, inode);
-                               if (ret)
-                                       btrfs_end_transaction(trans, root);
-                               else
-                                       ret = btrfs_end_transaction(trans,
-                                                                   root);
-                       }
+                       inode->i_ctime = CURRENT_TIME;
+                       i_size_write(inode, actual_end);
+                       btrfs_ordered_update_i_size(inode, actual_end, NULL);
                }
                free_extent_map(em);
-               if (ret < 0)
-                       break;
 
                cur_offset = last_byte;
                if (cur_offset >= alloc_end) {