RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1058608 - [RFE] btrfs-progs: btrfs resize doesn't support T/P/E suffix
Summary: [RFE] btrfs-progs: btrfs resize doesn't support T/P/E suffix
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: kernel
Version: 7.0
Hardware: All
OS: Linux
medium
medium
Target Milestone: rc
: ---
Assignee: Eric Sandeen
QA Contact: XuWang
URL:
Whiteboard:
Depends On:
Blocks: 1113520
TreeView+ depends on / blocked
 
Reported: 2014-01-28 06:54 UTC by Eryu Guan
Modified: 2015-03-05 11:39 UTC (History)
4 users (show)

Fixed In Version: kernel-3.10.0-167.el7
Doc Type: Enhancement
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-03-05 11:39:22 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2015:0290 0 normal SHIPPED_LIVE Important: kernel security, bug fix, and enhancement update 2015-03-05 16:13:58 UTC

Description Eryu Guan 2014-01-28 06:54:04 UTC
Description of problem:
Now btrfs filesystem resize <size> /mnt/btrfs doesn't support size with T/P/E suffix, only supports K/M/G.

For a file system that supports 16E fs size, the resize tool doesn't support T/P/E suffix is a bit weird.

I read the code and found that it's kernel dealing with the suffix by memparse() function in lib/cmdline.c, but still filing the RFE bug against btrfs-progs component, since I'm not sure which part we're going to update.

Version-Release number of selected component (if applicable):
btrfs-progs-3.12-3.el7

How reproducible:
always

Steps to Reproduce:
1. btrfs filesystem resize 1T /mnt/btrfs
2.
3.

Actual results:
# resize to 1T failed, EINVAL
[root@hp-dl388g8-01 ~]# btrfs fi re 1T /mnt/btrfs
Resize '/mnt/btrfs' of '1T'
ERROR: unable to resize '/mnt/btrfs' - Invalid argument

# resize to 1024G passed, this is the same as 1T
[root@hp-dl388g8-01 ~]# btrfs fi re 1024G /mnt/btrfs
Resize '/mnt/btrfs' of '1024G'
[root@hp-dl388g8-01 ~]#

Expected results:
resize supports T/P/E suffix

Additional info:

Comment 1 Wang Shilong 2014-03-22 07:26:26 UTC
ok, thanks for reporting, we will fix it.

Comment 3 Eric Sandeen 2014-06-11 18:20:43 UTC
I'll take this, odds are Ric isn't going to fix it ;)

However, it's not super-trivial to fix, and in fact requires something kernelside, due to the tortured, hacky implementation of the resize ioctl, which requires parsing strings from userspace in the kernel driver.

Today (as Eryu pointed out), that parsing is done by a function intended for RAM-scale numbers, so it only goes to gigabytes.

Comment 4 Eric Sandeen 2014-06-13 02:16:35 UTC
The patch has been sent to the btrfs & kernel lists:

    [PATCH v4] lib: add size unit t/p/e to memparse

and akpm has noticed, so I suppose it'll get merged soon.

Comment 5 RHEL Program Management 2014-06-13 02:46:27 UTC
Development Management has reviewed and declined this request.
You may appeal this decision by reopening this request.

Comment 6 Eric Sandeen 2014-06-13 02:49:09 UTC
Hohum, I misfired on dev_ack.

Comment 7 Eric Sandeen 2014-07-03 15:32:40 UTC
FWIW, this is actually a kernel bug.

Comment 8 Eric Sandeen 2014-07-07 15:15:36 UTC
Note, the patch to fix this has still not made it upstream.

Comment 9 Eric Sandeen 2014-08-09 05:07:58 UTC
From e004f3c7780de32fa822f292ebadd985bcadb1e0 Mon Sep 17 00:00:00 2001
From: Gui Hecheng <guihc.fnst.com>
Date: Wed, 6 Aug 2014 16:09:29 -0700
Subject: lib/cmdline.c: add size unit t/p/e to memparse

For modern filesystems such as btrfs, t/p/e size level operations are
common.  add size unit t/p/e parsing to memparse

Signed-off-by: Gui Hecheng <guihc.fnst.com>
Acked-by: David Rientjes <rientjes>
Reviewed-by: Satoru Takeuchi <takeuchi_satoru.com>
Signed-off-by: Andrew Morton <akpm>
Signed-off-by: Linus Torvalds <torvalds>

Comment 11 Jarod Wilson 2014-09-22 17:55:03 UTC
Patch(es) available on kernel-3.10.0-167.el7

Comment 14 XuWang 2014-12-08 07:56:58 UTC
run btrfs-progs regression test case "/btrfs-progs/Regression/bz1058608-resize-support-T_P_E" succesfully in RHEL-7.1-20141204.2 in following job:
https://beaker.engineering.redhat.com/jobs/821711.

Also run some regressions for RHEL7.1(man kernel versions, but one btrfs-progs version):
J:803063 	xfstests-btrfs: RHEL-7.1-20141113.0,s390x 
J:803061 	xfstests-btrfs: RHEL-7.1-20141113.0-ppc64
J:801031 	xfstests-btrfs: RHEL-7.1-20141111.0 
J:798051 	ltp-aiodio-btrfs: RHEL-LE-7.1-20141105.n.2
J:796795 	ltp-btrfs: RHEL-7.1-20141107.n.0, kernel-3.10.0-199.el7
Also I run some cases munually:
/kernel/filesystems/btrfs/degraded-mount-replace--panic for kernel reason
/kernel/filesystems/btrfs/profile-conversion--good
/kernel/filesystems/btrfs/online-resize--good
/kernel/filesystems/btrfs/regression--good
/kernel/filesystems/btrfs/mkfs--good
/kernel/filesystems/btrfs/mount--good
/kernel/filesystems/btrfs/clone--good
/kernel/filesystemd/btrfs/compress--good
/kernel/filesystem/btrfs/defragment--good
/kernel/filesystem/btrfs/online-device-add-delete-balance--good

So I think I can change this but status to verified.

Comment 16 errata-xmlrpc 2015-03-05 11:39:22 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.

https://rhn.redhat.com/errata/RHSA-2015-0290.html


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