Bugzilla will be upgraded to version 5.0. The upgrade date is tentatively scheduled for 2 December 2018, pending final testing and feedback.
Bug 668125 - File identifies GFS2 filesystems as GFS1 filesystems
File identifies GFS2 filesystems as GFS1 filesystems
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: file (Show other bugs)
5.7
All Linux
low Severity medium
: rc
: ---
Assigned To: Jan Kaluža
Cluster QE
:
Depends On:
Blocks: 670125
  Show dependency treegraph
 
Reported: 2011-01-07 18:50 EST by Adam Drew
Modified: 2013-03-04 00:03 EST (History)
7 users (show)

See Also:
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 00:46:22 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)
Differentiate between GFS1 and GFS2 on sb_fs_format (882 bytes, patch)
2011-01-07 18:50 EST, Adam Drew
no flags Details | Diff


External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2012:0201 normal SHIPPED_LIVE file bug fix update 2012-02-20 09:53:52 EST

  None (edit)
Description Adam Drew 2011-01-07 18:50:25 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.
Comment 1 Jan Kaluža 2011-01-10 04:16:42 EST
Thanks for the patch. I've tested it and already sent it to upstream mailing list.
Comment 2 Steve Whitehouse 2011-01-14 09:41:14 EST
Looks like this probably needs to be cloned for rhel6 as well?
Comment 3 Jan Kaluža 2011-01-17 04:44:15 EST
Of course, you're right. I forgot to do it, thanks.
Comment 12 Steve Whitehouse 2011-09-28 07:53:53 EDT
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 05:15:10 EST
    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 00:46:22 EST
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

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