All of lore.kernel.org
 help / color / mirror / Atom feed
From: Miao Xie <miaox@cn.fujitsu.com>
To: <bo.li.liu@oracle.com>
Cc: <linux-btrfs@vger.kernel.org>
Subject: Re: [PATCH 1/2] Btrfs: fix wrong missing device counter decrease
Date: Thu, 17 Jul 2014 11:21:06 +0800	[thread overview]
Message-ID: <53C74122.7080902@cn.fujitsu.com> (raw)
In-Reply-To: <20140717023756.GA4271@localhost.localdomain>

On Thu, 17 Jul 2014 10:37:57 +0800, Liu Bo wrote:
> On Wed, Jul 16, 2014 at 06:38:01PM +0800, Miao Xie wrote:
>> The missing devices are accounted by its own fs device, for example
>> the missing devices in seed filesystem will be accounted by the fs device
>> of the seed filesystem, not by the new filesystem which is based on
>> the seed filesystem, so when we remove the missing device in the
>> seed filesystem, we should decrease the counter of its own fs device.
>> Fix it.
>>
>> Signed-off-by: Miao Xie <miaox@cn.fujitsu.com>
>> ---
>> This patch is against:
>> [PATCH 8/9] Btrfs: fix unzeroed members in fs_devices when creating a fs from seed fs
>> ---
>>  fs/btrfs/volumes.c | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c
>> index daecfa5..4cfbe76 100644
>> --- a/fs/btrfs/volumes.c
>> +++ b/fs/btrfs/volumes.c
>> @@ -1723,7 +1723,7 @@ int btrfs_rm_device(struct btrfs_root *root, char *device_path)
>>  	device->fs_devices->total_devices--;
>>  
>>  	if (device->missing)
>> -		root->fs_info->fs_devices->missing_devices--;
>> +		device->fs_devices->missing_devices--;
> 
> But it is 'root->fs_info->fs_devices->missing_devices' that is increased in the
> case of both read_one_dev() and add_missing_dev().
> 
> Well, in add_missing_dev(), they're consistent, but in read_one_dev(),
> device->fs_devices could be a seed one, while root->fs_info->fs_devices is not.

This is another bug, I will fix it later.

Thanks
Miao

> 
> Am I missing?
> 
> -liubo
> 
>>  
>>  	next_device = list_entry(root->fs_info->fs_devices->devices.next,
>>  				 struct btrfs_device, dev_list);
>> -- 
>> 1.9.3
>>
>> --
>> To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
>> the body of a message to majordomo@vger.kernel.org
>> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> .
> 


      reply	other threads:[~2014-07-17  3:19 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-16 10:38 [PATCH 1/2] Btrfs: fix wrong missing device counter decrease Miao Xie
2014-07-17  2:37 ` Liu Bo
2014-07-17  3:21   ` Miao Xie [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=53C74122.7080902@cn.fujitsu.com \
    --to=miaox@cn.fujitsu.com \
    --cc=bo.li.liu@oracle.com \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.