Bug 1215142

Summary: wrong limit displayed in 'btrfs subvolume show'
Product: [openSUSE] openSUSE Tumbleweed Reporter: Arvin Schnell <aschnell>
Component: BasesystemAssignee: David Sterba <dsterba>
Status: NEW --- QA Contact: E-mail List <qa-bugs>
Severity: Minor    
Priority: P5 - None CC: aschnell
Version: Current   
Target Milestone: ---   
Hardware: Other   
OS: Other   
Whiteboard:
Found By: --- Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---

Description Arvin Schnell 2023-09-08 06:36:03 UTC
When setting a limit of 0 the value is not displayed correctly
in the output of 'btrfs subvolume show':

# btrfs subvolume show /test | tail -n 5
        Quota group:            0/5
          Limit referenced:     -
          Limit exclusive:      -
          Usage referenced:     16.00KiB
          Usage exclusive:      16.00KiB

The output is correct using 'btrfs qgroup show':

# btrfs qgroup show -re /test | head -3
Qgroupid    Referenced    Exclusive  Max referenced  Max exclusive   Path 
--------    ----------    ---------  --------------  -------------   ---- 
0/5           16.00KiB     16.00KiB           0.00B           none   <toplevel>

The above is plain Tumbleweed with btrfs 6.3.

The output of the experimental JSON output of 6.5 shows "0" for the limits
although no limit is set:

# ./btrfs-65-exp --format json subvolume show /test | tail -13
    "qgroup": {
      "qgroupid": "0/5",
      "limit": {
        "referenced": 0,
        "exclusive": 0
      },
      "usage": {
        "referenced": 16384,
        "exclusive": 16384
      }
    }
  }
}