Merge branch 'cleanups_and_fixes' into inode_numbers
authorChris Mason <chris.mason@oracle.com>
Mon, 23 May 2011 18:37:47 +0000 (14:37 -0400)
committerChris Mason <chris.mason@oracle.com>
Mon, 23 May 2011 18:37:47 +0000 (14:37 -0400)
Conflicts:
fs/btrfs/tree-log.c
fs/btrfs/volumes.c

Signed-off-by: Chris Mason <chris.mason@oracle.com>
14 files changed:
1  2 
fs/btrfs/ctree.c
fs/btrfs/ctree.h
fs/btrfs/dir-item.c
fs/btrfs/disk-io.c
fs/btrfs/extent-tree.c
fs/btrfs/extent_io.c
fs/btrfs/file-item.c
fs/btrfs/inode.c
fs/btrfs/ioctl.c
fs/btrfs/root-tree.c
fs/btrfs/super.c
fs/btrfs/tree-log.c
fs/btrfs/volumes.c
fs/btrfs/volumes.h

Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
index b437cc790bfb8e4f5e534ff7a3a0a2179cd67f63,fb9b02667e75116a7b07622dd7749576c8fbc8a6..90d4ee52cd458ac9f7bf87dfe4a34c99be27bc30
@@@ -638,11 -630,12 +637,12 @@@ int btrfs_del_csums(struct btrfs_trans_
                        if (key.offset < bytenr)
                                break;
                }
 -              btrfs_release_path(root, path);
 +              btrfs_release_path(path);
        }
+       ret = 0;
  out:
        btrfs_free_path(path);
-       return 0;
+       return ret;
  }
  
  int btrfs_csum_file_blocks(struct btrfs_trans_handle *trans,
Simple merge
Simple merge
Simple merge
Simple merge
index 0f5537e60bb46501bff4ca9c717b29ee2c8fcce6,c2d88756640018858964674b71b3c155977cc2a2..592396c6dc47465bccf4422d6259d0dfe2885e0c
@@@ -675,10 -675,13 +675,13 @@@ static noinline int drop_one_dir_item(s
                return -ENOMEM;
  
        read_extent_buffer(leaf, name, (unsigned long)(di + 1), name_len);
 -      btrfs_release_path(root, path);
 +      btrfs_release_path(path);
  
        inode = read_one_inode(root, location.objectid);
-       BUG_ON(!inode);
+       if (!inode) {
+               kfree(name);
+               return -EIO;
+       }
  
        ret = link_to_fixup_dir(trans, root, path, location.objectid);
        BUG_ON(ret);
@@@ -1051,11 -1056,13 +1057,13 @@@ static noinline int fixup_inode_link_co
                        break;
  
                ret = btrfs_del_item(trans, root, path);
-               BUG_ON(ret);
+               if (ret)
+                       goto out;
  
 -              btrfs_release_path(root, path);
 +              btrfs_release_path(path);
                inode = read_one_inode(root, key.offset);
-               BUG_ON(!inode);
+               if (!inode)
+                       return -EIO;
  
                ret = fixup_inode_link_count(trans, root, inode);
                BUG_ON(ret);
                 */
                key.offset = (u64)-1;
        }
 -      btrfs_release_path(root, path);
+       ret = 0;
+ out:
-       return 0;
 +      btrfs_release_path(path);
+       return ret;
  }
  
  
@@@ -1427,12 -1438,15 +1439,15 @@@ again
                                                     dir_key->offset,
                                                     name, name_len, 0);
                }
 -              if (!log_di || IS_ERR(log_di)) {
 +              if (IS_ERR_OR_NULL(log_di)) {
                        btrfs_dir_item_key_to_cpu(eb, di, &location);
 -                      btrfs_release_path(root, path);
 -                      btrfs_release_path(log, log_path);
 +                      btrfs_release_path(path);
 +                      btrfs_release_path(log_path);
                        inode = read_one_inode(root, location.objectid);
-                       BUG_ON(!inode);
+                       if (!inode) {
+                               kfree(name);
+                               return -EIO;
+                       }
  
                        ret = link_to_fixup_dir(trans, root,
                                                path, location.objectid);
@@@ -2589,10 -2602,11 +2604,11 @@@ static int drop_objectid_items(struct b
                        break;
  
                ret = btrfs_del_item(trans, log, path);
-               BUG_ON(ret);
+               if (ret)
+                       break;
 -              btrfs_release_path(log, path);
 +              btrfs_release_path(path);
        }
 -      btrfs_release_path(log, path);
 +      btrfs_release_path(path);
        return ret;
  }
  
Simple merge
index 7c58a7b2d99f0b64407903ecac7665682a5e8b71,f1b2e4f53fc246ebac370119e6187587e2896a8a..7c12d61ae7aed7936d07886d8abfb4a8028dea4b
@@@ -85,10 -85,9 +85,12 @@@ struct btrfs_device 
        /* physical drive uuid (or lvm uuid) */
        u8 uuid[BTRFS_UUID_SIZE];
  
 +      /* per-device scrub information */
 +      struct scrub_dev *scrub_device;
 +
        struct btrfs_work work;
+       struct rcu_head rcu;
+       struct work_struct rcu_work;
  };
  
  struct btrfs_fs_devices {