[LTP] [PATCH v1] madvise11.c:Check loadable module before rmmod

Cyril Hrubis chrubis@suse.cz
Mon Mar 13 09:55:12 CET 2023


Hi!
> > The code already has if (!find_in_file("/proc/modules", HW_MODULE)), you
> > are reinventing the wheel.
> There is an issue happen during our test, the fail happen with following failed msg.
> rmmod: ERROR: Module hwpoison_inject is builtin.
> madvise11.c:356: TWARN: rmmod failed (1)
> 
> So i think before rmmod we should check this module can be rmmod or not.
> And every modules which can show in lsmod output, it means the module can be unload.
> I am not sure the output of /proc/modules contain ONLY loadable module, it maybe
> also can contain the buildin module so this function created.

The lsmod command reads the /proc/modules, that's where it gets the list
of loaded modules.

-- 
Cyril Hrubis
chrubis@suse.cz


More information about the ltp mailing list