diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2008-12-30 08:03:31 +0100 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2009-01-01 00:07:44 +0100 |
commit | 6b38e842bb832a3dbeb17e382404aef3c40ac5f9 (patch) | |
tree | c36830341781bf49ded16a0d5432647979a74ad8 /fs/ext4/ialloc.c | |
parent | nfsd race fixes: ext3 (diff) | |
download | linux-6b38e842bb832a3dbeb17e382404aef3c40ac5f9.tar.xz linux-6b38e842bb832a3dbeb17e382404aef3c40ac5f9.zip |
nfsd race fixes: ext4
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/ext4/ialloc.c')
-rw-r--r-- | fs/ext4/ialloc.c | 6 |
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: ext4_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); @@ -881,6 +884,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); |