[prev in list] [next in list] [prev in thread] [next in thread] 

List:       evms-devel
Subject:    Re: [Evms-devel] evms initrd - needed w/bdclaim patch?
From:       Kevin Corry <kevcorry () us ! ibm ! com>
Date:       2005-03-30 14:36:39
Message-ID: 200503300836.39909.kevcorry () us ! ibm ! com
[Download RAW message or body]

On Wed March 30 2005 1:05 am, loic.devulder@mpsa.com wrote:
> Ken, have you put the evms.conf file into the /etc directory in your
> initrd? If the answer is yes then your segfault problem is here!
> I'm using EVMS v2.5.0 on a RHEL3 with a "patched" RedHat initrd and this
> problem of segfault is cause by a "bug" in the EVMS engine.
> RedHat uses nash as the mini-shell to boot the OS. In nash there is no
> stdin open by default, so the first available file descriptor is 0.
> In the read_config function (file engine/config.c) there is a test on
> config_fd. This test is only valid if config_fd is greater than 0.
> But the open function return -1 on errror and a number greater or equal to
> 0 on success. So, in nash, the read_config function doesn't work.
> I have made a patch and it works fine for me.
>
> I thing that the segfault error is return by the strerror function called
> in read_config because the rc variable isn't set (or set to 0 by errno?).
>
> Here is the patch to config.c:
>
> --- evms-2.5.0/engine/config.c  2005-03-21 14:56:27.000000000 +0100
> +++ evms-2.5.0.psa/engine/config.c      2005-03-21 14:56:56.000000000 +0100
> @@ -853,7 +853,7 @@
>         if (rc == 0) {
>                 config_fd = open(config_file_name, O_RDONLY);
>
> -               if (config_fd > 0) {
> +               if (config_fd != -1) {
>                         /* Close this file for all exec'd processes. */
>                         fcntl(config_fd, F_SETFD, FD_CLOEXEC);
>

Looks good, Loic. I've applied it to our CVS tree. Thanks for the patch!

Ken, could you apply this patch to your EVMS 2.5.2 source and rebuild EVMS and 
your initrd? Let me know if that solves the segfault problem.

-- 
Kevin Corry
kevcorry@us.ibm.com
http://www.ibm.com/linux/ltc/
http://evms.sourceforge.net/


-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
Evms-devel mailing list
Evms-devel@lists.sourceforge.net
To subscribe/unsubscribe, please visit:
https://lists.sourceforge.net/lists/listinfo/evms-devel
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic