mirror_zfs/lib
Etienne Dechamps f09398cec6 Use /sys/module instead of /proc/modules.
When libzfs checks if the module is loaded or not, it currently reads
/proc/modules and searches for a line matching the module name.

Unfortunately, if the module is included in the kernel itself (built-in
module), then /proc/modules won't list it, so libzfs will wrongly conclude
that the module is not loaded, thus making all ZFS userspace tools unusable.

Fortunately, all loaded modules appear as directories in /sys/module, even
built-in ones. Thus we can use /sys/module in lieu of /proc/modules to fix
the issue.

As a bonus, the code for checking becomes much simpler.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Issue #851
2012-07-26 13:45:33 -07:00
..
libavl Linux 3.5 compat, end_writeback() changed to clear_inode() 2012-07-23 12:29:36 -07:00
libefi Linux 3.5 compat, end_writeback() changed to clear_inode() 2012-07-23 12:29:36 -07:00
libnvpair Linux 3.5 compat, end_writeback() changed to clear_inode() 2012-07-23 12:29:36 -07:00
libshare Linux 3.5 compat, end_writeback() changed to clear_inode() 2012-07-23 12:29:36 -07:00
libspl Linux 3.5 compat, end_writeback() changed to clear_inode() 2012-07-23 12:29:36 -07:00
libunicode Linux 3.5 compat, end_writeback() changed to clear_inode() 2012-07-23 12:29:36 -07:00
libuutil Linux 3.5 compat, end_writeback() changed to clear_inode() 2012-07-23 12:29:36 -07:00
libzfs Use /sys/module instead of /proc/modules. 2012-07-26 13:45:33 -07:00
libzpool Linux 3.5 compat, end_writeback() changed to clear_inode() 2012-07-23 12:29:36 -07:00
Makefile.am Let libnvpair be linked independently of libzfs. 2012-02-07 11:37:15 -08:00
Makefile.in Linux 3.5 compat, end_writeback() changed to clear_inode() 2012-07-23 12:29:36 -07:00