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
Attachment:
mes_log
Description: mes_log
Attachment:
sbd_drv.h
Description: sbd_drv.h
Attachment:
Makefile
Description: Makefile
Attachment:
sbd_drv.c
Description: sbd_drv.c
Attachment:
app.c
Description: app.c