Bug 707091 - GFS2: gfs2_grow fails on a full file system
Summary: GFS2: gfs2_grow fails on a full file system
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: cluster
Version: 6.1
Hardware: All
OS: Linux
high
low
Target Milestone: rc
: ---
Assignee: Ben Marzinski
QA Contact: Cluster QE
URL:
Whiteboard:
Depends On: 626561 659123 659137
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-05-24 02:21 UTC by Ben Marzinski
Modified: 2011-12-06 14:52 UTC (History)
15 users (show)

Fixed In Version: cluster-3.0.12.1-2.el6
Doc Type: Bug Fix
Doc Text:
When mkfs.gfs2 built the resource group index for a new GFS2 file system, it used all the space it allocated. If the file system filled up completely, there was no room left over to write a new rindex entry, which made gfs2_grow unable to expand the file system. Code was added to mkfs.gfs2 to allocate enough space for the entire rindex file plus one extra rindex entry. The gfs2_grow code was changed to utilize that unused rindex space. As a result, gfs2_grow is now able to expand a completely full GFS2 file system.
Clone Of: 659123
Environment:
Last Closed: 2011-12-06 14:52:07 UTC


Attachments (Terms of Use)
Patch to allow gfs2_grow to use fallocate to grow full filesystems. (4.18 KB, patch)
2011-05-24 06:22 UTC, Ben Marzinski
no flags Details | Diff
Patch to allow gfs2_grow to grow full filesystems. Also handles stuffed rindex. (4.82 KB, patch)
2011-05-26 03:17 UTC, Ben Marzinski
no flags Details | Diff


Links
System ID Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2011:1516 normal SHIPPED_LIVE cluster and gfs2-utils bug fix update 2011-12-06 00:51:09 UTC

Comment 2 Ben Marzinski 2011-05-24 06:22:38 UTC
Created attachment 500549 [details]
Patch to allow gfs2_grow to use fallocate to grow full filesystems.

This patch makes mkfs.gfs2 add enough space for an extra resource group entry to the rindex when in creates the filesystem.  It also uses fallocate to make sure that there is enough space for an additional resource group entry in the rindex file whenever the filesystem is grown with gfs2_grow.

Comment 6 Ben Marzinski 2011-05-26 03:17:22 UTC
Created attachment 500971 [details]
Patch to allow gfs2_grow to grow full filesystems. Also handles stuffed rindex.

This is a new version of the patch.  With the old version, there was still an issue with stuffed rindex files, and filesystems where the blocksize was not equal to the page size.  Since gfs2_grow was writing all the rindex entries at once, there needed to be enough space to at least write the first page of data. If there wasn't, gfs2_grow would fail, even if fallocate guaranteed that there was enough space to write another rindex entry.  Now gfs2_grow first writes one rindex entry, to grow the filesystem by one resource group's worth of space. Then it writes the rest. Since the fallocate and mkfs code in the patch guarantees that there will always be enough space for at least one more rindex entry, this should always work.

Comment 7 Ben Marzinski 2011-05-30 06:46:12 UTC
Posted

Comment 10 Martin Juricek 2011-08-05 11:39:02 UTC
Verified in version gfs2-utils-3.0.12.1-7.el6, kernel 2.6.32-131.0.15.el6


[root@z2 ~]# lvcreate -L 2G -n lv1 vg1
  Logical volume "lv1" created
[root@z2 ~]# mkfs.gfs2 -j2 -J32 -p lock_dlm -t Z_Cluster:test /dev/vg1/lv1 -O
Device:                    /dev/vg1/lv1
Blocksize:                 4096
Device Size                2.00 GB (524288 blocks)
Filesystem Size:           2.00 GB (524288 blocks)
Journals:                  2
Resource Groups:           8
Locking Protocol:          "lock_dlm"
Lock Table:                "Z_Cluster:test"
UUID:                      708006aa-8054-d622-af08-5a3fa76e9a99

[root@z2 ~]# mount /dev/vg1/lv1 /mnt/test
[root@z2 ~]# dd if=/dev/zero of=/mnt/test/bigfile bs=100M
dd: writing `/mnt/test/bigfile': No space left on device
20+0 records in
19+0 records out
2073145344 bytes (2.1 GB) copied, 17.0651 s, 121 MB/s

[root@z2 ~]# df -h | grep lv1
/dev/mapper/vg1-lv1   2.0G  2.0G  576K 100% /mnt/test
[root@z2 ~]# for ((i=1;i<=73;i++)); do touch /mnt/test/zero.$i; done
touch: cannot touch `/mnt/test/zero.73': No space left on device

[root@z2 ~]# df -h | grep lv1
/dev/mapper/vg1-lv1   2.0G  2.0G     0 100% /mnt/test
[root@z2 ~]# umount /mnt/test
[root@z2 ~]# fsck.gfs2 /dev/vg1/lv1
Initializing fsck
Validating Resource Group index.
Level 1 rgrp check: Checking if all rgrp and rindex values are good.
(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    

[root@z2 ~]# lvextend -l+100%FREE /dev/vg1/lv1
  Extending logical volume lv1 to 204.34 GiB
  Logical volume lv1 successfully resized
[root@z2 ~]# mount /dev/vg1/lv1 /mnt/test
[root@z2 ~]# df -h | grep lv1
/dev/mapper/vg1-lv1   2.0G  2.0G     0 100% /mnt/test

[root@z2 ~]# gfs2_grow /dev/vg1/lv1
FS: Mount Point: /mnt/test
FS: Device:      /dev/dm-3
FS: Size:        524288 (0x80000)
FS: RG size:     65533 (0xfffd)
DEV: Size:       53567488 (0x3316000)
The file system grew by 207200MB.
gfs2_grow complete.
[root@z2 ~]# df -h | grep lv1
/dev/mapper/vg1-lv1   205G  2.0G  203G   1% /mnt/test

Comment 11 Nate Straz 2011-08-08 19:40:22 UTC
Also verified with gfs_fsck_stress test case grow_full.

Comment 12 Robert Peterson 2011-10-27 15:46:40 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:
When mkfs.gfs2 built the resource group index for a new GFS2 file system, it used all the space it allocated. If the file system filled up completely, there was no room left over to write a new rindex entry, which made gfs2_grow unable to expand the file system. Code was added to mkfs.gfs2 to allocate enough space for the entire rindex file plus one extra rindex entry. The gfs2_grow code was changed to utilize that unused rindex space. As a result, gfs2_grow is now able to expand a completely full GFS2 file system.

Comment 13 errata-xmlrpc 2011-12-06 14:52:07 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-2011-1516.html


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