All of lore.kernel.org
 help / color / mirror / Atom feed
* extfree log recovery and owner (rmapbt) updates
@ 2017-12-05 18:55 Brian Foster
  2017-12-05 23:32 ` Darrick J. Wong
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Brian Foster @ 2017-12-05 18:55 UTC (permalink / raw)
  To: linux-xfs

Hi,

I've been playing around with deferring AGFL block frees and noticed
something funky going on with xfs_bmap_add_free() and owner info. We
pass the extent owner info to xfs_bmap_add_free() in various places to
transfer this info to the deferred free processing context.
Subsequently, xfs_trans_free_extent() -> ... -> xfs_free_ag_extent()
uses the owner info to remove the rmapbt entry associated with the
extent. The rmapbt update occurs at the time the extent is freed.

If the system crashes immediately after the initial transaction commits,
however, EFI recovery calls xfs_trans_free_extent() with an "unknown"
owner. I see a reference to using a "wildcard" in this context in some
of the old rmapbt commits, but it looks like this codepath skips the
rmapbt update altogether if oi_owner == XFS_RMAP_OWN_UNKNOWN. A quick
test that shuts down the fs immediately after a transaction commits that
logs an EFI for a freed inode chunk leaves the fs inconsistent after log
recovery, with a bit of a cryptic message from repair:

  unknown block state, ag 0, block 24

It does look like the associated rmapbt entry still exists in the tree
even though the extent has been freed (from xfs_db -c fsmap):

5: 0/24 len 8 owner -7 offset 0 bmbt 0 attrfork 0 extflag 0                                                            

So what is supposed to be going on here? Should the rmapbt entry be
removed unconditionally during recovery, or should a separate rmapbt
update item be deferred (as in the bunmapi case, for example) rather
than passing oinfo along with the TYPE_FREE deferred item? Or something
else entirely..?

Brian

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2017-12-07 13:00 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-12-05 18:55 extfree log recovery and owner (rmapbt) updates Brian Foster
2017-12-05 23:32 ` Darrick J. Wong
2017-12-05 23:34 ` [RFC PATCH] xfs: always honor OWN_UNKNOWN rmap removal requests Darrick J. Wong
2017-12-06 14:14   ` Brian Foster
2017-12-06 17:53     ` Darrick J. Wong
2017-12-06 20:49       ` Brian Foster
2017-12-06 22:06         ` Darrick J. Wong
2017-12-07 13:00           ` Brian Foster
2017-12-05 23:49 ` extfree log recovery and owner (rmapbt) updates Dave Chinner

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.