diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2008-12-30 02:02:50 -0500 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2008-12-31 18:07:44 -0500 |
commit | c38012daa7ad902a39a4213ba2b3fe50e81157ea (patch) | |
tree | 69dd3bdf2efe82f9bee13eaf729df7bf70e89381 /fs/ext3/ialloc.c | |
parent | 41080b5a240113328c607f22b849f653373db0ce (diff) |
nfsd race fixes: ext3
ext3 analog of the previous patch
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
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); |