ufs: Fix backtrace seen when mounting a bad ufs file system
PATCH RESEND 1/1 ufs: Fix backtrace seen when mounting a bad ufs file system
If an attempt is made to mount a bad ufs file system, the following backtrace may be seen.
Call Trace: [<ffffffff81443d50>] mutex_lock+0x18/0x70 [<ffffffff8127d6cc>] ufs_sync_fs+0x2c/0x278 [<ffffffff8120d814>] __sync_filesystem+0x74/0xb8 [<ffffffff8120d934>] sync_filesystem+0x4c/0x80 [<ffffffff811e23dc>] generic_shutdown_super+0x34/0x110 [<ffffffff811e24dc>] kill_block_super+0x24/0x80 [<ffffffff811e2644>] deactivate_locked_super+0x6c/0x98 [<ffffffff811e32e0>] mount_bdev+0x218/0x220 [<ffffffff811e295c>] mount_fs+0xe4/0x220 [<ffffffff81201064>] vfs_kern_mount+0x64/0x110 [<ffffffff812014fc>] do_kern_mount+0x4c/0x138 [<ffffffff81202d58>] do_mount+0x440/0x898 [<ffffffff8122c870>] compat_sys_mount+0xd8/0x248
The backtrace occurs if ufs_read_cylinder_structures() reports an error. The calling function ufs_fill_super() tries to clean up, but does not return the error to the calling code. This ultimately causes the backtrace.
Fix problem by returning an error from ufs_fill_super() if ufs_read_cylinder_structures() fails.
Signed-off-by Guenter Roeck <[email protected]>
---
Resend, this time copying the linux-fsdevel list. If I should send it to some other list, please let me know.
fs/ufs/super.c | 6 +++++- 1 files changed, 5 insertions(+), 1 deletions(-)
fs/ufs/super.c +5 -1
@@ -1174,8 +1174,12 @@ magic_found:* Read cylinder group structures */ if (!(sb->s_flags &MS_RDONLY )) -if (!ufs_read_cylinder_structures (sb)) +if (!ufs_read_cylinder_structures (sb)) { +dput (sb->s_root); + sb->s_root =NULL ; + ret = -ENODEV ; goto failed; + }UFSD ("EXIT\n" );return 0 ;
Signature · 1 line
1.7.3.1