linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Anand Jain <anand.jain@oracle.com>
To: dsterba@suse.cz, linux-btrfs@vger.kernel.org
Subject: Re: [PATCH v2 0/3] Misc volume patch set part2
Date: Thu, 16 Aug 2018 10:59:41 +0800	[thread overview]
Message-ID: <71234053-a677-be3c-f7b3-0418f39e0601@oracle.com> (raw)
In-Reply-To: <20180815122051.GL24025@twin.jikos.cz>



On 08/15/2018 08:20 PM, David Sterba wrote:
> On Fri, Aug 10, 2018 at 01:53:18PM +0800, Anand Jain wrote:
>> The patch set (2/3 and 3/3) adds helper function to deduce the num_device
>> (which is the number of the devices when device is mounted, this excludes
>> the seed device however includes the replacing target). We need to know
>> the num_device that actually belongs to the FSID without the replacing
>> target (if it exists) when we are balancing and or when we are trying to
>> device delete. In both of these cases, it would be wrong to consider
>> replacing target when reallocating the blockgroups.
>>
>> This patch as such does not change any of the logic which is already in
>> the original code, but instead it would bring such a logic at two
>> locations into a single place/function. But to do that as these two
>> location uses either WARN_ON or BUG_ON to perform the safety catch so
>> the first patch does the cleanup and uses ASSERT at both of these
>> places. And now since these two sections of codes are identical, the 2nd
>> patch replaces them into a helper function.
>>
>> Also though the check for num_device > 0 should actually be num_device >
>> 1 OR instead, the check of num_device > 0 should have been after the
>> num_device--,
> 
> I updated the patch following that logic now.

  Right thanks.

>> since we have had already too many comments and added
>> confusions, I shall leave that part to be fixed at sometime later. So
>> that the cleanup here is a really a cleanup instead of chaning the
>> logic in a rough scale.
>>
>> Last but not least, this patch has gone through a lot of comments on
>> either to use BUG or return -EINVAL for accidental fall of num_device
>> below 1, which I wasn't expecting so much of the concerns about
>> the use of BUG_ON/-EINVAL as its trivial because fundamentally a FS
>> can't be in the mounted state when num_device < 1.
>>
>>
>> Anand Jain (3):
>>    btrfs: drop uuid_mutex in btrfs_free_extra_devids()
>>    btrfs: assert for num_devices below 0
>>    btrfs: add helper btrfs_num_devices() to deduce num_devices
> 
> Patches 2 and 3 are applied, with some adjustments.

  Adjustments at [1] are correct.

  [1]
   gitlab.com/kdave/btrfs-devel.git misc-next

Thanks, Anand.

> The first patch
> needs another round of review as there were many changes regarding the
> device locking and uuid_mutex. I need a break from this code as the
> wounds haven't healed yet, but will add the patch to a topic branch to
> next so I don't forget about it.

      reply	other threads:[~2018-08-16  5:51 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-10  5:53 [PATCH v2 0/3] Misc volume patch set part2 Anand Jain
2018-08-10  5:53 ` [PATCH v4 1/3] btrfs: drop uuid_mutex in btrfs_free_extra_devids() Anand Jain
2018-08-10  5:53 ` [PATCH 1/2] btrfs: assert for num_devices below 0 Anand Jain
2018-08-10 10:46   ` David Sterba
2018-08-15 12:11   ` David Sterba
2018-08-16  2:09     ` Anand Jain
2018-08-10  5:53 ` [PATCH v5 2/2] btrfs: add helper btrfs_num_devices() to deduce num_devices Anand Jain
2018-08-10 10:45   ` David Sterba
2018-08-15 12:20 ` [PATCH v2 0/3] Misc volume patch set part2 David Sterba
2018-08-16  2:59   ` Anand Jain [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=71234053-a677-be3c-f7b3-0418f39e0601@oracle.com \
    --to=anand.jain@oracle.com \
    --cc=dsterba@suse.cz \
    --cc=linux-btrfs@vger.kernel.org \
    /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).