Bugzilla will be upgraded to version 5.0. The upgrade date is tentatively scheduled for 2 December 2018, pending final testing and feedback.
Bug 1058608 - [RFE] btrfs-progs: btrfs resize doesn't support T/P/E suffix
[RFE] btrfs-progs: btrfs resize doesn't support T/P/E suffix
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: kernel (Show other bugs)
7.0
All Linux
medium Severity medium
: rc
: ---
Assigned To: Eric Sandeen
XuWang
: FutureFeature, Reopened
Depends On:
Blocks: 1113520
  Show dependency treegraph
 
Reported: 2014-01-28 01:54 EST by Eryu Guan
Modified: 2015-03-05 06:39 EST (History)
4 users (show)

See Also:
Fixed In Version: kernel-3.10.0-167.el7
Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2015-03-05 06:39:22 EST
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-2015:0290 normal SHIPPED_LIVE Important: kernel security, bug fix, and enhancement update 2015-03-05 11:13:58 EST

  None (edit)
Description Eryu Guan 2014-01-28 01:54:04 EST
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 03:26:26 EDT
ok, thanks for reporting, we will fix it.
Comment 3 Eric Sandeen 2014-06-11 14:20:43 EDT
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-12 22:16:35 EDT
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 Product and Program Management 2014-06-12 22:46:27 EDT
Development Management has reviewed and declined this request.
You may appeal this decision by reopening this request.
Comment 6 Eric Sandeen 2014-06-12 22:49:09 EDT
Hohum, I misfired on dev_ack.
Comment 7 Eric Sandeen 2014-07-03 11:32:40 EDT
FWIW, this is actually a kernel bug.
Comment 8 Eric Sandeen 2014-07-07 11:15:36 EDT
Note, the patch to fix this has still not made it upstream.
Comment 9 Eric Sandeen 2014-08-09 01:07:58 EDT
From e004f3c7780de32fa822f292ebadd985bcadb1e0 Mon Sep 17 00:00:00 2001
From: Gui Hecheng <guihc.fnst@cn.fujitsu.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@cn.fujitsu.com>
Acked-by: David Rientjes <rientjes@google.com>
Reviewed-by: Satoru Takeuchi <takeuchi_satoru@jp.fujitsu.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Comment 11 Jarod Wilson 2014-09-22 13:55:03 EDT
Patch(es) available on kernel-3.10.0-167.el7
Comment 14 XuWang 2014-12-08 02:56:58 EST
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 06:39:22 EST
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.