Bug 707091
Summary: | GFS2: gfs2_grow fails on a full file system | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | Red Hat Enterprise Linux 6 | Reporter: | Ben Marzinski <bmarzins> | ||||||
Component: | cluster | Assignee: | Ben Marzinski <bmarzins> | ||||||
Status: | CLOSED ERRATA | QA Contact: | Cluster QE <mspqa-list> | ||||||
Severity: | low | Docs Contact: | |||||||
Priority: | high | ||||||||
Version: | 6.1 | CC: | adas, casmith, ccaulfie, ccoffey, cluster-maint, fdinitto, iannis, lhh, mjuricek, rpeterso, rwheeler, sbradley, swhiteho, tao, teigland | ||||||
Target Milestone: | rc | ||||||||
Target Release: | --- | ||||||||
Hardware: | All | ||||||||
OS: | Linux | ||||||||
Whiteboard: | |||||||||
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.
|
Story Points: | --- | ||||||
Clone Of: | 659123 | Environment: | |||||||
Last Closed: | 2011-12-06 14:52:07 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: | 626561, 659123, 659137 | ||||||||
Bug Blocks: | |||||||||
Attachments: |
|
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.
Posted 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 Also verified with gfs_fsck_stress test case grow_full. 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. 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 |
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.