Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

#56 unable to retrieve extended information for metadata segment

Version_2.0
open
5
2004-04-21
2004-04-21
Steve Landherr
No

EVMS Version: 2.2.2 (also top of tree)

Using the CLI to retrieve CSM metadata segment
extended information always fails:

-=-=-=-

EVMS:
q:ei,raid5_00_csm/sdc_metadata1

Field Name: Name
Title: Name
Description: This is the partition name. It must be
unique on the system.
The value of this field is: raid5_00_csm/sdc_metadata1

Field Name: Size
Title: Size
Description: This is the size of the partition in sectors.
The value of this field is: 1 sectors

Field Name: Start
Title: Start LBA
Description: This is the sector offset of the partition on
the disk, i.e., the
logical block address of the first sector of the partition.
The value of this field is: 0

Field Name: Type
Title: Type
Description: Partition type - data, metadata, free.
The value of this field is: metadata
This field has additional information available. To access
this additional
information, specify the name of this field as part of the
extended info
query command.

EVMS:
q:ei,raid5_00_csm/sdc_metadata1,Type

No extended information is available for the specified
item.

-=-=-=-

In plugins/csm/segments.c, csm_get_info() does a string
compare of the name argument against "Type" as part
of the logic to determine if metadata extended
information should be returned. This should work
since "Type" is what is on the command line.

Using GDB, we see:

-=-=-=-

EVMS:

Program received signal SIGINT, Interrupt.
[Switching to Thread 81926 (LWP 5125)]
0x4020e2f6 in nanosleep () from /lib/libc.so.6
(gdb) break csm_get_info
Breakpoint 1 at 0x402e57a9: file segments.c, line 861.
(gdb) break csm_get_metadata_info
Breakpoint 2 at 0x402e18f9: file options.c, line 1175.
(gdb) cont
Continuing.
q:ei,raid5_00_csm/sdc_metadata1,Type
[Switching to Thread 16384 (LWP 5105)]

Breakpoint 1, csm_get_info (seg=0x80a3a34,
name=0x80a6240 "TYPE",
info_array=0xbffff7f0) at segments.c:861

-=-=-=-

It looks like the CLI parser sees "Type" as a keyword,
and changes it to "TYPE" before passing it down to the
CSM plugin. This causes the strcmp() to fail.

Discussion

    • labels: 531669 --> Command Line UI
     
  • Logged In: YES
    user_id=209030

    Thanks for the research. The CLI indeed converts what it
    sees as keywords to uppercase for easier comparison.

    Of course, the way to keep the CLI from converting "Type" to
    upper case is to specify "Type" in quotes:
    q:ei,raid5_00_csm/sdc_metadata1,"Type"

    I'm changing the Category of this bug to "Command Line UI"
    since the Cluster Segment Manager is doing the correct
    thing; it's the CLI that messes up the name.

    The CLI relies heavily on key words being in upper case.
    I'll look into what it would take to make the CLI leave key
    words as-is without changing them to upper case. It may be
    as simple as changing all the strcmp() to strcasecmp().
    Then again, maybe not.