lkml.org 
[lkml]   [2006]   [Apr]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectSimple Block Driver (RAM DISK) - Console Crash (specific case)
Date
From
Dear All,

I developed a simple ram disk driver. It is working fine.
Please find the sources at the following link.
http://pastebin.com/669338

But I am facing a new problem (console crash) when I try to run the "ls"
command on a mount point after removing the disk with out unmounting
(see the below - How I am removing the ram disk after mount without
unmounting).

I understand that removing a mounted device will lead to inconsistent
data. But, in case of a removable media this may happen. Right?

I am trying to simulate a REMOVABLE MEDIA (FLASH MEDIA) driver
environment. This is an attempt to understand what to handle on surprise
removal of a mounted Flash Media disk.

Please find the attached source. I am using the following configuration.
--> x86 UNI Processor system with Fedora Core 3 installed
--> Running 2.6.x kernels like 2.6.10, 2.6.12 and 2.6.14 on the same
system.

To reproduce the "console crash error" you just have to follow exactly
the next steps:

1) Copy the attached files to your system
2) Build the sbd.ko file using the attached Makefile (make)
3) Load (insert) the module into the kernel space (insmod sbd.ko)
4) wait a few milli seconds to create the device node and format the
device (mke2fs /dev/sbd0)
5) mount the device (mount /dev/sbd0 /mnt)
6) copy some files into the mount point (cp *.c /mnt)
7) un mount the device (umount /mnt OR umount /dev/sbd0)
8) then again, mount the device (mount /dev/sbd0 /mnt)
9) remove the mounted device (compile the app.c file [cc app.c] then run
the ./a.out which will remove the mounted device)
10) cd /mnt
11) run ls (which shows the errors messages - see attachment mes_log
file)
12) run again ls - console crash

SEE THE BELOW TWO CONDITIONS WHERE I AM NOT ABLE TO SEE THE CONSOLE
CRASH.

1) After mounting the FDD, I removed the floppy with out un
mounting (The floppy disk has already some files in it).
2) If I perform the above procedure WITH OUT STEPS 6, 7 and 8.

Could any one explain why the problem occurs?
If I am wrong please correct me.

Thanks in very advance.

Thanks and Regards,
Srinivas G

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2006-04-19 16:53    [W:0.189 / U:0.028 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site