diff options
Diffstat (limited to 'fs/ext3/ialloc.c')
-rw-r--r-- | fs/ext3/ialloc.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/fs/ext3/ialloc.c b/fs/ext3/ialloc.c index 490bd0ed7896..5655fbcbd11f 100644 --- a/fs/ext3/ialloc.c +++ b/fs/ext3/ialloc.c | |||
@@ -579,7 +579,10 @@ got: | |||
579 | ext3_set_inode_flags(inode); | 579 | ext3_set_inode_flags(inode); |
580 | if (IS_DIRSYNC(inode)) | 580 | if (IS_DIRSYNC(inode)) |
581 | handle->h_sync = 1; | 581 | handle->h_sync = 1; |
582 | insert_inode_hash(inode); | 582 | if (insert_inode_locked(inode) < 0) { |
583 | err = -EINVAL; | ||
584 | goto fail_drop; | ||
585 | } | ||
583 | spin_lock(&sbi->s_next_gen_lock); | 586 | spin_lock(&sbi->s_next_gen_lock); |
584 | inode->i_generation = sbi->s_next_generation++; | 587 | inode->i_generation = sbi->s_next_generation++; |
585 | spin_unlock(&sbi->s_next_gen_lock); | 588 | spin_unlock(&sbi->s_next_gen_lock); |
@@ -627,6 +630,7 @@ fail_drop: | |||
627 | DQUOT_DROP(inode); | 630 | DQUOT_DROP(inode); |
628 | inode->i_flags |= S_NOQUOTA; | 631 | inode->i_flags |= S_NOQUOTA; |
629 | inode->i_nlink = 0; | 632 | inode->i_nlink = 0; |
633 | unlock_new_inode(inode); | ||
630 | iput(inode); | 634 | iput(inode); |
631 | brelse(bitmap_bh); | 635 | brelse(bitmap_bh); |
632 | return ERR_PTR(err); | 636 | return ERR_PTR(err); |