From 43a492884e469dd7ff11466ad2f675bbfaf7d3ae Mon Sep 17 00:00:00 2001 From: Andrew Morton Date: Wed, 2 Jun 2004 18:04:25 -0700 Subject: [PATCH] [PATCH] ext3_orphan_del may double-decrement bh->b_count From: Jeff Mahoney Chris Mason and I ran across this one while hunting down another bug. If ext3_mark_iloc_dirty() fails in ext3_orphan_del() on the outer buffer, bh->b_count will be decremented twice. ext3_mark_iloc_dirty() will brelse the buffer, even on error. ext3_orphan_del() is explicity brelse'ing the buffer on error. Prior to calling ext3_mark_iloc_dirty(), this is the correct behavior. Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- fs/ext3/namei.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/fs/ext3/namei.c b/fs/ext3/namei.c index 4da226dd9e654..4e8dae3ca585b 100644 --- a/fs/ext3/namei.c +++ b/fs/ext3/namei.c @@ -1962,8 +1962,6 @@ int ext3_orphan_del(handle_t *handle, struct inode *inode) goto out_brelse; NEXT_ORPHAN(inode) = 0; err = ext3_mark_iloc_dirty(handle, inode, &iloc); - if (err) - goto out_brelse; out_err: ext3_std_error(inode->i_sb, err); -- 2.53.0