]> www.infradead.org Git - users/jedix/linux-maple.git/commit
xfs: use EFI refcount consistently in log recovery
authorBrian Foster <bfoster@redhat.com>
Tue, 18 Aug 2015 23:52:21 +0000 (09:52 +1000)
committerJack Vogel <jack.vogel@oracle.com>
Mon, 9 Apr 2018 23:01:15 +0000 (16:01 -0700)
commitc23ec20dd15554282f1440b184ae7a9cd76a4730
treeec7db8bfc8548717c172a4e3828af3a50d0c400d
parent1ac857d001ab686783c650b93c73e79b30ce217f
xfs: use EFI refcount consistently in log recovery

[ Upstream commit e32a1d1fbf6eb2bdc24aa0502e827ff4d2234604 ]

The EFI is initialized with a reference count of 2. One for the EFI to
ensure the item makes it to the AIL and one for the subsequently created
EFD to release the EFI once the EFD is committed. Log recovery uses the
EFI in a similar manner, but implements a hack to remove both references
in one call once the EFD is handled.

Update log recovery to use EFI reference counting in a manner consistent
with the log. When an EFI is encountered during recovery, an EFI item is
allocated and inserted to the AIL directly. Since the EFI reference is
typically dropped when the EFI is unpinned and this is analogous with
AIL insertion, drop the EFI reference at this point.

When a corresponding EFD is encountered in the log, this indicates that
the extents were freed, no processing is required and the EFI can be
dropped. Update xlog_recover_efd_pass2() to simply drop the EFD
reference at this point rather than open code the AIL removal and EFI
free.

Remaining EFIs (i.e., with no corresponding EFD) are processed in
xlog_recover_finish(). An EFD transaction is allocated and the extents
are freed, which transfers ownership of the EFI reference to the EFD
item in the log.

Orabug: 27609404
Signed-off-by: Brian Foster <bfoster@redhat.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: wen.gang.wang@oracle.com
Reviewed-by: Allison Henderson <allison.henderson@oracle.com>
fs/xfs/xfs_extfree_item.c
fs/xfs/xfs_log_recover.c