Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1724721
| From | "Huang\, Ying" <ying.huang@intel.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH] mm: kvfree the swap cluster info if the swap file is unsatisfactory |
| Date | 2017-09-01 03:40 +0200 |
| Message-ID | <ukJ6a-5dR-13@gated-at.bofh.it> (permalink) |
| References | <ukHe4-3XZ-53@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
"Darrick J. Wong" <darrick.wong@oracle.com> writes:
> 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>
Thanks for fixing!
Reviewed-by: "Huang, Ying" <ying.huang@intel.com>
Best Regards,
Huang, Ying
> ---
> 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);
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH] mm: kvfree the swap cluster info if the swap file is unsatisfactory "Darrick J. Wong" <darrick.wong@oracle.com> - 2017-09-01 01:40 +0200
Re: [PATCH] mm: kvfree the swap cluster info if the swap file is unsatisfactory "Huang\, Ying" <ying.huang@intel.com> - 2017-09-01 03:40 +0200
Re: [PATCH] mm: kvfree the swap cluster info if the swap file is unsatisfactory David Rientjes <rientjes@google.com> - 2017-09-01 10:40 +0200
Re: [PATCH] mm: kvfree the swap cluster info if the swap file is unsatisfactory "Huang\, Ying" <ying.huang@intel.com> - 2017-09-04 03:00 +0200
csiph-web