Red Hat Bugzilla – Bug 668125
File identifies GFS2 filesystems as GFS1 filesystems
Last modified: 2013-03-04 00:03:00 EST
Created attachment 472322 [details] Differentiate between GFS1 and GFS2 on sb_fs_format File uses the magic number in the superblock to identify GFS2 filesystems but GFS1 and GFS2 filesystems share the same magic number. This causes file to misidentify GFS1 filesystems as GFS2 filesystems. This can easily be fixed by using another point of differentiation. I created a patch against file-5.04 that identifies on magic number and sb_fs_format. This allows file to differentiate between the two types of filesystem. [root@node2 file-5.04]# cat /etc/redhat-release Red Hat Enterprise Linux Server release 5.5 (Tikanga) [root@node2 file-5.04]# file -s /dev/mapper/mpath0p1 /dev/mapper/mpath0p1: GFS2 Filesystem (blocksize 4096, lockproto lock_dlm) [root@node2 file-5.04]# file -s /dev/mapper/mpath0p2 /dev/mapper/mpath0p2: GFS2 Filesystem (blocksize 4096, lockproto lock_dlm) [root@node2 file-5.04]# src/./file -s /dev/mapper/mpath0p1 /dev/mapper/mpath0p1: Linux GFS2 Filesystem (blocksize 4096, lockproto lock_dlm) [root@node2 file-5.04]# src/./file -s /dev/mapper/mpath0p2 /dev/mapper/mpath0p2: Linux GFS1 Filesystem (blocksize 4096, lockproto lock_dlm) Patch file was created against 4.17-15.el5_3.1. I tested the same code change (different patch file though) in 5.04 and it worked equally well.
Thanks for the patch. I've tested it and already sent it to upstream mailing list.
Looks like this probably needs to be cloned for rhel6 as well?
Of course, you're right. I forgot to do it, thanks.
Jan, can this be posted now? This time file is on the approved components list, so there should be no issues.
Technical note added. If any revisions are required, please edit the "Technical Notes" field accordingly. All revisions will be proofread by the Engineering Content Services team. New Contents: Cause: File used the magic number in the superblock to identify GFS2 filesystems but GFS1 and GFS2 filesystems share the same magic number. Consequence: This caused File to misidentify GFS1 filesystems as GFS2 filesystems. Fix: A way to make a difference between GFS1 and GFS2 based on magic number and sb_fs_format has been added. This allows File to differentiate between the two types of filesystem. Result: File now identifies GFS1 and GFS2 correctly.
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. http://rhn.redhat.com/errata/RHBA-2012-0201.html