public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Dave Chinner <david@fromorbit.com>
To: "Darrick J. Wong" <djwong@kernel.org>
Cc: linux-xfs@vger.kernel.org, chandanbabu@kernel.org
Subject: [PATCH v2 2/2] xfs: use kvfree() in xlog_cil_free_logvec()
Date: Tue, 27 Feb 2024 14:01:26 +1100	[thread overview]
Message-ID: <Zd1QhmIB/SzPDoDf@dread.disaster.area> (raw)
In-Reply-To: <20240227004621.GN616564@frogsfrogsfrogs>

From: Dave Chinner <dchinner@redhat.com>

The xfs_log_vec items are allocated by xlog_kvmalloc(), and so need
to be freed with kvfree. This was missed when coverting from the
kmem_free() API.

Reported-by: Chandan Babu R <chandanbabu@kernel.org>
Fixes: 49292576136f ("xfs: convert kmem_free() for kvmalloc users to kvfree()")
Signed-off-by: Dave Chinner <dchinner@redhat.com>
---

Version 2:
- also fix kfree() in xlog_cil_process_intents().
- checked that kvfree() is used for all lip->li_lv_shadow freeing
  calls.

 fs/xfs/xfs_log_cil.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/fs/xfs/xfs_log_cil.c b/fs/xfs/xfs_log_cil.c
index f15735d0296a..4d52854bcb29 100644
--- a/fs/xfs/xfs_log_cil.c
+++ b/fs/xfs/xfs_log_cil.c
@@ -877,7 +877,7 @@ xlog_cil_free_logvec(
 	while (!list_empty(lv_chain)) {
 		lv = list_first_entry(lv_chain, struct xfs_log_vec, lv_list);
 		list_del_init(&lv->lv_list);
-		kfree(lv);
+		kvfree(lv);
 	}
 }
 
@@ -1717,7 +1717,7 @@ xlog_cil_process_intents(
 		set_bit(XFS_LI_WHITEOUT, &ilip->li_flags);
 		trace_xfs_cil_whiteout_mark(ilip);
 		len += ilip->li_lv->lv_bytes;
-		kfree(ilip->li_lv);
+		kvfree(ilip->li_lv);
 		ilip->li_lv = NULL;
 
 		xfs_trans_del_item(lip);

  parent reply	other threads:[~2024-02-27  3:01 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-27  0:05 [PATCH 0/2] xfs: kmalloc/kfree conversion fixes Dave Chinner
2024-02-27  0:05 ` [PATCH 1/2] xfs: xfs_btree_bload_prep_block() should use __GFP_NOFAIL Dave Chinner
2024-02-27  0:47   ` Darrick J. Wong
2024-02-27 14:48   ` Christoph Hellwig
2024-02-27  0:05 ` [PATCH 2/2] xfs: use kvfree() in xlog_cil_free_logvec() Dave Chinner
2024-02-27  0:46   ` Darrick J. Wong
2024-02-27  2:37     ` Dave Chinner
2024-02-27  3:01     ` Dave Chinner [this message]
2024-02-27  4:25       ` [PATCH v2 " Darrick J. Wong
2024-02-28  2:31         ` Darrick J. Wong
2024-02-27  8:45       ` Chandan Babu R
2024-02-27 14:48       ` Christoph Hellwig

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Zd1QhmIB/SzPDoDf@dread.disaster.area \
    --to=david@fromorbit.com \
    --cc=chandanbabu@kernel.org \
    --cc=djwong@kernel.org \
    --cc=linux-xfs@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox