Skip to content

Commit 3512fc1

Browse files
Dave Chinnerdchinner
authored andcommitted
xfs: whiteouts release intents that are not in the AIL
When we release an intent that a whiteout applies to, it will not have been committed to the journal and so won't be in the AIL. Hence when we drop the last reference to the intent, we do not want to try to remove it from the AIL as that will trigger a filesystem shutdown. Hence make the removal of intents from the AIL conditional on them actually being in the AIL so we do the correct thing. Signed-off-by: Dave Chinner <[email protected]> Reviewed-by: Allison Henderson <[email protected]> Reviewed-by: Darrick J. Wong <[email protected]> Signed-off-by: Dave Chinner <[email protected]>
1 parent c23ab60 commit 3512fc1

File tree

4 files changed

+20
-16
lines changed

4 files changed

+20
-16
lines changed

fs/xfs/xfs_bmap_item.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,11 @@ xfs_bui_release(
5555
struct xfs_bui_log_item *buip)
5656
{
5757
ASSERT(atomic_read(&buip->bui_refcount) > 0);
58-
if (atomic_dec_and_test(&buip->bui_refcount)) {
59-
xfs_trans_ail_delete(&buip->bui_item, SHUTDOWN_LOG_IO_ERROR);
60-
xfs_bui_item_free(buip);
61-
}
58+
if (!atomic_dec_and_test(&buip->bui_refcount))
59+
return;
60+
61+
xfs_trans_ail_delete(&buip->bui_item, 0);
62+
xfs_bui_item_free(buip);
6263
}
6364

6465

fs/xfs/xfs_extfree_item.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,10 +58,11 @@ xfs_efi_release(
5858
struct xfs_efi_log_item *efip)
5959
{
6060
ASSERT(atomic_read(&efip->efi_refcount) > 0);
61-
if (atomic_dec_and_test(&efip->efi_refcount)) {
62-
xfs_trans_ail_delete(&efip->efi_item, SHUTDOWN_LOG_IO_ERROR);
63-
xfs_efi_item_free(efip);
64-
}
61+
if (!atomic_dec_and_test(&efip->efi_refcount))
62+
return;
63+
64+
xfs_trans_ail_delete(&efip->efi_item, 0);
65+
xfs_efi_item_free(efip);
6566
}
6667

6768
/*

fs/xfs/xfs_refcount_item.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,11 @@ xfs_cui_release(
5454
struct xfs_cui_log_item *cuip)
5555
{
5656
ASSERT(atomic_read(&cuip->cui_refcount) > 0);
57-
if (atomic_dec_and_test(&cuip->cui_refcount)) {
58-
xfs_trans_ail_delete(&cuip->cui_item, SHUTDOWN_LOG_IO_ERROR);
59-
xfs_cui_item_free(cuip);
60-
}
57+
if (!atomic_dec_and_test(&cuip->cui_refcount))
58+
return;
59+
60+
xfs_trans_ail_delete(&cuip->cui_item, 0);
61+
xfs_cui_item_free(cuip);
6162
}
6263

6364

fs/xfs/xfs_rmap_item.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,11 @@ xfs_rui_release(
5454
struct xfs_rui_log_item *ruip)
5555
{
5656
ASSERT(atomic_read(&ruip->rui_refcount) > 0);
57-
if (atomic_dec_and_test(&ruip->rui_refcount)) {
58-
xfs_trans_ail_delete(&ruip->rui_item, SHUTDOWN_LOG_IO_ERROR);
59-
xfs_rui_item_free(ruip);
60-
}
57+
if (!atomic_dec_and_test(&ruip->rui_refcount))
58+
return;
59+
60+
xfs_trans_ail_delete(&ruip->rui_item, 0);
61+
xfs_rui_item_free(ruip);
6162
}
6263

6364
STATIC void

0 commit comments

Comments
 (0)