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.
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; }
Created attachment 140768 [details] patch to the partition_uuid.c
Created attachment 140769 [details] patch to the linux_fs.h file for ocfs support
patches above appear to work in very limited testing.
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?
Product Management has reviewed and declined this request. You may appeal this decision by reopening this request.