mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Eduardo Pereira Habkost <ehabkost@conectiva.com.br>
To: quintela@mandrakesoft.com
Cc: linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org
Subject: [PATCH] Fixes supermount Oopses when mount options are not given
Date: Fri, 1 Feb 2002 15:45:08 -0200	[thread overview]
Message-ID: <20020201174507.GA1860@rayden.distro.conectiva> (raw)

[-- Attachment #1: Type: text/plain, Size: 1586 bytes --]

The following patch fixes two Oopses on supermount.
The first one happens when the dev= option is not given to supermount, iput()
is called after dput(), but iput() is already called by dput().
The other one happens when the fs= option is not given. subfs_mount() doesn't
check if sbi->s_type is NULL.

Regards,

--
Eduardo Pereira Habkost <ehabkost@conectiva.com.br>
http://www.boto.f2s.com
04BE D2EF 5A56 E446 D424  4785 71A4 49EB AC35 9568
----

# ------------------------
diff -urN kernel-2.4.17/linux/fs/supermount/super.c kernel-2.4.17-supermountok/linux/fs/supermount/super.c
--- kernel-2.4.17/linux/fs/supermount/super.c	Fri Feb  1 14:10:39 2002
+++ kernel-2.4.17-supermountok/linux/fs/supermount/super.c	Fri Feb  1 11:56:36 2002
@@ -276,7 +276,7 @@
 	char **type = types_in_order;
 
 
-	if (strcmp(sbi->s_type, "auto"))
+	if (sbi->s_type && strcmp(sbi->s_type, "auto"))
 		return subfs_real_mount2 (sb, sbi->s_type);
 		
 	while (*type && retval) {
diff -urN kernel-2.4.17/linux/fs/supermount/super_operations.c kernel-2.4.17-supermountok/linux/fs/supermount/super_operations.c
--- kernel-2.4.17/linux/fs/supermount/super_operations.c	Fri Feb  1 14:10:39 2002
+++ kernel-2.4.17-supermountok/linux/fs/supermount/super_operations.c	Fri Feb  1 11:56:36 2002
@@ -279,10 +279,12 @@
 	return s;
 fail_parsing:
 	s->s_dev = 0;
-	dput (root);
 fail_allocating_root:
 	supermount_debug ("get root dentry failed");
-	iput (root_inode);
+	if(root)
+		dput (root);
+	else
+		iput (root_inode);
 	free_sbi (sbi);
 fail_no_memory:
 	return NULL;

[-- Attachment #2: Type: application/pgp-signature, Size: 232 bytes --]

             reply	other threads:[~2002-02-01 17:45 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-02-01 17:45 Eduardo Pereira Habkost [this message]
2002-02-01 17:41 ` Juan Quintela

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20020201174507.GA1860@rayden.distro.conectiva \
    --to=ehabkost@conectiva.com.br \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=quintela@mandrakesoft.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome