* [PATCH] Oops on umount/mount (JFFS 1)
@ 2003-03-10 16:00 Orjan Friberg
2003-03-12 14:17 ` Orjan Friberg
0 siblings, 1 reply; 2+ messages in thread
From: Orjan Friberg @ 2003-03-10 16:00 UTC (permalink / raw)
To: linux-mtd
(This message was originally sent to jffs-dev. Apologies for the dupe.)
The patch below takes care of a umount/mount-related oops I had. It happens when a JFFS 1 file
system is mounted for the second time if CONFIG_JFFS_PROC_FS is on, due to jffs_proc_root being
freed on a umount, but only being allocated once (at init). The patch below allocates
jffs_proc_root each time the proc entry is registered. (In my case, besides corrupting a node, the
bug also manifested itself by /proc/fs/jffs not showing up after the second mount.)
Index: inode-v23.c
===================================================================
RCS file: /usr/local/cvs/linux/os/linux/fs/jffs/inode-v23.c,v
retrieving revision 1.15
diff -u -p -r1.15 inode-v23.c
--- inode-v23.c 18 Oct 2001 15:28:09 -0000 1.15
+++ inode-v23.c 9 Mar 2003 17:57:31 -0000
@@ -1742,9 +1742,6 @@ init_jffs_fs(void)
printk(KERN_INFO "JFFS version " JFFS_VERSION_STRING
", (C) 1999, 2000 Axis Communications AB\n");
-#ifdef CONFIG_JFFS_PROC_FS
- jffs_proc_root = proc_mkdir("jffs", proc_root_fs);
-#endif
fm_cache = kmem_cache_create("jffs_fm", sizeof(struct jffs_fm),
0, SLAB_HWCACHE_ALIGN, NULL, NULL);
node_cache = kmem_cache_create("jffs_node",sizeof(struct jffs_node),
Index: jffs_proc.c
===================================================================
RCS file: /usr/local/cvs/linux/os/linux/fs/jffs/jffs_proc.c,v
retrieving revision 1.1.1.1
diff -u -p -r1.1.1.1 jffs_proc.c
--- jffs_proc.c 10 Oct 2001 15:16:00 -0000 1.1.1.1
+++ jffs_proc.c 9 Mar 2003 17:57:31 -0000
@@ -72,6 +72,9 @@ int jffs_register_jffs_proc_dir(kdev_t d
struct proc_dir_entry *part_layout = 0;
struct proc_dir_entry *part_root = 0;
+ /* Needs to be allocated at each register since it's freed on unregister. */
+ jffs_proc_root = proc_mkdir("jffs", proc_root_fs);
+
/* Allocate structure for local JFFS partition table */
if (!(part_dir = (struct jffs_partition_dir *)
kmalloc (sizeof (struct jffs_partition_dir), GFP_KERNEL))) {
--
Orjan Friberg
Axis Communications AB
^ permalink raw reply [flat|nested] 2+ messages in thread* [PATCH] Oops on umount/mount (JFFS 1)
2003-03-10 16:00 [PATCH] Oops on umount/mount (JFFS 1) Orjan Friberg
@ 2003-03-12 14:17 ` Orjan Friberg
0 siblings, 0 replies; 2+ messages in thread
From: Orjan Friberg @ 2003-03-12 14:17 UTC (permalink / raw)
To: linux-mtd
Orjan Friberg wrote:
>
> The patch below takes care of a umount/mount-related oops I had. It happens when a JFFS 1 file
> system is mounted for the second time if CONFIG_JFFS_PROC_FS is on, due to jffs_proc_root being
> freed on a umount, but only being allocated once (at init). The patch below allocates
> jffs_proc_root each time the proc entry is registered. (In my case, besides corrupting a node, the
> bug also manifested itself by /proc/fs/jffs not showing up after the second mount.)
Is this ok to commit?
--
Orjan Friberg
Axis Communications AB
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2003-03-12 14:17 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-03-10 16:00 [PATCH] Oops on umount/mount (JFFS 1) Orjan Friberg
2003-03-12 14:17 ` Orjan Friberg
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox