GNOME Bugzilla – Bug 684115
Reiserfs UUID reading issues on Fedora and CentOS
Last modified: 2012-10-10 16:52:51 UTC
1) For an unmounted reiserfs file system the UUID is displayed as "<no". 2) For a mounted reiserfs file system the UUID is blank and partition specific error is displayed: reiserfstune: Reiserfstune is not allowed to be run on mounted filesystem. Assume this is a Fedora / CentOS specific issue.
Created attachment 225035 [details] [review] GParted UUID patchset (v1) Hi Curtis, Here's the patchset to fix these issues. Also contains 3 tidyup patches. For the big tidyup patch: Update file system specific validation of RFC 4122 UUIDs which used the RFC4122_NONE_NIL_UUID_REGEXP regular expression in all the Linux native file system specific read_uuid() methods I did the following testing: 1) Replaced blkid command with a shell script wrapper which removed all UUID information to force GParted to have to call file system specific read_uuid() methods. 2) Created 2 copies of every affected file system, one with a default UUID and one with an all zero Nil UUID. All the FS tools have a way to set a Nil UUID except btrfs and reiser4. In those cases use dd to overwite the 16 bytes containing the UUID on disk. 3) Test displaying of the UUID in GParted for both default and Nil UUID versions of all affected file systems when mounted and unmounted. (Turns out that btrfs and xfs file systems with Nil UUIDs can't be mounted. Don't have a kernel which can mount nilfs2 and reiser4). 4) Test ext2 and jfs file systems using random and time generated UUIDs to test different "versions" of UUIDs. http://www.ietf.org/rfc/rfc4122.txt http://en.wikipedia.org/wiki/Universally_unique_identifier Thanks, Mike
Thank you Mike for identifying this problem and developing a patch. Do you use Fedora/CentOS yourself? I thought this would be a quick test but when I tried testing with my Virtual Machines of Fedora 16, and 17, it appears that the package of reiserfs-utils I installed already had the fix (e.g., linked with UUID). As such I was unable to confirm the problem. ;-( From your above list, it appears that you performed fairly extensive testing. Hence I will proceed to review the patch, and plan to do some elementary testing with perhaps an older distribution or two.
My testing has gone well, and I was able to reproduce the problem with a Fedora 15 VM. :-) One suggestion for improvement would be to change the #define RFC4122_NONE_NIL_UUID_REGEXP in Utils.h to a const. In fact the #define UUID_STRING_LENGTH should be changed to a const as well. The advantage to using const in C++ over #define is that type checking can be performed at compile time. With #define there is no type checking available.
Yes I use Fedora 14 on my desktop and multiboot my netbook with Fedora 16 mostly but also Fedora 13 to 15, Red Hat 6.1 and CentOS 6.3. I guess that your Fedora 16 image is up to date and has this version of reiserfs-utils installed. Anyway you reproduced the fault with Fedora 15. # rpm -q reiserfs-utils reiserfs-utils-3.6.21-5.fc16.i686 # rpm -q --changelog reiserfs-utils | head * Thu Aug 16 2012 Itamar Reis Peixoto <itamar@ispbrasil.com.br> - 2:3.6.21-5 - add missing libuuid-devel bz# 660285 ... I chose to use a #define for RFC4122_NONE_NIL_UUID_REGEXP so that the compiler would concatenate the 3 string literals together for the second regexp_label() parameter. Using a constant means the 3 strings have to be concatenated at run time as a C++ string or Glib::ustring type using cpu and malloced memory. Don't really mind which.
Since the code is correct either way, and the note about const was only a suggestion, I will commit the patch as it stands. Most important is that the code works and is maintainable, not whether it uses a #define or a const. :-) The patch set in comment #1 has been committed to the git repository for inclusion in the next release of GParted. The relevant git commits can be viewed at the following links: Ignore invalid reiserfs UUIDs (#684115) http://git.gnome.org/browse/gparted/commit/?id=eca986c96d663baadf43dde177342fa046c9cadc Switch to using debugreiserfs to read the UUID (#684115) http://git.gnome.org/browse/gparted/commit/?id=ee87cee96f599d7a6d329de5717823d8dc31176e Switch to using jfs_tune to read the UUID http://git.gnome.org/browse/gparted/commit/?id=aa16bf545151ce91d98b58eab7b3027c7d89a29a Update file system specific validation of RFC 4122 UUIDs http://git.gnome.org/browse/gparted/commit/?id=4f235ecb06a8e6212366257ecfaea5bfa25d461c Switch to using debugfs.reiser4 to read the label http://git.gnome.org/browse/gparted/commit/?id=e282b78b4ad90af0ee426812a05a3ce27780e9ae
This bug fix has been included in GParted 0.14.0 released on October 10, 2012.