Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
For bugs related to Red Hat Enterprise Linux 5 product line. The current stable release is 5.10. For Red Hat Enterprise Linux 6 and above, please visit Red Hat JIRA https://issues.redhat.com/secure/CreateIssue!default.jspa?pid=12332745 to report new issues.

Bug 668125

Summary: File identifies GFS2 filesystems as GFS1 filesystems
Product: Red Hat Enterprise Linux 5 Reporter: Adam Drew <adrew>
Component: fileAssignee: Jan Kaluža <jkaluza>
Status: CLOSED ERRATA QA Contact: Cluster QE <mspqa-list>
Severity: medium Docs Contact:
Priority: low    
Version: 5.7CC: ahecox, dapospis, ksrot, mmalik, ovasik, sbradley, swhiteho
Target Milestone: rc   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: file-4.17-17 Doc Type: Bug Fix
Doc Text:
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.
Story Points: ---
Clone Of:
: 670125 (view as bug list) Environment:
Last Closed: 2012-02-21 05:46:22 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 670125    
Attachments:
Description Flags
Differentiate between GFS1 and GFS2 on sb_fs_format none

Description Adam Drew 2011-01-07 23:50:25 UTC
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.

Comment 1 Jan Kaluža 2011-01-10 09:16:42 UTC
Thanks for the patch. I've tested it and already sent it to upstream mailing list.

Comment 2 Steve Whitehouse 2011-01-14 14:41:14 UTC
Looks like this probably needs to be cloned for rhel6 as well?

Comment 3 Jan Kaluža 2011-01-17 09:44:15 UTC
Of course, you're right. I forgot to do it, thanks.

Comment 12 Steve Whitehouse 2011-09-28 11:53:53 UTC
Jan, can this be posted now? This time file is on the approved components list, so there should be no issues.

Comment 18 Jan Kaluža 2012-01-05 10:15:10 UTC
    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.

Comment 19 errata-xmlrpc 2012-02-21 05:46:22 UTC
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