Re: md as module cannot be reloaded.

Re: md as module cannot be reloaded.

am 01.12.2010 22:57:23 von NeilBrown

On Wed, 1 Dec 2010 14:23:14 +0000 "Hawrylewicz Czarnowski, Przemyslaw"
wrote:

> Hi,
>
> I have found an annoying problem with md module. If it is compiled as loadable module it is impossible to reload module if unloaded once.
>
> Eg.
> # mdadm -Ss
> # modprobe -r raid1 && modprobe -r md-mod
> # cat /proc/modules | grep md_mod || echo Unloaded
> Unloaded
> # cat /proc/mdstat
> cat /proc/mdstat: Invalid arguments

I cannot reproduce this. That this point I get

cat: /proc/mdstat: No such file or directory


> # modprobe md-mod
> # cat /proc/mdstat
> cat /proc/mdstat: Invalid argument
> # cat /proc/modules | grep md_mod || echo Unloaded
> md_mod 94178 0 - Live 0xf857a000
>
> Some functionalities seem to work, but nothing is able to read /proc/mdstat.
>
> If have tried few kernels from 2.6.27 to 2.6.37-rc3, openSUSE 11.x/RHEL6, doesn't matter, still the same result. What can be wrong?

openSUSE doesn't compile md as a module, it is compiled in to the kernel.
But presumably you are compiling your own kernel with md as a module? Is
that right? You aren't compiling a module and loading it into a kernel which
already has md in it are you? I don't think that would work anyway...

And you give a full sequence of commands from loading to unload that reliably
produces this error for you?

NeilBrown

--
To unsubscribe from this list: send the line "unsubscribe linux-raid" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html

RE: md as module cannot be reloaded.

am 02.12.2010 00:42:16 von unknown

> -----Original Message-----
> From: linux-raid-owner@vger.kernel.org [mailto:linux-raid-
> owner@vger.kernel.org] On Behalf Of Neil Brown
> Sent: Wednesday, December 01, 2010 10:57 PM
> To: Hawrylewicz Czarnowski, Przemyslaw
> Cc: linux-raid@vger.kernel.org; Labun, Marcin; Czarnowska, Anna; Neubauer,
> Wojciech; Williams, Dan J; Ciechanowski, Ed
> Subject: Re: md as module cannot be reloaded.
>
> On Wed, 1 Dec 2010 14:23:14 +0000 "Hawrylewicz Czarnowski, Przemyslaw"
> wrote:
>
> > Hi,
> >
> > I have found an annoying problem with md module. If it is compiled as
> loadable module it is impossible to reload module if unloaded once.
> >
> > Eg.
> > # mdadm -Ss
> > # modprobe -r raid1 && modprobe -r md-mod
> > # cat /proc/modules | grep md_mod || echo Unloaded
> > Unloaded
> > # cat /proc/mdstat
> > cat /proc/mdstat: Invalid arguments
>
> I cannot reproduce this. That this point I get
>
> cat: /proc/mdstat: No such file or directory
>
>
> > # modprobe md-mod
> > # cat /proc/mdstat
> > cat /proc/mdstat: Invalid argument
> > # cat /proc/modules | grep md_mod || echo Unloaded
> > md_mod 94178 0 - Live 0xf857a000
> >
> > Some functionalities seem to work, but nothing is able to read
> /proc/mdstat.
> >
> > If have tried few kernels from 2.6.27 to 2.6.37-rc3, openSUSE 11.x/RHEL6,
> doesn't matter, still the same result. What can be wrong?
>
> openSUSE doesn't compile md as a module, it is compiled in to the kernel.
> But presumably you are compiling your own kernel with md as a module? Is
> that right? You aren't compiling a module and loading it into a kernel
> which
> already has md in it are you? I don't think that would work anyway...
Yes, I have recompiled kernel with MD as module.

>
> And you give a full sequence of commands from loading to unload that
> reliably
> produces this error for you?
Ok, here you are:
* Original opensuse config updated to new kernel with defaults
* Changed CONFIG_BLK_DEV_MD=y->m
* Added prefix -mdadm

make
su
make modules_install
make install
mdadm -Ss
mdadm --zero-superblock /dev/sd[b-g]
reboot
....
localhost:~ # uname -r
2.6.37-rc3-pae-mdadm
localhost:~ # cat /proc/mdstat
cat: /proc/mdstat: No such file or directory
localhost:~ # cat /proc/modules | grep md_mod
localhost:~ # modprobe md_mod
localhost:~ # ll /proc/mdstat
-r--r--r-- 1 root root 0 Dec 2 00:14 /proc/mdstat
localhost:~ # cat /proc/mdstat
Personalities :
unused devices:
localhost:~ # modprobe -r md_mod
localhost:~ # ll /proc/mdstat
-r--r--r-- 1 root root 0 Dec 2 00:14 /proc/mdstat
localhost:~ # cat /proc/mdstat
cat: /proc/mdstat: Invalid argument
localhost:~ # modprobe -r md_mod
localhost:~ # ll /proc/mdstat
-r--r--r-- 1 root root 0 Dec 2 00:14 /proc/mdstat
localhost:~ # cat /proc/mdstat
cat: /proc/mdstat: Invalid argument

that's all.

>
> NeilBrown
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-raid" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line "unsubscribe linux-raid" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html

