summaryrefslogtreecommitdiff
path: root/fs/xfs/xfs_sysfs.c
diff options
context:
space:
mode:
authorBrian Foster <bfoster@redhat.com>2016-01-05 07:40:16 +1100
committerDave Chinner <david@fromorbit.com>2016-01-05 07:40:16 +1100
commit7088c4136fa1cba26531fde40bdcfcf3d2ccd533 (patch)
treefad3a925305250a3628c0c7dc7fedac65843a2fe /fs/xfs/xfs_sysfs.c
parenteed6b462fb2a2661a416c227be6498b0ea2a7aab (diff)
xfs: detect and trim torn writes during log recovery
Certain types of storage, such as persistent memory, do not provide sector atomicity for writes. This means that if a crash occurs while XFS is writing log records, only part of those records might make it to the storage. This is problematic because log recovery uses the cycle value packed at the top of each log block to locate the head/tail of the log. This can lead to CRC verification failures during log recovery and an unmountable fs for a filesystem that is otherwise consistent. Update log recovery to incorporate log record CRC verification as part of the head/tail discovery process. Once the head is located via the traditional algorithm, run a CRC-only pass over the records up to the head of the log. If CRC verification fails, assume that the records are torn as a matter of policy and trim the head block back to the start of the first bad record. Signed-off-by: Brian Foster <bfoster@redhat.com> Reviewed-by: Dave Chinner <dchinner@redhat.com> Signed-off-by: Dave Chinner <david@fromorbit.com>
Diffstat (limited to 'fs/xfs/xfs_sysfs.c')
0 files changed, 0 insertions, 0 deletions