On Sun, Dec 17, 2006 at 06:59:37PM -0800, Junhan Zhang (junhan) wrote: > I have a compact flash with 2 partitions /dev/hda1 and /dev/hda2. > I tried to open("/dev/hda2", O_RDWR, 0644); which is from user space. > It is fine to write/read. However, after I moved to kernel module, I > always got return 0 for read/write. My source code is below. Could > you help me figure out the problem? Thanks. Please read the FAQ: http://kernelnewbies.org/FAQ/WhyWritingFilesFromKernelIsBad Erik -- They're all fools. Don't worry. Darwin may be slow, but he'll eventually get them. -- Matthew Lammers in alt.sysadmin.recovery -- Kernelnewbies: Help each other learn about the Linux kernel. Archive: http://mail.nl.linux.org/kernelnewbies/ FAQ: http://kernelnewbies.org/faq/