diff options
Diffstat (limited to 'fs/ext3/ialloc.c')
-rw-r--r-- | fs/ext3/ialloc.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/fs/ext3/ialloc.c b/fs/ext3/ialloc.c index 490bd0ed7896..8de6c720e510 100644 --- a/fs/ext3/ialloc.c +++ b/fs/ext3/ialloc.c | |||
@@ -559,12 +559,8 @@ got: | |||
559 | ei->i_dir_start_lookup = 0; | 559 | ei->i_dir_start_lookup = 0; |
560 | ei->i_disksize = 0; | 560 | ei->i_disksize = 0; |
561 | 561 | ||
562 | ei->i_flags = EXT3_I(dir)->i_flags & ~EXT3_INDEX_FL; | 562 | ei->i_flags = |
563 | if (S_ISLNK(mode)) | 563 | ext3_mask_flags(mode, EXT3_I(dir)->i_flags & EXT3_FL_INHERITED); |
564 | ei->i_flags &= ~(EXT3_IMMUTABLE_FL|EXT3_APPEND_FL); | ||
565 | /* dirsync only applies to directories */ | ||
566 | if (!S_ISDIR(mode)) | ||
567 | ei->i_flags &= ~EXT3_DIRSYNC_FL; | ||
568 | #ifdef EXT3_FRAGMENTS | 564 | #ifdef EXT3_FRAGMENTS |
569 | ei->i_faddr = 0; | 565 | ei->i_faddr = 0; |
570 | ei->i_frag_no = 0; | 566 | ei->i_frag_no = 0; |
@@ -579,7 +575,10 @@ got: | |||
579 | ext3_set_inode_flags(inode); | 575 | ext3_set_inode_flags(inode); |
580 | if (IS_DIRSYNC(inode)) | 576 | if (IS_DIRSYNC(inode)) |
581 | handle->h_sync = 1; | 577 | handle->h_sync = 1; |
582 | insert_inode_hash(inode); | 578 | if (insert_inode_locked(inode) < 0) { |
579 | err = -EINVAL; | ||
580 | goto fail_drop; | ||
581 | } | ||
583 | spin_lock(&sbi->s_next_gen_lock); | 582 | spin_lock(&sbi->s_next_gen_lock); |
584 | inode->i_generation = sbi->s_next_generation++; | 583 | inode->i_generation = sbi->s_next_generation++; |
585 | spin_unlock(&sbi->s_next_gen_lock); | 584 | spin_unlock(&sbi->s_next_gen_lock); |
@@ -627,6 +626,7 @@ fail_drop: | |||
627 | DQUOT_DROP(inode); | 626 | DQUOT_DROP(inode); |
628 | inode->i_flags |= S_NOQUOTA; | 627 | inode->i_flags |= S_NOQUOTA; |
629 | inode->i_nlink = 0; | 628 | inode->i_nlink = 0; |
629 | unlock_new_inode(inode); | ||
630 | iput(inode); | 630 | iput(inode); |
631 | brelse(bitmap_bh); | 631 | brelse(bitmap_bh); |
632 | return ERR_PTR(err); | 632 | return ERR_PTR(err); |