Commit bc5de0cd authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] ext3_new_inode fixlet

From: Alex Tomas <alex@clusterfs.com>

If the ext3 inode allocator tries to claim an inode and fails because
another CPU got in there first it will then advance onto the next
blockgroup and try again.

Change it to advance onto the next inode within the same blockgroup
instead.
parent b758ab40
...@@ -469,8 +469,11 @@ struct inode *ext3_new_inode(handle_t *handle, struct inode * dir, int mode) ...@@ -469,8 +469,11 @@ struct inode *ext3_new_inode(handle_t *handle, struct inode * dir, int mode)
if (!bitmap_bh) if (!bitmap_bh)
goto fail; goto fail;
ino = ext3_find_first_zero_bit((unsigned long *) ino = 0;
bitmap_bh->b_data, EXT3_INODES_PER_GROUP(sb));
repeat_in_this_group:
ino = ext3_find_next_zero_bit((unsigned long *)
bitmap_bh->b_data, EXT3_INODES_PER_GROUP(sb), ino);
if (ino < EXT3_INODES_PER_GROUP(sb)) { if (ino < EXT3_INODES_PER_GROUP(sb)) {
int credits = 0; int credits = 0;
...@@ -493,6 +496,9 @@ struct inode *ext3_new_inode(handle_t *handle, struct inode * dir, int mode) ...@@ -493,6 +496,9 @@ struct inode *ext3_new_inode(handle_t *handle, struct inode * dir, int mode)
} }
/* we lost it */ /* we lost it */
journal_release_buffer(handle, bitmap_bh, credits); journal_release_buffer(handle, bitmap_bh, credits);
if (++ino < EXT3_INODES_PER_GROUP(sb))
goto repeat_in_this_group;
} }
/* /*
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment