All of lore.kernel.org
 help / color / mirror / Atom feed
From: taskboxtester@gmail.com
To: "Darrick J. Wong" <darrick.wong@oracle.com>
Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org,
	akpm@linux-foundation.org, ying.huang@intel.com
Subject: Re: [PATCH] mm: kvfree the swap cluster info if the swap file is unsatisfactory
Date: Thu, 31 Aug 2017 19:41:25 -0400	[thread overview]
Message-ID: <5d2dc29d-0593-4c06-b3e9-bd12a8f9d172@gmail.com> (raw)
In-Reply-To: <20170831233515.GR3775@magnolia>

[-- Attachment #1: Type: text/plain, Size: 980 bytes --]

taskboxtester@gmail.com liked your message with Boxer for Android.


On Aug 31, 2017 7:36 PM, "Darrick J. Wong" <darrick.wong@oracle.com> wrote:

If initializing a small swap file fails because the swap file has a
problem (holes, etc.) then we need to free the cluster info as part of
cleanup.  Unfortunately a previous patch changed the code to use
kvzalloc but did not change all the vfree calls to use kvfree.

Found by running generic/357 from xfstests.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
---
mm/swapfile.c |    2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mm/swapfile.c b/mm/swapfile.c
index 6ba4aab..c1deb01 100644
--- a/mm/swapfile.c
+++ b/mm/swapfile.c
@@ -3052,7 +3052,7 @@ SYSCALL_DEFINE2(swapon, const char __user *, specialfile, int, swap_flags)
p->flags = 0;
spin_unlock(&swap_lock);
vfree(swap_map);
-vfree(cluster_info);
+kvfree(cluster_info);
if (swap_file) {
if (inode && S_ISREG(inode->i_mode)) {
inode_unlock(inode);


[-- Attachment #2: Type: text/html, Size: 1556 bytes --]

  reply	other threads:[~2017-08-31 23:41 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-31 23:35 [PATCH] mm: kvfree the swap cluster info if the swap file is unsatisfactory Darrick J. Wong
2017-08-31 23:35 ` Darrick J. Wong
2017-08-31 23:41 ` taskboxtester [this message]
2017-09-01  1:33 ` Huang, Ying
2017-09-01  1:33   ` Huang, Ying
2017-09-01  8:33 ` David Rientjes
2017-09-01  8:33   ` David Rientjes
2017-09-04  0:58   ` Huang, Ying
2017-09-04  0:58     ` Huang, Ying

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=5d2dc29d-0593-4c06-b3e9-bd12a8f9d172@gmail.com \
    --to=taskboxtester@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=darrick.wong@oracle.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=ying.huang@intel.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.