patch 4 for dazukofs release 3.0.0

Lino Sanfilippo <[email protected]> Tue, 21 Apr 2009 19:01:29 +0200
Newsgroups gmane.linux.dazuko.devel
Message-ID <[email protected]>
Bug description:
The attempt to mount dazukofs over a regular file results in a kernel oops.

The solution is to ensure that the mount point is a directory.
(This is a repost of the patch posted on the 9th Feb. 2009. It is only
posted for the sake of completeness.)




GeschÀftsfÌhrender Gesellschafter: Tjark Auerbach
Sitz der Gesellschaft: Tettnang
Handelsregister: Amtsgericht Ulm, HRB 630992
ALLGEMEINE GESCHÄFTSBEDINGUNGEN
Es gelten unsere Allgemeinen GeschÀftsbedingungen
(AGB). Sie finden sie in der jeweils gÃŒltigen Fassung
im Internet unter http://www.avira.de/agb
***************************************************

_______________________________________________
Dazuko-devel mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/dazuko-devel
patch4 (text/plain, 675 B)
diff -rup dazukofs-3.0.0-p3/super.c dazukofs-3.0.0-p4/super.c
--- dazukofs-3.0.0-p3/super.c	2009-03-15 18:24:16.000000000 +0100
+++ dazukofs-3.0.0-p4/super.c	2009-03-15 19:23:58.000000000 +0100
@@ -171,6 +171,11 @@ static int dazukofs_read_super(struct su
 		goto out_put;
 	}
 
+	if (!S_ISDIR(lower_root->d_inode->i_mode)) {
+		err = -ENOENT;
+		goto out_put;
+	}
+
 	SET_LOWER_SB(sb, lower_root->d_sb);
 	sb->s_maxbytes = lower_root->d_sb->s_maxbytes;
 	SET_LOWER_DENTRY(sb->s_root, lower_root, lower_mnt);
@@ -213,6 +218,7 @@ static int dazukofs_get_sb(struct file_s
 
 out_abort:
 	up_write(&sb->s_umount);
+	dput(sb->s_root);
 	deactivate_super(sb);
 out:
 	return err;