xfs
[Top] [All Lists]

[PATCH 2/4] xfs: recovery of XLOG_UNMOUNT_TRANS leaks memory

To: xfs@xxxxxxxxxxx
Subject: [PATCH 2/4] xfs: recovery of XLOG_UNMOUNT_TRANS leaks memory
From: Dave Chinner <david@xxxxxxxxxxxxx>
Date: Tue, 26 Aug 2014 11:21:39 +1000
Delivered-to: xfs@xxxxxxxxxxx
In-reply-to: <1409016101-9511-1-git-send-email-david@xxxxxxxxxxxxx>
References: <1409016101-9511-1-git-send-email-david@xxxxxxxxxxxxx>
From: Dave Chinner <dchinner@xxxxxxxxxx>

It aborts recovery without freeing the current trans structure that
we are decoding.

Signed-off-by: Dave Chinner <dchinner@xxxxxxxxxx>
---
 fs/xfs/xfs_log_recover.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/fs/xfs/xfs_log_recover.c b/fs/xfs/xfs_log_recover.c
index 1970732f..460cf98 100644
--- a/fs/xfs/xfs_log_recover.c
+++ b/fs/xfs/xfs_log_recover.c
@@ -3587,8 +3587,9 @@ xlog_recovery_process_ophdr(
        /* unexpected flag values */
        case XLOG_UNMOUNT_TRANS:
                xfs_warn(log->l_mp, "%s: Unmount LR", __func__);
-               error = 0;
-               break;
+               xlog_recover_free_trans(trans);
+               return 0;
+
        case XLOG_START_TRANS:
                xfs_warn(log->l_mp, "%s: bad transaction 0x%x", __func__, tid);
                ASSERT(0);
-- 
2.0.0

<Prev in Thread] Current Thread [Next in Thread>