Bug 982979 - Disable fstrim API/command in RHEL 6
Disable fstrim API/command in RHEL 6
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: libguestfs (Show other bugs)
6.5
Unspecified Unspecified
medium Severity medium
: rc
: ---
Assigned To: Pino Toscano
Virtualization Bugs
:
Depends On:
Blocks: 983331 1088685 1088686
  Show dependency treegraph
 
Reported: 2013-07-10 05:06 EDT by bfan
Modified: 2015-02-14 22:24 EST (History)
4 users (show)

See Also:
Fixed In Version: libguestfs-1.20.11-4.el6
Doc Type: Bug Fix
Doc Text:
Cause: The fstrim feature is marked as available. Consequence: Calling the fstrim API always results in errors. Fix: Mark the fstrim feature as not available, as fstrim is not going to work with the kernel and qemu available in RHEL 6. Result: The fstrim feature is not available, and calling the fstrim API reports that.
Story Points: ---
Clone Of:
: 983331 1088685 1088686 (view as bug list)
Environment:
Last Closed: 2014-10-14 02:34:50 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 RHBA-2014:1458 normal SHIPPED_LIVE libguestfs bug fix update 2014-10-13 21:10:57 EDT

  None (edit)
Description bfan 2013-07-10 05:06:48 EDT
Description of problem:
fstrim and btrfs are not supported in RHEL 6, command 'supported' and 'available' has wrong output for them


Version-Release number of selected component (if applicable):
libguestfs-1.20.9-6.el6.x86_64


How reproducible:
100%


Steps to Reproduce:
><fs> supported
         acl yes
      augeas yes
       btrfs yes
      fstrim yes
       gdisk no
        grub yes
       hivex yes
     inotify yes
         ldm no
   linuxcaps yes
 linuxfsuuid yes
linuxmodules yes
 linuxxattrs yes
        luks yes
        lvm2 yes
       mdadm yes
       mknod yes
      ntfs3g yes
   ntfsprogs yes
    realpath yes
       rsync yes
       scrub yes
     selinux yes
      wipefs yes
         xfs no
          xz yes
    zerofree no

><fs> available fstrim
><fs> available btrfs


Actual result:
Commands does not give error for fstrim and btrfs


Expect result:
Commands should give error for fstrim and btrfs


Additional info:
Same issue in rhel7
Comment 1 Richard W.M. Jones 2013-07-18 09:50:02 EDT
I'm not convinced this is a real bug.

btrfs certainly *exists* on RHEL 6:

$ rpm -qf /lib/modules/2.6.32-358.6.2.el6.x86_64/kernel/fs/btrfs/btrfs.ko
kernel-2.6.32-358.6.2.el6.x86_64
$ rpm -qf /sbin/btrfs
btrfs-progs-0.20-0.2.git91d9eec.el6.x86_64

I'm sure it works as well on RHEL 6 as it does anywhere else,
which is to say, not very well.

fstrim exists on RHEL 6:

$ rpm -qf /sbin/fstrim
util-linux-ng-2.17.2-12.9.el6.x86_64

Maybe there is an issue with the use of the word "supported",
which is an unfortunate choice in the context of RHEL but
can't be changed for backwards compatibility reasons.

We could forcibly disable these in RHEL 6 & 7 on the basis
that they don't really work very well.  Especially on RHEL 6,
btrfs is likely to be broken and fstrim likely does nothing.
Comment 2 Richard W.M. Jones 2013-07-19 06:43:17 EDT
I discussed this with Matt and we agreed it would be
a regression if we were to disable btrfs (which "worked"
previously in RHEL 6).

However fstrim (a new command in libguestfs) can be disabled.
Comment 3 RHEL Product and Program Management 2013-10-13 23:10:50 EDT
This request was not resolved in time for the current release.
Red Hat invites you to ask your support representative to
propose this request, if still desired, for consideration in
the next release of Red Hat Enterprise Linux.
Comment 4 Richard W.M. Jones 2013-10-16 08:05:41 EDT
Kick this out to RHEL 6.6.  It's not so important.
Comment 6 Richard W.M. Jones 2014-03-12 10:28:08 EDT
Turns out that libguestfs's implementation of fstrim was
spectacularly broken.  The fix is:

https://github.com/libguestfs/libguestfs/commit/5e105e06be4cc6c88b5d3fc5cf79acb48947e197

However it's still unlikely that fstrim will work on
RHEL 6.  It requires more recent qemu, kernel & virtio-scsi
than we have in RHEL 6.  Thus there is still a case for
removing the API here.
Comment 8 bfan 2014-06-03 02:09:20 EDT
Verified with libguestfs-1.20.11-4.el6.x86_64, fstrim is not supported and available

><fs> supported
         acl yes
      augeas yes
       btrfs yes
      fstrim no
       gdisk no
        grub yes
       hivex yes
     inotify yes
         ldm no
   linuxcaps yes
 linuxfsuuid yes
linuxmodules yes
 linuxxattrs yes
        luks yes
        lvm2 yes
       mdadm yes
       mknod yes
      ntfs3g yes
   ntfsprogs yes
    realpath yes
       rsync yes
       scrub yes
     selinux yes
      wipefs yes
         xfs no
          xz yes
    zerofree no

><fs> available fstrim
libguestfs: error: available: fstrim: group not available
Comment 10 errata-xmlrpc 2014-10-14 02:34:50 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.

http://rhn.redhat.com/errata/RHBA-2014-1458.html

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