public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] xfs: free the efi AIL entry on log recovery failure
@ 2013-12-05 21:40 Mark Tinguely
  2013-12-05 22:32 ` Dave Chinner
  0 siblings, 1 reply; 4+ messages in thread
From: Mark Tinguely @ 2013-12-05 21:40 UTC (permalink / raw)
  To: xfs

[-- Attachment #1: xfs-remove-efi-entry-before-log-unmount.patch --]
[-- Type: text/plain, Size: 1401 bytes --]

If freeing an extent fails during recovery, then the filesystem
will be forced down with the EFI entry still on the AIL. This
will result in hanging the function xfs_ail_push_all_sync().

This patch is similar to the patches that removed the dquot and
inode in commits 32ce90a and dea9609.

Found by mounting an metadata dump that triggers a
XFS_WANT_CORRUPTED_RETURN() on log recovery.

Signed-off-by: Mark Tinguely <tinguely@sgi.com>
---
 fs/xfs/xfs_log_recover.c |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

Index: b/fs/xfs/xfs_log_recover.c
===================================================================
--- a/fs/xfs/xfs_log_recover.c
+++ b/fs/xfs/xfs_log_recover.c
@@ -3668,7 +3668,7 @@ xlog_recover_process_efi(
 		extp = &(efip->efi_format.efi_extents[i]);
 		error = xfs_free_extent(tp, extp->ext_start, extp->ext_len);
 		if (error)
-			goto abort_error;
+			goto free_abort;
 		xfs_trans_log_efd_extent(tp, efdp, extp->ext_start,
 					 extp->ext_len);
 	}
@@ -3677,6 +3677,9 @@ xlog_recover_process_efi(
 	error = xfs_trans_commit(tp, 0);
 	return error;
 
+free_abort:
+	set_bit(XFS_EFI_RECOVERED, &efip->efi_flags);
+	xfs_efi_release(efip, efip->efi_format.efi_nextents);
 abort_error:
 	xfs_trans_cancel(tp, XFS_TRANS_ABORT);
 	return error;


_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

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

end of thread, other threads:[~2013-12-05 23:54 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-12-05 21:40 [PATCH] xfs: free the efi AIL entry on log recovery failure Mark Tinguely
2013-12-05 22:32 ` Dave Chinner
2013-12-05 23:06   ` Mark Tinguely
2013-12-05 23:54     ` Dave Chinner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox