Linux Btrfs filesystem development
 help / color / mirror / Atom feed
From: David Sterba <dsterba@suse.cz>
To: Qu Wenruo <wqu@suse.com>
Cc: linux-btrfs@vger.kernel.org
Subject: Re: [PATCH v2] btrfs: extent-tree: Remove dead alignment check
Date: Mon, 23 Jul 2018 14:29:51 +0200	[thread overview]
Message-ID: <20180723122951.GJ26141@twin.jikos.cz> (raw)
In-Reply-To: <20180723064729.9236-1-wqu@suse.com>

On Mon, Jul 23, 2018 at 02:47:29PM +0800, Qu Wenruo wrote:
> In find_free_extent() under checks: tag, we have the following code
> 
> ------
> 		search_start = ALIGN(offset, fs_info->stripesize);
> 		/* move on to the next group */
> 		if (search_start + num_bytes >
> 		    block_group->key.objectid + block_group->key.offset) {
> 			btrfs_add_free_space(block_group, offset, num_bytes);
> 			goto loop;
> 		}
> 		if (offset < search_start)
> 			btrfs_add_free_space(block_group, offset,
> 					     search_start - offset);
> 		BUG_ON(offset > search_start);
> ------
> 
> However ALIGN() is rounding up, thus @search_start >= @offset and that
> BUG_ON() will never be triggered.
> 
> Signed-off-by: Qu Wenruo <wqu@suse.com>

Reviewed-by: David Sterba <dsterba@suse.com>

      reply	other threads:[~2018-07-23 13:30 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-23  6:47 [PATCH v2] btrfs: extent-tree: Remove dead alignment check Qu Wenruo
2018-07-23 12:29 ` David Sterba [this message]

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=20180723122951.GJ26141@twin.jikos.cz \
    --to=dsterba@suse.cz \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=wqu@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