]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit
xfs: reinitialise per-AG structures if geometry changes during recovery
authorDave Chinner <dchinner@redhat.com>
Sun, 6 Mar 2016 21:39:36 +0000 (08:39 +1100)
committerDave Chinner <david@fromorbit.com>
Sun, 6 Mar 2016 21:39:36 +0000 (08:39 +1100)
commita798011c8fd4286605b990c1722c16903fc14b7a
tree224b54a169cebc15d38d39beefd8772ca669b45b
parent12877da58429affc988403817b88d901fe01f8c1
xfs: reinitialise per-AG structures if geometry changes during recovery

If a crash occurs immediately after a filesystem grow operation, the
updated superblock geometry is found only in the log. After we
recover the log, the superblock is reread and re-initialised and so
has the new geometry in memory. If the new geometry has more AGs
than prior to the grow operation, then the new AGs will not have
in-memory xfs_perag structurea associated with them.

This will result in an oops when the first metadata buffer from a
new AG is looked up in the buffer cache, as the block lies within
the new geometry but then fails to find a perag structure on lookup.
This is easily fixed by simply re-initialising the perag structure
after re-reading the superblock at the conclusion of the first pahse
of log recovery.

This, however, does not fix the case of log recovery requiring
access to metadata in the newly grown space. Fortunately for us,
because the in-core superblock has not been updated, this will
result in detection of access beyond the end of the filesystem
and so recovery will fail at that point. If this proves to be
a problem, then we can address it separately to the current
reported issue.

Reported-by: Alex Lyakas <alex@zadarastorage.com>
Tested-by: Alex Lyakas <alex@zadarastorage.com>
Signed-off-by: Dave Chinner <dchinner@redhat.com>
fs/xfs/xfs_log_recover.c