@@ -474,6 +474,8 @@ xfs_defer_relog(
ASSERT((*tpp)->t_flags & XFS_TRANS_PERM_LOG_RES);
list_for_each_entry(dfp, dfops, dfp_list) {
+ struct xfs_log_item *lip;
+
/*
* If the log intent item for this deferred op is not a part of
* the current log checkpoint, relog the intent item to keep
@@ -502,9 +504,12 @@ xfs_defer_relog(
XFS_STATS_INC((*tpp)->t_mountp, defer_relog);
xfs_defer_create_done(*tpp, dfp);
- dfp->dfp_intent = xfs_trans_item_relog(dfp->dfp_intent,
- dfp->dfp_done, *tpp);
+ lip = xfs_trans_item_relog(dfp->dfp_intent, dfp->dfp_done,
+ *tpp);
+ if (lip)
+ set_bit(XFS_LI_DIRTY, &lip->li_flags);
dfp->dfp_done = NULL;
+ dfp->dfp_intent = lip;
}
if ((*tpp)->t_flags & XFS_TRANS_DIRTY)
@@ -655,7 +655,6 @@ xfs_attri_item_relog(
new_attrp->alfi_attr_filter = old_attrp->alfi_attr_filter;
xfs_trans_add_item(tp, &new_attrip->attri_item);
- set_bit(XFS_LI_DIRTY, &new_attrip->attri_item.li_flags);
return &new_attrip->attri_item;
}
@@ -586,7 +586,7 @@ xfs_bui_item_relog(
memcpy(buip->bui_format.bui_extents, map, count * sizeof(*map));
atomic_set(&buip->bui_next_extent, count);
xfs_trans_add_item(tp, &buip->bui_item);
- set_bit(XFS_LI_DIRTY, &buip->bui_item.li_flags);
+
return &buip->bui_item;
}
@@ -709,7 +709,7 @@ xfs_efi_item_relog(
memcpy(efip->efi_format.efi_extents, extp, count * sizeof(*extp));
atomic_set(&efip->efi_next_extent, count);
xfs_trans_add_item(tp, &efip->efi_item);
- set_bit(XFS_LI_DIRTY, &efip->efi_item.li_flags);
+
return &efip->efi_item;
}
@@ -547,7 +547,7 @@ xfs_cui_item_relog(
memcpy(cuip->cui_format.cui_extents, pmap, count * sizeof(*pmap));
atomic_set(&cuip->cui_next_extent, count);
xfs_trans_add_item(tp, &cuip->cui_item);
- set_bit(XFS_LI_DIRTY, &cuip->cui_item.li_flags);
+
return &cuip->cui_item;
}
@@ -600,7 +600,7 @@ xfs_rui_item_relog(
memcpy(ruip->rui_format.rui_extents, map, count * sizeof(*map));
atomic_set(&ruip->rui_next_extent, count);
xfs_trans_add_item(tp, &ruip->rui_item);
- set_bit(XFS_LI_DIRTY, &ruip->rui_item.li_flags);
+
return &ruip->rui_item;
}