Re: [PATCH] btrfs: fix page leaks after failure to lock page for delalloc

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

 




On 20.07.20 г. 4:42 ч., robbieko wrote:
> From: Robbie Ko <robbieko@xxxxxxxxxxxx>
> 
> When locking pages for delalloc, we check if it's dirty and mapping still
> matches, if it does not match, we will return -EAGAIN and release all
> pages.
> 
> Signed-off-by: Robbie Ko <robbieko@xxxxxxxxxxxx>

Reviewed-by: Nikolay Borisov <nborisov@xxxxxxxx>

> ---
>  fs/btrfs/extent_io.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c
> index 68c96057ad2d..22fc47f9c900 100644
> --- a/fs/btrfs/extent_io.c
> +++ b/fs/btrfs/extent_io.c
> @@ -1999,7 +1999,8 @@ static int __process_pages_contig(struct address_space *mapping,
>  				if (!PageDirty(pages[i]) ||
>  				    pages[i]->mapping != mapping) {
>  					unlock_page(pages[i]);
> -					put_page(pages[i]);
> +					for (; i < ret; i++)
> +						put_page(pages[i]);
>  					err = -EAGAIN;
>  					goto out;
>  				}
> 



[Index of Archives]     [Linux Filesystem Development]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux