Darrick J. Wong
4534162e09
xfs: don't over-report free space or inodes in statvfs
...
[ Upstream commit 4b8d867ca6e2fc6d152f629fdaf027053b81765a ]
Emmanual Florac reports a strange occurrence when project quota limits
are enabled, free space is lower than the remaining quota, and someone
runs statvfs:
# mkfs.xfs -f /dev/sda
# mount /dev/sda /mnt -o prjquota
# xfs_quota -x -c 'limit -p bhard=2G 55' /mnt
# mkdir /mnt/dir
# xfs_io -c 'chproj 55' -c 'chattr +P' -c 'stat -vvvv' /mnt/dir
# fallocate -l 19g /mnt/a
# df /mnt /mnt/dir
Filesystem Size Used Avail Use% Mounted on
/dev/sda 20G 20G 345M 99% /mnt
/dev/sda 2.0G 0 2.0G 0% /mnt
I think the bug here is that xfs_fill_statvfs_from_dquot unconditionally
assigns to f_bfree without checking that the filesystem has enough free
space to fill the remaining project quota. However, this is a
longstanding behavior of xfs so it's unclear what to do here.
Cc: <stable@vger.kernel.org > # v2.6.18
Fixes: 932f2c3231 ("[XFS] statvfs component of directory/project quota support, code originally by Glen.")
Reported-by: Emmanuel Florac <eflorac@intellique.com >
Signed-off-by: "Darrick J. Wong" <djwong@kernel.org >
Reviewed-by: Christoph Hellwig <hch@lst.de >
Signed-off-by: Sasha Levin <sashal@kernel.org >
2025-02-27 04:10:44 -08:00
..
2025-02-27 04:10:43 -08:00
2024-12-27 13:58:45 +01:00
2024-12-27 13:58:44 +01:00
2022-01-15 16:30:29 +02:00
2021-10-22 16:00:31 -07:00
2023-08-10 07:48:09 -07:00
2023-07-24 10:30:06 +02:00
2023-01-19 09:24:27 +01:00
2024-10-22 15:46:23 +02:00
2023-09-12 10:31:07 -07:00
2024-10-22 15:46:23 +02:00
2022-05-23 08:43:46 +10:00
2024-10-22 15:46:23 +02:00
2022-07-14 12:14:33 -06:00
2024-04-03 15:28:47 +02:00
2021-10-22 16:04:20 -07:00
2024-12-27 13:58:45 +01:00
2024-10-22 15:46:24 +02:00
2025-02-27 04:10:43 -08:00
2024-12-27 13:58:44 +01:00
2022-04-21 10:46:40 +10:00
2024-04-03 15:28:48 +02:00
2024-04-03 15:28:48 +02:00
2023-04-11 19:05:05 -07:00
2023-03-19 09:55:49 -07:00
2022-10-04 16:39:58 +11:00
2023-10-04 09:25:04 +11:00
2023-10-04 09:24:02 +11:00
2024-02-16 19:10:46 +01:00
2024-12-27 13:58:44 +01:00
2021-08-06 11:05:36 -07:00
2024-10-22 15:46:21 +02:00
2022-05-11 17:12:09 +10:00
2023-04-11 18:59:59 -07:00
2023-04-11 18:59:59 -07:00
2023-02-10 08:59:48 -08:00
2023-02-09 18:36:17 -08:00
2023-09-24 18:12:13 -07:00
2023-10-11 12:35:21 -07:00
2023-10-04 09:24:52 +11:00
2024-04-03 15:28:47 +02:00
2022-10-31 08:58:20 -07:00
2024-12-27 13:58:44 +01:00
2024-12-27 13:58:44 +01:00
2025-02-27 04:10:44 -08:00
2023-02-13 09:14:56 +11:00
2024-12-27 13:58:46 +01:00
2020-10-07 08:40:29 -07:00
2025-02-27 04:10:43 -08:00
2021-02-03 09:18:50 -08:00
2023-02-09 18:36:17 -08:00
2021-08-19 10:07:13 -07:00
2025-02-27 04:10:42 -08:00
2023-09-11 08:39:03 -07:00
2022-05-04 11:45:11 +10:00
2021-10-22 16:04:20 -07:00
2024-02-16 19:10:45 +01:00
2024-12-27 13:58:44 +01:00
2023-06-05 04:08:27 +10:00
2025-02-27 04:10:44 -08:00
2025-02-27 04:10:44 -08:00
2023-01-19 09:24:29 +01:00
2022-01-18 10:18:36 -08:00
2025-02-27 04:10:44 -08:00
2023-01-19 09:24:27 +01:00
2025-02-17 09:40:31 +01:00
2022-11-29 09:09:17 +11:00
2024-12-27 13:58:44 +01:00
2024-12-27 13:58:44 +01:00
2023-09-24 18:12:13 -07:00
2023-01-19 09:24:29 +01:00
2023-04-11 18:59:55 -07:00
2022-07-14 11:47:42 +10:00
2023-04-11 18:59:55 -07:00
2022-04-13 07:02:44 +00:00
2023-08-10 07:48:07 -07:00
2025-02-27 04:10:43 -08:00
2024-04-03 15:28:46 +02:00
2025-02-27 04:10:43 -08:00
2024-04-03 15:28:46 +02:00
2025-02-27 04:10:43 -08:00
2022-04-21 16:45:03 +10:00
2022-05-27 10:31:34 +10:00
2025-02-27 04:10:43 -08:00
2023-09-12 10:31:07 -07:00
2021-10-22 16:04:20 -07:00
2023-10-12 10:11:56 +05:30
2023-07-17 08:48:56 -07:00
2023-01-19 09:24:02 +01:00
2021-02-03 09:18:49 -08:00
2021-02-03 09:18:49 -08:00
2025-02-27 04:10:44 -08:00
2022-06-23 13:34:38 -07:00
2023-09-24 18:12:13 -07:00
2022-05-11 17:12:09 +10:00
2021-08-09 10:52:18 -07:00
2022-05-11 17:12:09 +10:00
2024-04-03 15:28:47 +02:00
2021-10-22 16:04:20 -07:00
2025-02-27 04:10:42 -08:00
2025-02-27 04:10:42 -08:00
2024-04-03 15:28:47 +02:00
2021-10-22 16:04:20 -07:00
2024-12-27 13:58:46 +01:00
2024-04-03 15:28:46 +02:00
2022-09-19 06:48:14 +10:00
2020-10-07 08:40:28 -07:00
2025-02-27 04:10:44 -08:00
2023-08-10 07:48:07 -07:00
2024-12-27 13:58:44 +01:00
2023-01-19 09:24:28 +01:00
2023-04-13 11:49:35 -07:00
2022-05-11 17:01:22 +10:00
2023-02-10 08:59:48 -08:00
2023-02-10 08:59:48 -08:00
2022-11-28 17:24:35 -08:00
2024-11-08 16:28:26 +01:00
2023-06-29 09:28:23 -07:00
2021-08-19 10:07:14 -07:00
2022-05-11 17:12:09 +10:00
2022-07-07 18:55:59 +10:00
2024-12-19 18:11:25 +01:00
2024-06-21 14:38:45 +02:00
2023-09-12 10:31:08 -07:00
2022-05-27 10:34:04 +10:00
2024-12-27 13:58:44 +01:00