Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge branch 'btrfs' of git://git.kernel.dk/linux-2.6-block

* 'btrfs' of git://git.kernel.dk/linux-2.6-block:
btrfs: fix inode rbtree corruption

+14 -7
+14 -7
fs/btrfs/inode.c
··· 3099 3099 { 3100 3100 struct btrfs_root *root = BTRFS_I(inode)->root; 3101 3101 struct btrfs_inode *entry; 3102 - struct rb_node **p = &root->inode_tree.rb_node; 3103 - struct rb_node *parent = NULL; 3102 + struct rb_node **p; 3103 + struct rb_node *parent; 3104 + 3105 + again: 3106 + p = &root->inode_tree.rb_node; 3107 + parent = NULL; 3104 3108 3105 3109 spin_lock(&root->inode_lock); 3106 3110 while (*p) { ··· 3112 3108 entry = rb_entry(parent, struct btrfs_inode, rb_node); 3113 3109 3114 3110 if (inode->i_ino < entry->vfs_inode.i_ino) 3115 - p = &(*p)->rb_left; 3111 + p = &parent->rb_left; 3116 3112 else if (inode->i_ino > entry->vfs_inode.i_ino) 3117 - p = &(*p)->rb_right; 3113 + p = &parent->rb_right; 3118 3114 else { 3119 3115 WARN_ON(!(entry->vfs_inode.i_state & 3120 3116 (I_WILL_FREE | I_FREEING | I_CLEAR))); 3121 - break; 3117 + rb_erase(parent, &root->inode_tree); 3118 + RB_CLEAR_NODE(parent); 3119 + spin_unlock(&root->inode_lock); 3120 + goto again; 3122 3121 } 3123 3122 } 3124 3123 rb_link_node(&BTRFS_I(inode)->rb_node, parent, p); ··· 3133 3126 { 3134 3127 struct btrfs_root *root = BTRFS_I(inode)->root; 3135 3128 3129 + spin_lock(&root->inode_lock); 3136 3130 if (!RB_EMPTY_NODE(&BTRFS_I(inode)->rb_node)) { 3137 - spin_lock(&root->inode_lock); 3138 3131 rb_erase(&BTRFS_I(inode)->rb_node, &root->inode_tree); 3139 - spin_unlock(&root->inode_lock); 3140 3132 RB_CLEAR_NODE(&BTRFS_I(inode)->rb_node); 3141 3133 } 3134 + spin_unlock(&root->inode_lock); 3142 3135 } 3143 3136 3144 3137 static noinline void init_btrfs_i(struct inode *inode)