Re: Module Compatibility

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

 



>     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/



[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