]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mason/linux...
authorLinus Torvalds <torvalds@linux-foundation.org>
Sat, 12 Oct 2013 19:54:24 +0000 (12:54 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Sat, 12 Oct 2013 19:54:24 +0000 (12:54 -0700)
Pull btrfs fixes from Chris Mason:
 "We've got more bug fixes in my for-linus branch:

  One of these fixes another corner of the compression oops from last
  time.  Miao nailed down some problems with concurrent snapshot
  deletion and drive balancing.

  I kept out one of his patches for more testing, but these are all
  stable"

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mason/linux-btrfs:
  Btrfs: fix oops caused by the space balance and dead roots
  Btrfs: insert orphan roots into fs radix tree
  Btrfs: limit delalloc pages outside of find_delalloc_range
  Btrfs: use right root when checking for hash collision

1  2 
fs/btrfs/extent_io.c
fs/btrfs/inode.c

diff --combined fs/btrfs/extent_io.c
index 22bda32acb893a09aa0a0472d8ab78c20c12fbdb,d8ea0cb200b478faa2965658fb8dd3804d912f16..51731b76900de55e8350d5795feacc61a9050d02
@@@ -145,16 -145,8 +145,16 @@@ int __init extent_io_init(void
                                     offsetof(struct btrfs_io_bio, bio));
        if (!btrfs_bioset)
                goto free_buffer_cache;
 +
 +      if (bioset_integrity_create(btrfs_bioset, BIO_POOL_SIZE))
 +              goto free_bioset;
 +
        return 0;
  
 +free_bioset:
 +      bioset_free(btrfs_bioset);
 +      btrfs_bioset = NULL;
 +
  free_buffer_cache:
        kmem_cache_destroy(extent_buffer_cache);
        extent_buffer_cache = NULL;
@@@ -1490,10 -1482,8 +1490,8 @@@ static noinline u64 find_delalloc_range
                cur_start = state->end + 1;
                node = rb_next(node);
                total_bytes += state->end - state->start + 1;
-               if (total_bytes >= max_bytes) {
-                       *end = *start + max_bytes - 1;
+               if (total_bytes >= max_bytes)
                        break;
-               }
                if (!node)
                        break;
        }
@@@ -1635,10 -1625,9 +1633,9 @@@ again
  
        /*
         * make sure to limit the number of pages we try to lock down
-        * if we're looping.
         */
-       if (delalloc_end + 1 - delalloc_start > max_bytes && loops)
-               delalloc_end = delalloc_start + PAGE_CACHE_SIZE - 1;
+       if (delalloc_end + 1 - delalloc_start > max_bytes)
+               delalloc_end = delalloc_start + max_bytes - 1;
  
        /* step two, lock all the pages after the page that has start */
        ret = lock_delalloc_pages(inode, locked_page,
                 */
                free_extent_state(cached_state);
                if (!loops) {
-                       unsigned long offset = (*start) & (PAGE_CACHE_SIZE - 1);
-                       max_bytes = PAGE_CACHE_SIZE - offset;
+                       max_bytes = PAGE_CACHE_SIZE;
                        loops = 1;
                        goto again;
                } else {
diff --combined fs/btrfs/inode.c
index 22ebc13b6c992a0755513253e17f9dd7f20b9706,3b4ffaf0cd5204660bd07b864e6ec8341871bdc2..b0ef7b07b1b3be510e85dd1bab6711e7d27cebee
@@@ -3106,7 -3106,7 +3106,7 @@@ int btrfs_orphan_cleanup(struct btrfs_r
                found_key.type = BTRFS_INODE_ITEM_KEY;
                found_key.offset = 0;
                inode = btrfs_iget(root->fs_info->sb, &found_key, root, NULL);
 -              ret = PTR_RET(inode);
 +              ret = PTR_ERR_OR_ZERO(inode);
                if (ret && ret != -ESTALE)
                        goto out;
  
@@@ -4349,7 -4349,7 +4349,7 @@@ static int btrfs_setsize(struct inode *
                inode->i_ctime = inode->i_mtime = current_fs_time(inode->i_sb);
  
        if (newsize > oldsize) {
 -              truncate_pagecache(inode, oldsize, newsize);
 +              truncate_pagecache(inode, newsize);
                ret = btrfs_cont_expand(inode, oldsize, newsize);
                if (ret)
                        return ret;
@@@ -7986,7 -7986,7 +7986,7 @@@ static int btrfs_rename(struct inode *o
  
  
        /* check for collisions, even if the  name isn't there */
-       ret = btrfs_check_dir_item_collision(root, new_dir->i_ino,
+       ret = btrfs_check_dir_item_collision(dest, new_dir->i_ino,
                             new_dentry->d_name.name,
                             new_dentry->d_name.len);