RE: md as module cannot be reloaded.

am 10.12.2010 12:57:51 von unknown

> -----Original Message-----
> From: linux-raid-owner@vger.kernel.org [mailto:linux-raid-
> owner@vger.kernel.org] On Behalf Of Hawrylewicz Czarnowski, Przemyslaw
> Sent: Thursday, December 02, 2010 12:42 AM
> To: Neil Brown
> Cc: linux-raid@vger.kernel.org; Labun, Marcin; Czarnowska, Anna; Neubauer,
> Wojciech; Williams, Dan J; Ciechanowski, Ed
> Subject: RE: md as module cannot be reloaded.
>
> > -----Original Message-----
> > From: linux-raid-owner@vger.kernel.org [mailto:linux-raid-
> > owner@vger.kernel.org] On Behalf Of Neil Brown
> > Sent: Wednesday, December 01, 2010 10:57 PM
> > To: Hawrylewicz Czarnowski, Przemyslaw
> > Cc: linux-raid@vger.kernel.org; Labun, Marcin; Czarnowska, Anna;
> Neubauer,
> > Wojciech; Williams, Dan J; Ciechanowski, Ed
> > Subject: Re: md as module cannot be reloaded.
> >
> > On Wed, 1 Dec 2010 14:23:14 +0000 "Hawrylewicz Czarnowski, Przemyslaw"
> > wrote:
> >
> > > Hi,
> > >
> > > I have found an annoying problem with md module. If it is compiled as
> > loadable module it is impossible to reload module if unloaded once.
> > >
> > > Eg.
> > > # mdadm -Ss
> > > # modprobe -r raid1 && modprobe -r md-mod
> > > # cat /proc/modules | grep md_mod || echo Unloaded
> > > Unloaded
> > > # cat /proc/mdstat
> > > cat /proc/mdstat: Invalid arguments
> >
> > I cannot reproduce this. That this point I get
> >
> > cat: /proc/mdstat: No such file or directory
> >
> >
> > > # modprobe md-mod
> > > # cat /proc/mdstat
> > > cat /proc/mdstat: Invalid argument
> > > # cat /proc/modules | grep md_mod || echo Unloaded
> > > md_mod 94178 0 - Live 0xf857a000
> > >
> > > Some functionalities seem to work, but nothing is able to read
> > /proc/mdstat.
> > >
> > > If have tried few kernels from 2.6.27 to 2.6.37-rc3, openSUSE
> 11.x/RHEL6,
> > doesn't matter, still the same result. What can be wrong?
> >
> > openSUSE doesn't compile md as a module, it is compiled in to the kernel.
> > But presumably you are compiling your own kernel with md as a module? Is
> > that right? You aren't compiling a module and loading it into a kernel
> > which
> > already has md in it are you? I don't think that would work anyway...
> Yes, I have recompiled kernel with MD as module.
>
> >
> > And you give a full sequence of commands from loading to unload that
> > reliably
> > produces this error for you?
> Ok, here you are:
> * Original opensuse config updated to new kernel with defaults
> * Changed CONFIG_BLK_DEV_MD=y->m
> * Added prefix -mdadm
>
> make
> su
> make modules_install
> make install
> mdadm -Ss
> mdadm --zero-superblock /dev/sd[b-g]
> reboot
> ...
> localhost:~ # uname -r
> 2.6.37-rc3-pae-mdadm
> localhost:~ # cat /proc/mdstat
> cat: /proc/mdstat: No such file or directory
> localhost:~ # cat /proc/modules | grep md_mod
> localhost:~ # modprobe md_mod
> localhost:~ # ll /proc/mdstat
> -r--r--r-- 1 root root 0 Dec 2 00:14 /proc/mdstat
> localhost:~ # cat /proc/mdstat
> Personalities :
> unused devices:
> localhost:~ # modprobe -r md_mod
> localhost:~ # ll /proc/mdstat
> -r--r--r-- 1 root root 0 Dec 2 00:14 /proc/mdstat
> localhost:~ # cat /proc/mdstat
> cat: /proc/mdstat: Invalid argument
> localhost:~ # modprobe -r md_mod
Here is just "modprobe md_mod" of course...
> localhost:~ # ll /proc/mdstat
> -r--r--r-- 1 root root 0 Dec 2 00:14 /proc/mdstat
> localhost:~ # cat /proc/mdstat
> cat: /proc/mdstat: Invalid argument
>
> that's all.
And another scenario - it might put some new light at this problem:

[system right after restart]

localhost:~ # mdadm -Ss
mdadm: stopped /dev/md126
mdadm: stopped /dev/md127
localhost:~ # cat /proc/mdstat
Personalities : [raid1]
unused devices:
localhost:~ # modprobe -r raid1
localhost:~ # ll /proc/mdstat
-r--r--r-- 1 root root 0 Dec 9 16:52 /proc/mdstat
localhost:~ # cat /proc/mdstat
cat: /proc/mdstat: Invalid argument

One more thing... For some time everything worked perfectly. And problem appeared again after few days.
I do not remember any unusual activity which may change this behavior.

>
> >
> > NeilBrown
> >
> > --
> > To unsubscribe from this list: send the line "unsubscribe linux-raid" in
> > the body of a message to majordomo@vger.kernel.org
> > More majordomo info at http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line "unsubscribe linux-raid" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html