nfsd race fixes: ext3

ext3 analog of the previous patch

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
This commit is contained in:
Al Viro
2008-12-30 02:02:50 -05:00
parent 41080b5a24
commit c38012daa7
2 changed files with 19 additions and 2 deletions

View File

@@ -579,7 +579,10 @@ got:
ext3_set_inode_flags(inode);
if (IS_DIRSYNC(inode))
handle->h_sync = 1;
insert_inode_hash(inode);
if (insert_inode_locked(inode) < 0) {
err = -EINVAL;
goto fail_drop;
}
spin_lock(&sbi->s_next_gen_lock);
inode->i_generation = sbi->s_next_generation++;
spin_unlock(&sbi->s_next_gen_lock);
@@ -627,6 +630,7 @@ fail_drop:
DQUOT_DROP(inode);
inode->i_flags |= S_NOQUOTA;
inode->i_nlink = 0;
unlock_new_inode(inode);
iput(inode);
brelse(bitmap_bh);
return ERR_PTR(err);