Fix failure paths in ext3_new_inode() and clean up duplicated code: - DQUOT_DROP() is now called in ext3_init_security() failure path. Signed-off-by: Chris Sykes <[email protected]> diff --git a/fs/ext3/ialloc.c b/fs/ext3/ialloc.c --- a/fs/ext3/ialloc.c +++ b/fs/ext3/ialloc.c @@ -597,27 +597,22 @@ got: ret = inode; if(DQUOT_ALLOC_INODE(inode)) { - DQUOT_DROP(inode); err = -EDQUOT; - goto fail2; + goto fail_drop; } + err = ext3_init_acl(handle, inode, dir); - if (err) { - DQUOT_FREE_INODE(inode); - DQUOT_DROP(inode); - goto fail2; - } + if (err) + goto fail_free_drop; + err = ext3_init_security(handle,inode, dir); - if (err) { - DQUOT_FREE_INODE(inode); - goto fail2; - } + if (err) + goto fail_free_drop; + err = ext3_mark_inode_dirty(handle, inode); if (err) { ext3_std_error(sb, err); - DQUOT_FREE_INODE(inode); - DQUOT_DROP(inode); - goto fail2; + goto fail_free_drop; } ext3_debug("allocating inode %lu\n", inode->i_ino); @@ -631,7 +626,11 @@ really_out: brelse(bitmap_bh); return ret; -fail2: +fail_free_drop: + DQUOT_FREE_INODE(inode); + +fail_drop: + DQUOT_DROP(inode); inode->i_flags |= S_NOQUOTA; inode->i_nlink = 0; iput(inode); -- (o- Chris Sykes //\ "Don't worry. Everything is getting nicely out of control ..." V_/_ Douglas Adams - The Salmon of Doubt GPG Fingerprint: 5E8E D17F F96C CC08 911D CAF2 9049 70D8 5143 8090
Attachment:
signature.asc
Description: Digital signature
- References:
- Hang during rm on ext2 mounted sync (2.6.14-rc2+)
- From: Chris Sykes <[email protected]>
- Re: Hang during rm on ext2 mounted sync (2.6.14-rc2+)
- From: Andrew Morton <[email protected]>
- Re: Hang during rm on ext2 mounted sync (2.6.14-rc2+)
- From: Chris Sykes <[email protected]>
- Re: Hang during rm on ext2 mounted sync (2.6.14-rc2+)
- From: Chris Sykes <[email protected]>
- Re: Hang during rm on ext2 mounted sync (2.6.14-rc2+)
- From: Andrew Morton <[email protected]>
- Re: Hang during rm on ext2 mounted sync (2.6.14-rc2+)
- From: Chris Sykes <[email protected]>
- Re: Hang during rm on ext2 mounted sync (2.6.14-rc2+)
- From: Chris Sykes <[email protected]>
- Hang during rm on ext2 mounted sync (2.6.14-rc2+)
- Prev by Date: [PATCH][Fix] Prevent swsusp from corrupting page translation tables during resume on x86-64
- Next by Date: Problem: Kernel bug at mm/slab.c:2839
- Previous by thread: [PATCH]: Fix ext2_new_inode() failure paths
- Next by thread: Re: Hang during rm on ext2 mounted sync (2.6.14-rc2+)
- Index(es):