Bug 119971

Summary: btrfs filesystem resize doesn't accept size subtraction values
Product: File System Reporter: Karl Richter (krichter722)
Component: btrfsAssignee: David Sterba (dsterba)
Status: RESOLVED CODE_FIX    
Severity: normal CC: dsterba
Priority: P1    
Hardware: All   
OS: Linux   
Kernel Version: 4.5.5 Subsystem:
Regression: No Bisected commit-id:

Description Karl Richter 2016-06-10 13:39:31 UTC
The example from the manpage (copied in order to avoid character confusion) fails due to

    $ sudo btrfs filesystem resize -1G /
    btrfs filesystem resize: invalid option -- '1'
    usage: btrfs filesystem resize [devid:][+/-]<newsize>[kKmMgGtTpPeE]|[devid:]max <path>

        Resize a filesystem

        If 'max' is passed, the filesystem will occupy all available space
        on the device 'devid'.
        [kK] means KiB, which denotes 1KiB = 1024B, 1MiB = 1024KiB, etc.

Specifying `max` works as expected. Do you have test cases for those crucial filesystem manipulation commands?

experienced with v4.5.3 on Ubuntu 16.04
Comment 1 Karl Richter 2016-06-16 08:37:29 UTC
still an issue with v4.6
Comment 2 David Sterba 2016-06-16 09:58:20 UTC
A workaround:

sudo btrfs filesystem resize -- -1G /
Comment 3 David Sterba 2016-06-16 11:51:20 UTC
Properly fixed in git and will be released in 4.6.1.