mirror of
https://github.com/linux-msm/laptops-kernel.git
synced 2026-08-13 14:19:53 -07: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:
committed by
Carlos Maiolino
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);
|
||||
|
||||
Reference in New Issue
Block a user