summaryrefslogtreecommitdiff
path: root/fs/xfs/xfs_log_recover.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/xfs/xfs_log_recover.c')
-rw-r--r--fs/xfs/xfs_log_recover.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/fs/xfs/xfs_log_recover.c b/fs/xfs/xfs_log_recover.c
index c634fbfea4a8..f5fb8885662f 100644
--- a/fs/xfs/xfs_log_recover.c
+++ b/fs/xfs/xfs_log_recover.c
@@ -5078,10 +5078,20 @@ xlog_recover_process_one_iunlink(
agino = be32_to_cpu(dip->di_next_unlinked);
xfs_buf_relse(ibp);
- /* Make sure the in-core data knows about this unlinked inode. */
+ /*
+ * Make sure the in-core data knows about this unlinked inode. Since
+ * our iunlinks recovery basically just deletes the head of a bucket
+ * list until the bucket is empty, we need only to add the backref from
+ * the current list item to the next one, if this isn't the list tail.
+ */
pag = xfs_perag_get(mp, agno);
pag->pagi_unlinked_count++;
+ if (agino != NULLAGINO)
+ error = xfs_iunlink_add_backref(pag, XFS_INO_TO_AGINO(mp, ino),
+ agino);
xfs_perag_put(pag);
+ if (error)
+ goto fail_iput;
/*
* Prevent any DMAPI event from being sent when the reference on