Re: [PATCH] mm: fix nr_rotate_swap leak in swapon() error case

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, 2018-05-16 at 10:56 -0700, Omar Sandoval wrote:
> From: Omar Sandoval <osandov@xxxxxx>
> 
> If swapon() fails after incrementing nr_rotate_swap, we don't
> decrement
> it and thus effectively leak it. Make sure we decrement it if we
> incremented it.

My first inclination when reading this patch was
"surely there must be a better way to structure
the error code", but given that swap on rotating
media increments this count, while swap on SSD
does not, and the rotating media and SSD code
paths are 90% the same, my first inclination
was wrong.

Thanks for catching and fixing that bug.

> Fixes: 81a0298bdfab ("mm, swap: don't use VMA based swap readahead if
> HDD is used as swap")
> Signed-off-by: Omar Sandoval <osandov@xxxxxx>

Reviewed-by: Rik van Riel <riel@xxxxxxxxxxx>

-- 
All Rights Reversed.

Attachment: signature.asc
Description: This is a digitally signed message part


[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux