Re: Module Compatibility

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 





On 2/16/06, Goldwyn Rodrigues <rgoldwyn@xxxxxxxxx> wrote:
>     i am developing a module related to filesystem. My problem is this works
> on my machine, but its not working on another machine with different
> hardaware configuration.
>
> Module Details:
> in the module i used get_sb_nodev(), to get a super block, and using it i
> traversed through list of super blocks and terminated the loop when i got
> required super block(vfat). So it prints list of super blocks until required
> and then terminates. This code is implemented without using list_head.
>

I checked your code.

I think you cannot use the list_head pointers directly as a
super_block pointer. You should use something like
list_entry()/container_of() to convert the list_head pointer to the
my_sb super_block pointer.
Or better still, stick to list_for_each() and list_entry().

That is why you got the null pointer exception. why it is working on
the other machines, I cannot say.


--
Goldwyn

--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           http://kernelnewbies.org/faq/

 
I tried accessing superblock list using list functions such as list_for_each() & list_entry(); The code works on first pc having 2.6.8-24-smp as a kernel source. But didn't work at 2.6.8-24 kernel. Both systems use SUSE 9.2. Same code gives same error on FEDORA CORE 3 with kernel 2.6.9-1.667. Can anyone tell why it's returning a null pointer while accesing list? 
 

[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux