Re: “Bug”-report: inconsistency kernel <-> tools
From: Goffredo Baroncelli <hidden>
Date: 2012-08-31 19:07:55
On 08/30/2012 08:24 PM, Goffredo Baroncelli wrote:
And magically the filesystem is now composed by three disks. However 4 physical devices are show. This because the disk /dev/vdi superblock says that the disk is still valid (after the "btrfs device del" the disk is not touched any more)
I have to correct myself. When a device is removed its superblock is
zero-ed (from btrfs_rm_device():
[...]
/*
* at this point, the device is zero sized. We want to
* remove it from the devices list and zero out the old super
*/
if (clear_super) {
/* make sure this device isn't detected as part of
* the FS anymore
*/
memset(&disk_super->magic, 0, sizeof(disk_super->magic));
set_buffer_dirty(bh);
sync_dirty_buffer(bh);
}
[...]
clear_super is set to true when the device is writeable.
However making a test I found both the behaviours: sometime the removed
disk disappears from the output of "btrfs fi show" and sometime not...
May be that there is a bug somewhere...