btrfs: zoned: fix calc_available_free_space() for zoned mode
calc_available_free_space() returns the total size of metadata (or
system) block groups, which can be allocated from unallocated disk
space. The logic is wrong on zoned mode in two places.
First, the calculation of data_chunk_size is wrong. We always allocate
one zone as one chunk, and no partial allocation of a zone. So, we
should use zone_size (= data_sinfo->chunk_size) as it is.
Second, the result "avail" may not be zone aligned. Since we always
allocate one zone as one chunk on zoned mode, returning non-zone size
aligned bytes will result in less pressure on the async metadata reclaim
process.
This is serious for the nearly full state with a large zone size device.
Allowing over-commit too much will result in less async reclaim work and
end up in ENOSPC. We can align down to the zone size to avoid that.
Metrics
Affected Vendors & Products
| Source | ID | Title |
|---|---|---|
Ubuntu USN |
USN-7089-1 | Linux kernel vulnerabilities |
Ubuntu USN |
USN-7089-2 | Linux kernel vulnerabilities |
Ubuntu USN |
USN-7089-3 | Linux kernel vulnerabilities |
Ubuntu USN |
USN-7089-4 | Linux kernel vulnerabilities |
Ubuntu USN |
USN-7089-5 | Linux kernel vulnerabilities |
Ubuntu USN |
USN-7089-6 | Linux kernel vulnerabilities |
Ubuntu USN |
USN-7089-7 | Linux kernel (Low Latency) vulnerabilities |
Ubuntu USN |
USN-7090-1 | Linux kernel vulnerabilities |
Ubuntu USN |
USN-7095-1 | Linux kernel vulnerabilities |
Ubuntu USN |
USN-7156-1 | Linux kernel (GKE) vulnerabilities |
Solution
No solution given by the vendor.
Workaround
No workaround given by the vendor.
Tue, 05 Nov 2024 10:15:00 +0000
| Type | Values Removed | Values Added |
|---|---|---|
| Metrics |
ssvc
|
Wed, 11 Sep 2024 18:30:00 +0000
| Type | Values Removed | Values Added |
|---|---|---|
| Metrics |
ssvc
|
Wed, 11 Sep 2024 13:30:00 +0000
| Type | Values Removed | Values Added |
|---|---|---|
| Metrics |
ssvc
|
Thu, 08 Aug 2024 23:00:00 +0000
| Type | Values Removed | Values Added |
|---|---|---|
| References |
| |
| Metrics |
threat_severity
|
threat_severity
|
Status: PUBLISHED
Assigner: Linux
Published:
Updated: 2025-05-04T09:24:39.735Z
Reserved: 2024-07-30T07:40:12.251Z
Link: CVE-2024-42231
Updated: 2024-08-02T04:54:32.610Z
Status : Modified
Published: 2024-07-30T08:15:08.307
Modified: 2024-11-21T09:33:46.177
Link: CVE-2024-42231
OpenCVE Enrichment
No data.
Ubuntu USN