Bug 1477192 - xfs_info suddenly doesn't work with a device path
xfs_info suddenly doesn't work with a device path
Status: CLOSED NOTABUG
Product: Fedora
Classification: Fedora
Component: xfsprogs (Show other bugs)
27
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Eric Sandeen
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2017-08-01 08:44 EDT by Vratislav Podzimek
Modified: 2018-05-08 12:00 EDT (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2018-05-08 12:00:07 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)

  None (edit)
Description Vratislav Podzimek 2017-08-01 08:44:29 EDT
Description of problem:
With xfsprogs-4.11 and older 'xfs_info /dev/sda1' works just fine, but with 4.12 it doesn't.

Version-Release number of selected component (if applicable):
xfsprogs-4.12.0-1.fc27.i686

How reproducible:
100%

Steps to Reproduce:
1. run 'xfs_info' with some device path
2. run 'xfs_info' with the mount point

Actual results:
The first case doesn't work, the second one does.

Expected results:
Both cases should work as they used to with older versions.
Comment 1 Eric Sandeen 2017-08-01 09:27:38 EDT
Yes, this was largely intentional.  The behavior before was a bug:

SYNOPSIS

...

       xfs_info [ -t mtab ] mount-point
                            ^^^^^^^^^^^

There were problems with people pointing at unmounted mount points, and filesystem images, etc, and getting unexpected information.  It's documented as to be used on a mount point, but that had not been enforced.  To be honest, I was not aware that it had worked on a device node before; that might be something we could revisit, but it's never been a documented feature.  If it was working before, it was by accident.
Comment 2 Vratislav Podzimek 2017-08-03 06:02:00 EDT
How hard would it be to turn the old bug into a new feature? It's not particularly easy to find the device's mount point in places where only the device path is known and information about the particular FS is required.
Comment 3 Eric Sandeen 2017-08-03 11:06:50 EDT
So that's the flip side of it, the command will not work on a block device unless it's mounted, so thinking that it works against block devices may also confuse people...

In what situations is it difficult to find a mount point from a device?  /proc/mounts contains the mapping, right?  Or "mount" output?

It may not be too difficult to add block device lookup as a documented, supported feature, but I didn't know that would be such a desired or necessary usecase.

Thanks,
-Eric
Comment 4 Vratislav Podzimek 2017-08-07 03:35:03 EDT
(In reply to Eric Sandeen from comment #3)
> So that's the flip side of it, the command will not work on a block device
> unless it's mounted, so thinking that it works against block devices may
> also confuse people...

Sure, but that can be quite easily documented.

> 
> In what situations is it difficult to find a mount point from a device? 
> /proc/mounts contains the mapping, right?  Or "mount" output?

Yes, but parsing those in a C code line by line is cumbersome, devices can have multiple names/paths etc. I'm not saying it's impossible, but it's complicated enough to be worth having just in one place (xfs_info).

> 
> It may not be too difficult to add block device lookup as a documented,
> supported feature, but I didn't know that would be such a desired or
> necessary usecase.

Well, if some code relied on the old behavior, they would have to adapt now. So it is desired to not remove functionality. But I understand that it wasn't documented and probably not intentionally working either.
Comment 5 Jan Kurik 2017-08-15 05:36:09 EDT
This bug appears to have been reported against 'rawhide' during the Fedora 27 development cycle.
Changing version to '27'.
Comment 6 Dusty Mabe 2017-09-11 15:38:20 EDT
FYI - cloud-init uses this functionality so we need to resolve between the cloud-init maintainers and xfs maintainers how this needs to be handled. If not then we'll break every cloud instance we boot with an XFS root filesystem. 

see https://bugzilla.redhat.com/show_bug.cgi?id=1490505
Comment 7 Eric Sandeen 2017-09-11 16:59:41 EDT
nb: cloud-init just needs a one-line change to fix this and invoke xfs_growfs properly, I added comments to the bug #1490505
Comment 8 Colin Walters 2017-09-12 09:51:59 EDT
This bug is a great example of where if we actually had the ability to revert, that should have been done first.  Fix the consumers, then try again.
Comment 9 Eric Sandeen 2017-09-12 14:44:16 EDT
(In reply to Colin Walters from comment #8)
> This bug is a great example of where if we actually had the ability to
> revert, that should have been done first.  Fix the consumers, then try again.

I'm not so sure.  This was an undocumented/unsupported interface.  The "consumer" in this bug's case was an admin, and we can't really "fix" admins.  ;)

The consumer in bug #1490505, cloud-init, can be fixed with a trivial 1-line patch.  It's not clear to me that reverting the change in xfsprogs has any advantage over simply fixing the consumer properly, does it?
Comment 10 Vratislav Podzimek 2017-09-14 05:52:42 EDT
(In reply to Eric Sandeen from comment #9)
> (In reply to Colin Walters from comment #8)
> > This bug is a great example of where if we actually had the ability to
> > revert, that should have been done first.  Fix the consumers, then try again.
> 
> I'm not so sure.  This was an undocumented/unsupported interface.  The
> "consumer" in this bug's case was an admin, and we can't really "fix"
> admins.  ;)

Which brings us back/again to the discussion about the lack of APIs for file systems. Since CLI is the only option, APIs are actually built on top of it.
Comment 11 Eric Sandeen 2018-05-08 12:00:07 EDT
While recognizing that this was an unexpected and for some undesirable change, it was made intentionally.  It won't be changing back at this point, so closing.

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