Skip to contentSkip to conversation

UML - Hostfs failed mount handling

PATCH In review Jeff Dike 1 participant 1 message May 1, 2005 User-mode Linux (UML)

lore
Share & tools
lore

Jeff Dike

author
#0 lore raw

PATCH 15/22 UML - Hostfs failed mount handling

This cleans up the error handling and fixes a crash if a hostfs mount fails.

fs/hostfs/hostfs_kern.c +7 -3
Index: linux-2.6.11/fs/hostfs/hostfs_kern.c
===================================================================
@@ -991,13 +991,17 @@
 		goto out_put;
 
 	err = read_inode(root_inode);
-	if(err)
-		goto out_put;
+	if(err){
+                /* No iput in this case because the dput does that for us */
+                dput(sb->s_root);
+                sb->s_root = NULL;
+		goto out_free;
+        }
 
 	return(0);
 
  out_put:
-	iput(root_inode);
+        iput(root_inode);
  out_free:
 	kfree(name);
  out: