aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ext4/ialloc.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/ext4/ialloc.c')
-rw-r--r--fs/ext4/ialloc.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/fs/ext4/ialloc.c b/fs/ext4/ialloc.c
index 08cac9fcace2..6e6052879aa2 100644
--- a/fs/ext4/ialloc.c
+++ b/fs/ext4/ialloc.c
@@ -826,7 +826,10 @@ got:
826 ext4_set_inode_flags(inode); 826 ext4_set_inode_flags(inode);
827 if (IS_DIRSYNC(inode)) 827 if (IS_DIRSYNC(inode))
828 handle->h_sync = 1; 828 handle->h_sync = 1;
829 insert_inode_hash(inode); 829 if (insert_inode_locked(inode) < 0) {
830 err = -EINVAL;
831 goto fail_drop;
832 }
830 spin_lock(&sbi->s_next_gen_lock); 833 spin_lock(&sbi->s_next_gen_lock);
831 inode->i_generation = sbi->s_next_generation++; 834 inode->i_generation = sbi->s_next_generation++;
832 spin_unlock(&sbi->s_next_gen_lock); 835 spin_unlock(&sbi->s_next_gen_lock);
@@ -881,6 +884,7 @@ fail_drop:
881 DQUOT_DROP(inode); 884 DQUOT_DROP(inode);
882 inode->i_flags |= S_NOQUOTA; 885 inode->i_flags |= S_NOQUOTA;
883 inode->i_nlink = 0; 886 inode->i_nlink = 0;
887 unlock_new_inode(inode);
884 iput(inode); 888 iput(inode);
885 brelse(bitmap_bh); 889 brelse(bitmap_bh);
886 return ERR_PTR(err); 890 return ERR_PTR(err);