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
..
2024-11-22 15:38:37 +01:00
2023-08-29 20:21:42 -07:00
2023-08-29 20:21:42 -07:00
2025-02-08 09:51:43 +01:00
2023-08-28 11:39:14 -07:00
2023-08-29 20:21:42 -07:00
2023-08-29 20:21:42 -07:00
2025-02-21 13:57:19 +01:00
2025-02-17 09:40:42 +01:00
2025-01-09 13:31:54 +01:00
2023-08-28 09:31:32 -07:00
2023-07-13 10:28:05 +02:00
2024-08-19 06:04:25 +02:00
2024-10-04 16:29:48 +02:00
2024-01-20 11:51:37 +01:00
2023-08-28 10:17:14 -07:00
2025-02-08 09:51:41 +01:00
2024-10-04 16:29:48 +02:00
2024-12-27 13:58:50 +01:00
2023-08-29 20:21:42 -07:00
2025-01-17 13:36:11 +01:00
2025-01-17 13:36:10 +01:00
2023-08-29 17:45:22 -04:00
2024-08-03 08:54:15 +02:00
2025-02-01 18:37:55 +01:00
2025-02-08 09:52:35 +01:00
2024-10-22 15:46:20 +02:00
2023-08-29 20:21:42 -07:00
2024-12-09 10:31:45 +01:00
2024-09-12 11:11:26 +02:00
2025-02-01 18:37:52 +01:00
2025-01-23 17:21:13 +01:00
2024-12-09 10:31:45 +01:00
2025-02-11 09:37:33 +01:00
2023-08-29 20:21:42 -07:00
2024-02-23 09:25:16 +01:00
2025-01-23 17:21:14 +01:00
2024-04-13 13:07:34 +02:00
2025-01-17 13:36:09 +01:00
2024-12-14 20:00:21 +01:00
2024-12-14 20:00:07 +01:00
2024-08-29 17:33:33 +02:00
2024-08-19 06:04:23 +02:00
2023-08-29 20:21:42 -07:00
2023-09-18 12:03:46 -07:00
2025-02-21 13:57:11 +01:00
2025-02-21 13:57:06 +01:00
2025-02-17 09:40:37 +01:00
2023-08-31 12:07:34 -05:00
2025-01-23 17:21:19 +01:00
2023-08-29 20:21:42 -07:00
2025-01-09 13:31:46 +01:00
2025-02-17 09:40:42 +01:00
2023-08-29 20:21:42 -07:00
2024-06-12 11:11:30 +02:00
2025-02-21 13:57:12 +01:00
2025-01-23 17:21:19 +01:00
2025-02-17 09:40:15 +01:00
2025-02-08 09:51:42 +01:00
2023-08-29 20:21:42 -07:00
2023-08-29 20:21:42 -07:00
2024-12-09 10:33:01 +01:00
2023-07-24 10:30:04 +02:00
2024-08-19 06:04:26 +02:00
2024-08-19 06:04:25 +02:00
2025-02-17 09:40:17 +01:00
2024-09-12 11:11:39 +02:00
2024-04-27 17:11:41 +02:00
2024-04-13 13:07:34 +02:00
2024-09-12 11:11:27 +02:00
2025-02-08 09:52:28 +01:00
2025-01-09 13:31:50 +01:00
2023-08-29 20:21:42 -07:00
2024-12-14 20:00:20 +01:00
2024-05-17 12:02:13 +02:00
2024-06-16 13:47:33 +02:00
2025-02-27 04:10:44 -08:00
2024-02-23 09:25:13 +01:00
2024-04-03 15:28:44 +02:00
2023-08-28 10:17:14 -07:00
2023-08-11 09:04:57 +02:00
2024-08-29 17:33:33 +02:00
2024-09-12 11:11:29 +02:00
2025-02-17 09:40:16 +01:00
2024-08-29 17:33:27 +02:00
2025-02-08 09:52:26 +01:00
2024-11-08 16:28:19 +01:00
2024-07-25 09:50:54 +02:00
2023-06-28 10:28:11 -07:00
2023-08-18 10:12:11 -07:00
2023-07-11 11:41:34 +02:00
2024-12-27 13:58:57 +01:00
2025-02-17 09:40:03 +01:00
2024-10-04 16:29:56 +02:00
2024-08-19 06:04:28 +02:00
2025-02-08 09:51:42 +01:00
2025-01-23 17:21:13 +01:00
2023-10-12 18:53:36 +03:00
2023-08-21 13:46:25 -07:00
2024-06-27 13:49:00 +02:00
2023-08-14 18:48:02 +02:00
2024-12-09 10:31:41 +01:00
2023-08-29 20:21:42 -07:00
2024-01-31 16:18:54 -08:00
2025-01-17 13:36:26 +01:00
2023-08-23 14:17:43 -07:00
2023-08-19 12:12:12 +02:00
2025-02-01 18:37:54 +01:00
2024-07-27 11:34:10 +02:00
2023-08-02 09:13:09 -06:00
2024-10-04 16:29:48 +02:00
2024-10-04 16:28:51 +02:00
2023-07-13 10:28:04 +02:00
2024-11-01 01:58:32 +01:00
2024-04-10 16:35:57 +02:00
2023-07-13 10:28:04 +02:00
2023-08-15 08:32:45 +02:00
2023-08-06 15:08:35 +02:00
2025-02-08 09:51:43 +01:00
2023-08-29 14:25:26 -07:00
2023-07-13 10:28:04 +02:00
2023-12-03 07:33:03 +01:00
2024-08-19 06:04:25 +02:00
2024-07-18 13:21:22 +02:00
2024-09-12 11:11:38 +02:00