[ofa-general] Re: Error message in OSM log when cached op file doesn't exist

Yevgeny Kliteynik kliteyn at dev.mellanox.co.il
Tue May 15 07:08:52 PDT 2007


Yevgeny Kliteynik wrote:
> Hi Hal,
> 
> Hal Rosenstock wrote:
>> Hi Yevgeny,
>>
>> On Mon, 2007-05-14 at 10:07, Yevgeny Kliteynik wrote:
>>> Hi Hal.
>>>
>>> [snip]
>>>> Date:   03/30/2007 12:24:12 AM
>>>> OpenSM: Handle conf file open failures better
>>>>     diff --git a/osm/opensm/osm_subnet.c b/osm/opensm/osm_subnet.c
>>>> index 46315a5..746fbd1 100644
>>>> --- a/osm/opensm/osm_subnet.c
>>>> +++ b/osm/opensm/osm_subnet.c
>>>> @@ -732,7 +732,7 @@ subn_dump_qos_options(
>>>>  
>>>>  /********************************************************************** 
>>>>
>>>>   
>>>> **********************************************************************/
>>>> -void
>>>> +ib_api_status_t
>>>>  osm_subn_rescan_conf_file(
>>>>    IN osm_subn_opt_t* const p_opts )
>>>>  {
>>>> @@ -751,7 +751,7 @@ osm_subn_rescan_conf_file(
>>>>       opts_file = fopen(file_name, "r");
>>>>    if (!opts_file)
>>>> -    return;
>>>> +    return IB_ERROR;
>>> [/snip]
>>>
>>> This patch was applied a month and a half ago (master).
>>> It handles opening cached options file, and prints error messages
>>> when OSM failed opening such file.
>>>
>>> I actually don't like this thing, because now every time you run
>>> OpenSM on the machine that doesn't have any cached options file
>>> (which is usually the case) you get an error message.
>>
>> Perhaps error is too severe as one can run just fine without this file
>> and there is no requirement to have it. Should it be some other type of
>> message instead ?
> 
> I think that the message should appear when OpenSM *does* find cached
> option file, and no message should appear when such file wasn't found
> (which is the most common use case).
> 
>>> There's no point checking whether the file exists, because osm runs
>>> as root, and if it fails opening this file, it means that the file
>>> doesn't exist or is inaccessible (broken mount, etc).
>>
>> That's the most common use case (running OpenSM as root, but not the
>> only one).
>>
>>> In any case, user gets info in stdout whether or now OpenSM is using
>>> cached options file.
>>
>> Is there always a message in the log as well indicating this ?
> 
> Nope.
> When this file is parsed, osm_log is not yet initialized.

Correction:

There are two places where this file is parsed:
1. osm_subn_parse_conf_file() - called from main(), osm log
   is not yet initialized when the function is called
2. osm_subn_rescan_conf_file() - called from osm_state_mgr_process()
   before every heavy sweep (when the log is already initialized),
   and logs error message about the missing file every time.

-- Yevgeny

> -- Yevgeny
> 
>> -- Hal
>>
>>> Do you agree? Should I issue a patch?
>>>
>>> -- Yevgeny
>>
>>
> 
> 
> 




More information about the general mailing list