Bug 720935

Summary: GFS2: mkfs.gfs2 doesn't work on regular files
Product: Red Hat Enterprise Linux 5 Reporter: Andrew Price <anprice>
Component: gfs2-utilsAssignee: Andrew Price <anprice>
Status: CLOSED ERRATA QA Contact: Cluster QE <mspqa-list>
Severity: low Docs Contact:
Priority: low    
Version: 5.8CC: adas, agk, bmarzins, edamato, fdinitto, jpayne, rpeterso, swhiteho
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: gfs2-utils-0_1_62-33_el5 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: 719943 Environment:
Last Closed: 2012-02-21 06:39:17 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: 719943    
Bug Blocks: 720668    
Attachments:
Description Flags
Backported patch none

Description Andrew Price 2011-07-13 09:45:11 UTC
+++ This bug was initially created as a clone of Bug #719943 +++

Description of problem:

$ dd if=/dev/null of=sparse-file bs=1 count=0 seek=1T
$ ./mkfs.gfs2 -t foo:bar sparse-file 
../../gfs2/libgfs2/libgfs2.h: sparse-file is not a block device

--- Additional comment from anprice on 2011-07-11 10:26:52 EDT ---

Created attachment 512229 [details]
Patch to handle regular files

--- Additional comment from anprice on 2011-07-11 12:22:20 EDT ---

Created attachment 512257 [details]
Patch to handle regular files, v2

--- Additional comment from anprice on 2011-07-11 12:54:36 EDT ---

Patch v2 is now in gfs2-utils.git. Closing as UPSTREAM.

Comment 1 Andrew Price 2011-08-10 14:06:30 UTC
Created attachment 517618 [details]
Backported patch

Comment 2 Andrew Price 2011-08-10 15:44:25 UTC
Above patch is now in the RHEL58 branch of cluster.git

Comment 3 Nate Straz 2011-11-08 22:28:00 UTC
Can you please post some unit test results to show that development has tried out the fix in the 5.8 package

FMI see http://wiki.test.redhat.com/ClusterStorage/WhyNeedDevTestResults

Comment 4 Andrew Price 2011-11-09 09:11:01 UTC
Using the steps from the original bug:

[root@exxon-01 ~]# rpm -q gfs2-utils
gfs2-utils-0.1.62-33.el5
[root@exxon-01 ~]# dd if=/dev/null of=sparse-file bs=1 count=0 seek=1T
0+0 records in
0+0 records out
0 bytes (0 B) copied, 1.4e-05 seconds, 0.0 kB/s
[root@exxon-01 ~]# mkfs.gfs2 -O -t foo:bar sparse-file
Device:                    sparse-file
Blocksize:                 4096
Device Size                1024.00 GB (268435456 blocks)
Filesystem Size:           1024.00 GB (268435454 blocks)
Journals:                  1
Resource Groups:           4096
Locking Protocol:          "lock_dlm"
Lock Table:                "foo:bar"
UUID:                      0B8E5EE2-895C-5A71-5B33-EE604A160401

[root@exxon-01 ~]# fsck.gfs2 sparse-file 
Initializing fsck
Validating Resource Group index.
Level 1 RG check.
(level 1 passed)
Starting pass1
Pass1 complete      
Starting pass1b
Pass1b complete
Starting pass1c
Pass1c complete
Starting pass2
Pass2 complete      
Starting pass3
Pass3 complete      
Starting pass4
Pass4 complete      
Starting pass5
Pass5 complete      
gfs2_fsck complete

Comment 6 Justin Payne 2011-12-05 17:36:31 UTC
[root@localhost ~]# rpm -q gfs2-utils

gfs2-utils-0.1.62-31.el5

[root@localhost ~]# dd if=/dev/null of=sparse-file bs=1 count=0 seek=256M
0+0 records in
0+0 records out
0 bytes (0 B) copied, 7e-06 seconds, 0.0 kB/s

[root@localhost ~]# mkfs.gfs2 -O -t foo:bar sparse-file
mkfs.gfs2: sparse-file is not a block device


[root@localhost ~]# rpm -q gfs2-utils
gfs2-utils-0.1.62-33.el5

[root@localhost ~]# dd if=/dev/null of=sparse-file bs=1 count=0 seek=256M
0+0 records in
0+0 records out
0 bytes (0 B) copied, 7e-06 seconds, 0.0 kB/s

[root@localhost ~]# mkfs.gfs2 -O -t foo:bar sparse-file
Device:                    sparse-file
Blocksize:                 4096
Device Size                0.25 GB (65536 blocks)
Filesystem Size:           0.25 GB (65534 blocks)
Journals:                  1
Resource Groups:           1
Locking Protocol:          "lock_dlm"
Lock Table:                "foo:bar"
UUID:                      602C068C-6D89-FA0A-847A-A9D9DCBE0390

[root@localhost ~]# fsck.gfs2 sparse-file
Initializing fsck
Validating Resource Group index.
Level 1 RG check.
(level 1 passed)
Starting pass1
Pass1 complete      
Starting pass1b
Pass1b complete
Starting pass1c
Pass1c complete
Starting pass2
Pass2 complete      
Starting pass3
Pass3 complete      
Starting pass4
Pass4 complete      
Starting pass5
Pass5 complete      
gfs2_fsck complete

Verified in gfs2-utils-0.1.62-33.el5

Comment 7 errata-xmlrpc 2012-02-21 06:39:17 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-0269.html