public inbox for linux-btrfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Nikolay Borisov <nborisov@suse.com>
To: robbieko <robbieko@synology.com>, linux-btrfs@vger.kernel.org
Subject: Re: [PATCH] btrfs: fix page leaks after failure to lock page for delalloc
Date: Mon, 20 Jul 2020 09:36:34 +0300	[thread overview]
Message-ID: <291edcf5-cada-2d14-ddc8-d5103ce87ffe@suse.com> (raw)
In-Reply-To: <20200720014209.11485-1-robbieko@synology.com>



On 20.07.20 г. 4:42 ч., robbieko wrote:
> From: Robbie Ko <robbieko@synology.com>
> 
> 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@synology.com>

Reviewed-by: Nikolay Borisov <nborisov@suse.com>

> ---
>  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;
>  				}
> 

  reply	other threads:[~2020-07-20  6:36 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-20  1:42 [PATCH] btrfs: fix page leaks after failure to lock page for delalloc robbieko
2020-07-20  6:36 ` Nikolay Borisov [this message]
2020-07-20 15:34 ` David Sterba

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=291edcf5-cada-2d14-ddc8-d5103ce87ffe@suse.com \
    --to=nborisov@suse.com \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=robbieko@synology.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox