All of lore.kernel.org
 help / color / mirror / Atom feed
* [Kernel-janitors] [PATCH] linux-2.6.7-rc2/fs/cifs/cifsfs.c
@ 2004-06-06  9:02 MJK
  2004-06-07 16:48 ` Zach Brown
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: MJK @ 2004-06-06  9:02 UTC (permalink / raw)
  To: kernel-janitors

[-- Attachment #1: Type: TEXT/PLAIN, Size: 1703 bytes --]


	Compiles. I thought the error handling could use a little
improvement. :)


--MJK

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

Description  : Audits kernel_thread() and does a cosmetic change to the
way errors are handled.

Signed-off-by: MJK <mkemp@cs.nmsu.edu>

--- old.linux-2.6.7-rc2/fs/cifs/cifsfs.c	2004-06-02 02:58:58.000000000 -0600
+++ new.linux-2.6.7-rc2/fs/cifs/cifsfs.c	2004-06-06 02:32:27.494962953 -0600
@@ -761,25 +761,51 @@

 	rc = cifs_init_inodecache();
 	if (!rc) {
-		rc = cifs_init_mids();
-		if (!rc) {
-			rc = cifs_init_request_bufs();
-			if (!rc) {
-				rc = register_filesystem(&cifs_fs_type);
-				if (!rc) {
-					kernel_thread(cifs_oplock_thread, NULL,
-						CLONE_FS | CLONE_FILES | CLONE_VM);
-					return rc; /* Success */
-				} else
-					cifs_destroy_request_bufs();
-			}
-			cifs_destroy_mids();
-		}
-		cifs_destroy_inodecache();
+		printk(KERN_ERR "cifs_init_inodecache: error initilizing.\n");
+		goto error_init;
 	}
+
+	rc = cifs_init_mids();
+	if (!rc) {
+		goto error_init_mids;
+	}
+
+	rc = cifs_init_request_bufs();
+	if (!rc) {
+		goto error_request;
+	}
+
+	rc = register_filesystem(&cifs_fs_type);
+	if (!rc) {
+		printk(KERN_ERR "Couldn't register cifs.\n");
+		goto error_reg_fs;
+	}
+
+	rc = kernel_thread(cifs_oplock_thread, NULL, CLONE_FS | CLONE_FILES | CLONE_VM);
+	if (!rc) {
+		printk(KERN_ERR "Couldn't spawn cifs thread.\n");
+		goto error_kt;
+	}
+
+	return rc;
+
+error_kt:
+
+error_reg_fs:
+	cifs_destroy_request_bufs();
+
+error_request:
+	cifs_destroy_mids();
+
+error_init_mids:
+	cifs_destroy_inodecache();
+
+error_init:
+
 #ifdef CONFIG_PROC_FS
 	cifs_proc_clean();
 #endif
+
 	return rc;
 }


[-- Attachment #2: Type: text/plain, Size: 167 bytes --]

_______________________________________________
Kernel-janitors mailing list
Kernel-janitors@lists.osdl.org
http://lists.osdl.org/mailman/listinfo/kernel-janitors

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2004-06-08 15:49 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-06-06  9:02 [Kernel-janitors] [PATCH] linux-2.6.7-rc2/fs/cifs/cifsfs.c MJK
2004-06-07 16:48 ` Zach Brown
2004-06-08  7:38 ` MJK
2004-06-08 15:49 ` [Kernel-janitors] [PATCH] linux-2.6.7-rc2/fs/cifs/cifsf Zach Brown

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.