Bugzilla will be upgraded to version 5.0. The upgrade date is tentatively scheduled for 2 December 2018, pending final testing and feedback.
Bug 1399830 - GFS2: fallocate error message during gfs2_grow
GFS2: fallocate error message during gfs2_grow
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: kernel (Show other bugs)
7.3
Unspecified Unspecified
unspecified Severity unspecified
: rc
: ---
Assigned To: Andrew Price
cluster-qe@redhat.com
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2016-11-29 15:41 EST by Nate Straz
Modified: 2017-08-02 00:53 EDT (History)
2 users (show)

See Also:
Fixed In Version: kernel-3.10.0-657.el7
Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2017-08-02 00:53:19 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2017:1842 normal SHIPPED_LIVE Important: kernel security, bug fix, and enhancement update 2017-08-01 14:22:09 EDT

  None (edit)
Description Nate Straz 2016-11-29 15:41:46 EST
Description of problem:

When I grow a GFS2 file system the successful output includes an error about fallocate not being supported.


[root@host-135 ~]# df -h /mnt/growfs0/
Filesystem                  Size  Used Avail Use% Mounted on
/dev/mapper/growfs-growfs0  300G  259M  300G   1% /mnt/growfs0
[root@host-135 ~]# lvs growfs
  LV      VG     Attr       LSize   Pool Origin Data%  Meta%  Move Log Cpy%Sync Convert
  growfs0 growfs -wi-ao---- 300.00g
[root@host-135 ~]# lvextend -L 400G growfs/growfs0
  Size of logical volume growfs/growfs0 changed from 300.00 GiB (76800 extents) to 400.00 GiB (102400 extents).
  Logical volume growfs/growfs0 successfully resized.
[root@host-135 ~]# lvs growfs
  LV      VG     Attr       LSize   Pool Origin Data%  Meta%  Move Log Cpy%Sync Convert
  growfs0 growfs -wi-ao---- 400.00g
[root@host-135 ~]# gfs2_grow /mnt/growfs0/
FS: Mount point:             /mnt/growfs0
FS: Device:                  /dev/mapper/growfs-growfs0
FS: Size:                    78643199 (0x4afffff)
DEV: Length:                 104857600 (0x6400000)
The file system will grow by 102400MB.
fallocate: Operation not supported                      <--- HERE
gfs2_grow complete.
[root@host-135 ~]# echo $?
0
[root@host-135 ~]# df -h /mnt/growfs0/
Filesystem                  Size  Used Avail Use% Mounted on
/dev/mapper/growfs-growfs0  400G  259M  400G   1% /mnt/growfs0

I ran the command with strace and found that gfs2_grow is trying to fallocate on the rindex on the gfs2metafs.

18856 open("/tmp/.gfs2meta.xvHEtj/rindex", O_RDWR|O_CLOEXEC) = 6
...
18856 fallocate(6, 01, 15648, 96)       = -1 EOPNOTSUPP (Operation not supported)


The file system does grow and appears to be completely usable.

Version-Release number of selected component (if applicable):
gfs2-utils-3.1.9-3.el7.x86_64
kernel-3.10.0-514.el7.x86_64

How reproducible:
Easily

Steps to Reproduce:
See example above.

Actual results:
Odd error message is printed

Expected results:
No odd error message during a successful command.

Additional info:
Comment 2 Andrew Price 2016-11-30 09:57:25 EST
gfs2_grow uses

    if (fallocate(rindex_fd, FALLOC_FL_KEEP_SIZE, (rindex_size + writelen), entrysize) != 0)
           perror("fallocate");

to allocate enough space to write an rindex entry if the fs is full when the next grow happens. So, while the grow will succeed, the danger of the fallocate() failing is that a second gfs2_grow could fail if the fs is full.

After a recent change to fix bug 1221331, gfs2's fallocate implementation does:

    if ((mode & ~FALLOC_FL_KEEP_SIZE) || gfs2_is_jdata(ip))
           return -EOPNOTSUPP;

and since mkfs.gfs2 creates the rindex inode with GFS2_DIF_JDATA set, the gfs2_is_jdata(ip) returns true and we see the bug.

So I'm not sure that we can fix this in gfs2_grow. We may need to allow gfs2's fallocate to proceed for the rindex especially, or for all GFS2_DIF_SYSTEM inodes.
Comment 3 Andrew Price 2017-04-04 12:12:48 EDT
I have submitted an upstream patch for this to cluster-devel.
Comment 4 Andrew Price 2017-04-05 20:10:12 EDT
The patch is now upstream and I have sent a RHEL7 version to rhkernel-list.
Comment 5 Rafael Aquini 2017-04-24 12:15:38 EDT
Patch(es) committed on kernel repository and an interim kernel build is undergoing testing
Comment 7 Rafael Aquini 2017-04-25 08:23:05 EDT
Patch(es) available on kernel-3.10.0-657.el7
Comment 9 Nate Straz 2017-06-15 14:40:46 EDT
Verified on kernel-3.10.0-679.el7.x86_64

[root@dash-01 ~]# uname -r
3.10.0-679.el7.x86_64
[root@dash-01 ~]# df -Th /mnt/gfs2
Filesystem            Type  Size  Used Avail Use% Mounted on
/dev/mapper/fsck-gfs2 gfs2  1.0T   34M  1.0T   1% /mnt/gfs2
[root@dash-01 ~]# lvextend -L +1T /dev/fsck/gfs2
  Size of logical volume fsck/gfs2 changed from 1.00 TiB (262144 extents) to 2.00 TiB (524288 extents).
  Logical volume fsck/gfs2 successfully resized.
[root@dash-01 ~]# gfs2_grow /mnt/gfs2
FS: Mount point:             /mnt/gfs2
FS: Device:                  /dev/mapper/fsck-gfs2
FS: Size:                    268435454 (0xffffffe)
DEV: Length:                 536870912 (0x20000000)
The file system will grow by 1048576MB.
gfs2_grow complete.
[root@dash-01 ~]# df -Th /mnt/gfs2
Filesystem            Type  Size  Used Avail Use% Mounted on
/dev/mapper/fsck-gfs2 gfs2  2.0T   34M  2.0T   1% /mnt/gfs2
Comment 11 errata-xmlrpc 2017-08-02 00:53:19 EDT
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.

https://access.redhat.com/errata/RHSA-2017:1842

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