Bug 157526 - partition_uuid of devlabel-0.48.03-6 displays diffrent partition uuid for ocfs partitions.
partition_uuid of devlabel-0.48.03-6 displays diffrent partition uuid for ocf...
Status: CLOSED WONTFIX
Product: Red Hat Enterprise Linux 3
Classification: Red Hat
Component: devlabel (Show other bugs)
3.0
i686 Linux
medium Severity medium
: ---
: ---
Assigned To: Karel Zak
NdRvw
:
Depends On:
Blocks: 190430
  Show dependency treegraph
 
Reported: 2005-05-12 07:15 EDT by Santosh Singh
Modified: 2008-08-02 19:40 EDT (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2007-01-10 15:01:36 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
patch to the partition_uuid.c (479 bytes, patch)
2006-11-09 08:51 EST, Rick Beldin
no flags Details | Diff
patch to the linux_fs.h file for ocfs support (348 bytes, patch)
2006-11-09 08:56 EST, Rick Beldin
no flags Details | Diff

  None (edit)
Description Santosh Singh 2005-05-12 07:15:38 EDT
Description of problem:
partition_uuid of devlabel-0.48.03-6 displays diffrent partition uuid for ocfs 
partitions.

Version-Release number of selected component (if applicable):
devlabel-0.48.03-6 on RHEL3.0 U4 2.4.21-27.ELsmp i686 i386 GNU/Linux

How reproducible:
Install ocfstools

Steps to Reproduce:

1.Create a partition. 
2.Format this partition with ocfstool.
3.run partition_uuid partition_name
4.repeate step 3 for the same partition,
 will shows diffrent partition uuids for same ocfs partition.
  
Actual results:

partition_uuid displays diffrent uuid for same ocfs partition or displays all 
zeroes as uuid.

Expected results:
Always display the unique partition id for ocfs partition.

Additional info:

Since these structures in linux_fs.h  
struct ocfs_volume_header {
        u_char  minor_version[4];
        u_char  major_version[4];
        u_char  signature[128];
};

struct ocfs_volume_label {
        u_char  disk_lock[48];
        u_char  label[64];
        u_char  label_len[2];
};

 does not have uuid field, the function  get_label_uuid() does not uses it and 
thus displays only all zeroes or some other junk values.
Comment 1 Santosh Singh 2005-05-16 03:17:50 EDT
   Since the partition_uuid utility was not picking up the volume id from the 
quorum space of the volume, which is second sector of the volume. By  adding 
the following field in the structure ocfs_volume_label in linux_fs.h and then 
copying the vol_id into the uuid in the file partition_uuid.c  will solve this 
bug.

Changes
1. In linux_fs.h

struct ocfs_volume_label {
        u_char  disk_lock[48];
        u_char  label[64];
        u_char  label_len[2];
        u_char  vol_id[16];
        u_char  vol_id_len[2];
};
2. In partition_uuid.c
 if (lseek(fd, 0, SEEK_SET) == 0
            && read(fd, (char *) &ovh, sizeof(ovh)) == sizeof(ovh)
            && (strncmp(ovh.signature, OCFS_MAGIC, sizeof(OCFS_MAGIC)) == 0)
            && (lseek(fd, 512, SEEK_SET) == 512)
            && read(fd, (char *) &olbl, sizeof(olbl)) == sizeof(olbl)) {
                uuid[0] = '\0';

Added ===>  memcpy(uuid, olbl.vol_id, sizeof(olbl.vol_id));

            namesize = ocfslabellen(olbl);
             if ((*label = calloc(namesize + 1, 1)) != NULL)
                       memcpy(*label, olbl.label, namesize);
                rv = 0;
        }

Comment 10 Rick Beldin 2006-11-09 08:51:46 EST
Created attachment 140768 [details]
patch to the partition_uuid.c
Comment 11 Rick Beldin 2006-11-09 08:56:52 EST
Created attachment 140769 [details]
patch to the linux_fs.h file for ocfs support
Comment 12 Rick Beldin 2006-11-09 09:06:59 EST
patches above appear to work in very limited testing. 
Comment 13 Daniel Riek 2006-12-16 17:35:43 EST
As the RHEL 3.9 release will be very constraint, we need a better understanding
of the functional impact of the problem. Is that the only way to find out the
UUIDs? Any workarounts?
Comment 15 RHEL Product and Program Management 2007-01-10 15:01:36 EST
Product Management has reviewed and declined this request.  You may appeal this
decision by reopening this request. 

Note You need to log in before you can comment on or make changes to this bug.