Skip to contentSkip to conversation

New: ext4_fill_super() reports success even if ext4_mb_init() fails

Bug 48431 New [email protected] 1 participant 4 messages Oct 5, 2012 – Jan 2, 2013

lore
Share & tools
lore
#0 lore raw

https://bugzilla.kernel.org/show_bug.cgi?id=48431

Summary: ext4_fill_super() reports success even if
ext4_mb_init() fails
Product: File System
Version: 2.5
Kernel Version: 3.6
Platform: All
OS/Version: Linux
Tree: Mainline
Status: NEW
Severity: normal
Priority: P1
Component: ext4
AssignedTo: [email protected]
ReportedBy: [email protected]
Regression: No

Created an attachment (id=82361)
--> (https://bugzilla.kernel.org/attachment.cgi?id=82361)
The patch to fix the problem

If ext4_mb_init() called from ext4_fill_super() (fs/ext4/super.c:3980 in the current ext4 git tree) fails and returns error code, ext4_fill_super() still returns 0.

This happens because the return value of ext4_mb_init() is not assigned to 'ret' in the error path. So the previous value of 'ret' (0) is returned from ext4_fill_super().

This problem leads to a kernel oops in mount_fs() when the latter tries to access the struct dentry that the mount() callback returns ("sb = root->d_sb;" in fs/super.c:1180).

The problem has been revealed with the help of the fault simulation facilities provided by KEDR Framework.

Attached is a trivial patch that fixes the problem.

Signature · 3 lines
Configure bugmail: https://bugzilla.kernel.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are watching the assignee of the bug.
#1 lore raw

PATCH 1/1 ext4_fill_super() reports success even if ext4_mb_init() fails

https://bugzilla.kernel.org/show_bug.cgi?id=48431

Alan <[email protected]> changed:

What |Removed |Added
----------------------------------------------------------------------------

                 CC|                            |[email protected]
            Summary|ext4_fill_super() reports   |[PATCH]ext4_fill_super()
                   |success even if             |reports success even if
                   |ext4_mb_init() fails        |ext4_mb_init() fails

--- Comment #1 from Alan <[email protected]> 2012-10-05 14:15:59 --- Patches should be sent with a Signed-off-by: line to the relevant list (See Documentation/SubmittingPatches)

In this case [email protected]

You don't need to be subscribed to submit to it.

Signature · 3 lines
Configure bugmail: https://bugzilla.kernel.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are watching the assignee of the bug.
#2 lore raw

PATCH 1/1 ext4_fill_super() reports success even if ext4_mb_init() fails

In reply to [email protected]

https://bugzilla.kernel.org/show_bug.cgi?id=48431

Florian Mickler <[email protected]> changed:

What |Removed |Added
----------------------------------------------------------------------------
CC| |[email protected]

--- Comment #2 from Florian Mickler <[email protected]> 2012-12-22 09:29:55 --- A patch referencing this bug report has been merged in Linux v3.8-rc1:

commit 07aa2ea13814ea60d12f7330b6d5ccfdb0c3ba4d

Author: Lukas Czerner <[email protected]>
Date:   Thu Nov 8 15:16:54 2012 -0500

ext4: fix error handling in ext4_fill_super()

Signature · 3 lines
Configure bugmail: https://bugzilla.kernel.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are watching the assignee of the bug.
#3 lore raw

PATCH 1/1 ext4_fill_super() reports success even if ext4_mb_init() fails

In reply to [email protected]

https://bugzilla.kernel.org/show_bug.cgi?id=48431

Alan <[email protected]> changed:

What |Removed |Added
----------------------------------------------------------------------------

             Status|NEW                         |RESOLVED
         Resolution|                            |CODE_FIX
Signature · 3 lines
Configure bugmail: https://bugzilla.kernel.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are watching the assignee of the bug.