summaryrefslogtreecommitdiff
path: root/fs/ext3/ialloc.c
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2008-12-30 10:02:50 +0300
committerAl Viro <viro@zeniv.linux.org.uk>2009-01-01 02:07:44 +0300
commitc38012daa7ad902a39a4213ba2b3fe50e81157ea (patch)
tree69dd3bdf2efe82f9bee13eaf729df7bf70e89381 /fs/ext3/ialloc.c
parent41080b5a240113328c607f22b849f653373db0ce (diff)
downloadlinux-c38012daa7ad902a39a4213ba2b3fe50e81157ea.tar.xz
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.c6
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:
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);