linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Anand Jain <anand.jain@oracle.com>
To: Nikolay Borisov <nborisov@suse.com>, linux-btrfs@vger.kernel.org
Subject: Re: [PATCH 5/5] btrfs: Replace BUG_ON with ASSERT in find_lock_delalloc_range
Date: Sat, 17 Nov 2018 09:02:36 +0800	[thread overview]
Message-ID: <c9c00cc5-64b0-1860-53c5-a9d54c6d06f6@oracle.com> (raw)
In-Reply-To: <1540554201-11305-6-git-send-email-nborisov@suse.com>



On 10/26/2018 07:43 PM, Nikolay Borisov wrote:
> lock_delalloc_pages should only return 2 values - 0 in case of success
> and -EAGAIN if the range of pages to be locked should be shrunk due to
> some of gone. Manual inspections confirms that this is
> indeed the case since __process_pages_contig is where lock_delalloc_pages
> gets its return value. The latter always returns 0  or -EAGAIN so the
> invariant holds. No functional changes.
> 
> Signed-off-by: Nikolay Borisov <nborisov@suse.com>

Reviewed-by: Anand Jain <anand.jain@oracle.com>

Thanks, Anand

> ---
>   fs/btrfs/extent_io.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c
> index 1a9a521aefe5..94bc53472031 100644
> --- a/fs/btrfs/extent_io.c
> +++ b/fs/btrfs/extent_io.c
> @@ -1606,6 +1606,7 @@ static noinline_for_stack u64 find_lock_delalloc_range(struct inode *inode,
>   	/* step two, lock all the pages after the page that has start */
>   	ret = lock_delalloc_pages(inode, locked_page,
>   				  delalloc_start, delalloc_end);
> +	ASSERT(!ret || ret == -EAGAIN);
>   	if (ret == -EAGAIN) {
>   		/* some of the pages are gone, lets avoid looping by
>   		 * shortening the size of the delalloc range we're searching
> @@ -1621,7 +1622,6 @@ static noinline_for_stack u64 find_lock_delalloc_range(struct inode *inode,
>   			goto out_failed;
>   		}
>   	}
> -	BUG_ON(ret); /* Only valid values are 0 and -EAGAIN */
>   
>   	/* step three, lock the state bits for the whole range */
>   	lock_extent_bits(tree, delalloc_start, delalloc_end, &cached_state);
> 

  parent reply	other threads:[~2018-11-17  1:02 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-26 11:43 [PATCH 0/5] Misc cleanups in balance code Nikolay Borisov
2018-10-26 11:43 ` [PATCH 1/5] btrfs: Ensure at least 1g is free for balance Nikolay Borisov
2018-10-26 12:04   ` Qu Wenruo
2018-10-26 12:08     ` Nikolay Borisov
2018-10-26 12:32       ` Qu Wenruo
2018-10-26 12:09   ` Hans van Kranenburg
2018-10-26 12:16     ` Nikolay Borisov
2018-10-26 12:36       ` Hans van Kranenburg
2018-10-26 11:43 ` [PATCH 2/5] btrfs: Refactor btrfs_can_relocate Nikolay Borisov
2018-10-26 12:35   ` Qu Wenruo
2018-11-17  1:29   ` Anand Jain
2018-12-03 17:25     ` David Sterba
2018-12-04  6:34       ` Nikolay Borisov
2018-12-04 13:07         ` David Sterba
2018-10-26 11:43 ` [PATCH 3/5] btrfs: Remove superfluous check form btrfs_remove_chunk Nikolay Borisov
2018-10-26 12:40   ` Qu Wenruo
2018-11-16 23:57   ` Anand Jain
2018-10-26 11:43 ` [PATCH 4/5] btrfs: Sink find_lock_delalloc_range's 'max_bytes' argument Nikolay Borisov
2018-10-26 12:42   ` Qu Wenruo
2018-11-17  0:53   ` Anand Jain
2018-10-26 11:43 ` [PATCH 5/5] btrfs: Replace BUG_ON with ASSERT in find_lock_delalloc_range Nikolay Borisov
2018-10-26 12:44   ` Qu Wenruo
2018-11-17  1:02   ` Anand Jain [this message]
2018-11-16 15:18 ` [PATCH 0/5] Misc cleanups in balance code David Sterba
2018-11-16 15:36   ` Nikolay Borisov

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=c9c00cc5-64b0-1860-53c5-a9d54c6d06f6@oracle.com \
    --to=anand.jain@oracle.com \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=nborisov@suse.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;
as well as URLs for NNTP newsgroup(s).