linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ext4: Fix missing iput for root inode in case of all failed mount paths.
@ 2011-01-16  7:30 Manish Katiyar
  2011-01-16 16:20 ` Andreas Dilger
  0 siblings, 1 reply; 11+ messages in thread
From: Manish Katiyar @ 2011-01-16  7:30 UTC (permalink / raw)
  To: Theodore Ts'o, ext4; +Cc: mkatiyar

Fix missing iput for root inode in case of all failed mount paths.
Fixes bug#26752

Signed-off-by: Manish Katiyar <mkatiyar@gmail.com>

---
 fs/ext4/super.c |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/fs/ext4/super.c b/fs/ext4/super.c
index cb10a06..9570fcc 100644
--- a/fs/ext4/super.c
+++ b/fs/ext4/super.c
@@ -3587,6 +3587,7 @@ no_journal:
        if (err) {
                ext4_msg(sb, KERN_ERR, "failed to initialize system "
                         "zone (%d)", err);
+               iput(root);
                goto failed_mount4;
        }

@@ -3595,12 +3596,15 @@ no_journal:
        if (err) {
                ext4_msg(sb, KERN_ERR, "failed to initialize mballoc (%d)",
                         err);
+               iput(root);
                goto failed_mount4;
        }

        err = ext4_register_li_request(sb, first_not_zeroed);
-       if (err)
+       if (err) {
+               iput(root);
                goto failed_mount4;
+       }

        sbi->s_kobj.kset = ext4_kset;
        init_completion(&sbi->s_kobj_unregister);
@@ -3609,6 +3613,7 @@ no_journal:
        if (err) {
                ext4_mb_release(sb);
                ext4_ext_release(sb);
+               iput(root);
                goto failed_mount4;
        };

@@ -3648,6 +3653,7 @@ cantfind_ext4:
        goto failed_mount;

 failed_mount4:
+       sb->s_root = NULL;
        ext4_msg(sb, KERN_ERR, "mount failed");
        destroy_workqueue(EXT4_SB(sb)->dio_unwritten_wq);
 failed_mount_wq:
-- 
1.7.1


-- 
Thanks -
Manish
==================================
[$\*.^ -- I miss being one of them
==================================

^ permalink raw reply related	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2011-07-10 19:12 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-01-16  7:30 [PATCH] ext4: Fix missing iput for root inode in case of all failed mount paths Manish Katiyar
2011-01-16 16:20 ` Andreas Dilger
2011-01-16 18:05   ` Manish Katiyar
2011-01-30  5:40     ` Manish Katiyar
2011-02-07 23:23       ` Ted Ts'o
2011-02-07 23:31         ` Manish Katiyar
2011-02-26 21:35           ` Manish Katiyar
2011-02-28  1:45             ` Ted Ts'o
2011-02-28  4:19               ` Manish Katiyar
2011-07-06 22:54     ` Andreas Dilger
2011-07-10 19:11       ` Manish Katiyar

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).