[Ilugc] Simple Block Driver (RAM DISK) - Console Crash (specific case)

  • From: srinivasg@xxxxxxxxxxxxxxxxxxxxx (Srinivas G.)
  • Date: Mon Apr 17 20:55:53 2006

Dear All,

I developed a simple ram disk driver. It is working fine. 

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).

Please find the attached source. I am using the following configuration.
--> x86 system with Fedora Core 3 installed (IA-32 Architecture)
--> 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) You can easily
understand by seeing the code.
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

-------------- next part --------------
A non-text attachment was scrubbed...
Name: mes_log
Type: application/octet-stream
Size: 6429 bytes
Desc: mes_log
Url : 
http://www.ae.iitm.ac.in/pipermail/ilugc/attachments/20060417/bb35d63f/mes_log-0001.obj
-------------- next part --------------
A non-text attachment was scrubbed...
Name: sbd_drv.h
Type: application/octet-stream
Size: 101 bytes
Desc: sbd_drv.h
Url : 
http://www.ae.iitm.ac.in/pipermail/ilugc/attachments/20060417/bb35d63f/sbd_drv-0002.obj
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Makefile
Type: application/octet-stream
Size: 350 bytes
Desc: Makefile
Url : 
http://www.ae.iitm.ac.in/pipermail/ilugc/attachments/20060417/bb35d63f/Makefile-0001.obj
-------------- next part --------------
A non-text attachment was scrubbed...
Name: sbd_drv.c
Type: application/octet-stream
Size: 5351 bytes
Desc: sbd_drv.c
Url : 
http://www.ae.iitm.ac.in/pipermail/ilugc/attachments/20060417/bb35d63f/sbd_drv-0003.obj
-------------- next part --------------
A non-text attachment was scrubbed...
Name: app.c
Type: application/octet-stream
Size: 243 bytes
Desc: app.c
Url : 
http://www.ae.iitm.ac.in/pipermail/ilugc/attachments/20060417/bb35d63f/app-0001.obj

Other related posts: