mirror of
https://github.com/torvalds/linux.git
synced 2026-05-27 00:22:00 +02:00
xfs: check that used blocks are smaller than the write pointer
Any used block must have been written, this reject used blocks > write pointer. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Darrick J. Wong <djwong@kernel.org> Reviewed-by: Damien Le Moal <dlemoal@kernel.org> Signed-off-by: Carlos Maiolino <cem@kernel.org>
This commit is contained in:
parent
19c5b6051e
commit
b37c1e4e9a
|
|
@ -1033,6 +1033,13 @@ xfs_init_zone(
|
|||
return -EFSCORRUPTED;
|
||||
}
|
||||
|
||||
if (used > write_pointer) {
|
||||
xfs_warn(mp,
|
||||
"zone %u has used counter (0x%x) larger than write pointer (0x%x).",
|
||||
rtg_rgno(rtg), used, write_pointer);
|
||||
return -EFSCORRUPTED;
|
||||
}
|
||||
|
||||
if (write_pointer == 0 && used != 0) {
|
||||
xfs_warn(mp, "empty zone %u has non-zero used counter (0x%x).",
|
||||
rtg_rgno(rtg), used);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user