]> git.baikalelectronics.ru Git - kernel.git/commit
xfs: don't write a corrupt unmount record to force summary counter recalc
authorDarrick J. Wong <darrick.wong@oracle.com>
Thu, 26 Mar 2020 17:26:44 +0000 (10:26 -0700)
committerDarrick J. Wong <darrick.wong@oracle.com>
Fri, 27 Mar 2020 15:32:55 +0000 (08:32 -0700)
commit608a625c90c80e97fdeeb9dbc3951881a50d2b6f
tree8809895a4919094a26906a454c4f6079192346fb
parentb3d68ca32f58af94a4cc8ed28b37d1b91a763561
xfs: don't write a corrupt unmount record to force summary counter recalc

In commit a9c79f18bd864, I added the ability to force a recalculation of
the filesystem summary counters if they seemed incorrect.  This was done
(not entirely correctly) by tweaking the log code to write an unmount
record without the UMOUNT_TRANS flag set.  At next mount, the log
recovery code will fail to find the unmount record and go into recovery,
which triggers the recalculation.

What actually gets written to the log is what ought to be an unmount
record, but without any flags set to indicate what kind of record it
actually is.  This worked to trigger the recalculation, but we shouldn't
write bogus log records when we could simply write nothing.

Fixes: a9c79f18bd864 ("xfs: force summary counter recalc at next mount")
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Brian Foster <bfoster@redhat.com>
fs/xfs/xfs_log.c