Skip to content

Conversation

@shartse
Copy link
Contributor

@shartse shartse commented May 18, 2018

Update bdev_capacity to have wholedisk vdevs query the size of the underlying block device (correcting for the size of the efi parition and partition alignment) and therefore detect expanded space.

Correct vdev_get_stats_ex so that the expandsize is aligned to metaslab size and new space is only reported if it is large enough for a new metaslab.

Description

vdev_disk_open uses the partition size to determine the device size (even if it’s a whole-disk vdev), and therefore doesn't notice if the device has grown. Calling get_capacity on the block device itself gives the total size of the device, expansion and all. This entire capacity isn’t actually available to the vdev - we need to correct for the size of the EFI boot label partition and the partition alignment space.

zfs should only be reporting new space if there’s enough of it to allocate a new metaslab. This merge 0f676dc from openzfs should have fixed that, but line 2924 was left in place, meaning that esize is overwritten after it was aligned.

Motivation and Context

In theory you should be able to resize a device, call zpool reopen, see additional expandsize with zpool list -v and then add that space to the vdev with zpool online -e. On Linux, the new size is not detected. This change corrects this by addressing the issues described in the previous section.

How Has This Been Tested?

These changes were tested by running the device expansion workflows described above on ZoL installations running on vmware, aws and azure.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Performance enhancement (non-breaking change which improves efficiency)
  • Code cleanup (non-breaking change which makes code smaller or more readable)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation (a change to man pages or other documentation)

Checklist:

  • My code follows the ZFS on Linux code style requirements.
  • I have updated the documentation accordingly.
  • I have read the contributing document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.
  • All commit messages are properly formatted and contain Signed-off-by.
  • Change has been approved by a ZFS on Linux member.

@ahrens ahrens requested review from ahrens and behlendorf May 18, 2018 17:21
@ahrens
Copy link
Member

ahrens commented May 18, 2018

Looking at the Ubuntu 18.04 tests, I think it's saying that it hung after 70 minutes without any new output:
http://build.zfsonlinux.org/builders/Ubuntu%2018.04%20x86_64%20%28TEST%29/builds/168/steps/shell_8/logs/stdio
command timed out: 4200 seconds without output running ['runurl', 'https://raw.githubusercontent.com/zfsonlinux/zfs-buildbot/master/scripts/bb-test-zfstests.sh'], attempting to kill

The last thing in the log is:

Test: /usr/share/zfs/zfs-tests/tests/functional/cli_root/zpool_reopen/setup (run as root) [00:01] [PASS]
04:29:39.48 SUCCESS: modprobe scsi_debug dev_size_mb=256 add_host=1 num_tgts=1 max_luns=1 sector_size=512 physblk_exp=0

Tip: to view the log, use curl http://build.zfsonlinux.org/builders/Ubuntu%2018.04%20x86_64%20%28TEST%29/builds/168/steps/shell_8/logs/log | less, since Chrome has a hard time rendering such a huge file. The URL is from "Ubuntu 18.04 (TEST) -> Details -> zfstests failed -> log -> copy link address"

@behlendorf
Copy link
Contributor

behlendorf commented May 18, 2018

Often in cases like this the hang is because an ASSERT/VERIFY was hit which by default isn't configured to panic the system only halts the offending process for analysis. When this happens, if the bot was able to dump its console logs you should be able to get a stack trace. For example, in this case the CentOS 7 TEST builder's console log has the reason why.

http://build.zfsonlinux.org/builders/CentOS%207%20x86_64%20%28TEST%29/builds/2881/steps/shell_8/logs/console

[ 7352.154093] ZFS: zio error=5 type=1 offset=270336 size=8192 flags=b08c1
[ 7352.157983] VERIFY3(io_offset + io_size <= bdev->bd_inode->i_size) failed (18446744073698557952 <= 257949696)
[ 7352.163195] PANIC at vdev_disk.c:555:__vdev_disk_physio()
[ 7352.166399] Showing stack for process 31472
[ 7352.168994] CPU: 0 PID: 31472 Comm: vdev_open Kdump: loaded Tainted: P           OE  ------------   3.10.0-862.2.3.el7.x86_64 #1
[ 7352.175749] Hardware name: Xen HVM domU, BIOS 4.2.amazon 08/24/2006
[ 7352.179493] Call Trace:
[ 7352.181424]  [<ffffffff8510d78e>] dump_stack+0x19/0x1b
[ 7352.184572]  [<ffffffffc06c9614>] spl_dumpstack+0x44/0x50 [spl]
[ 7352.188008]  [<ffffffffc06c96e9>] spl_panic+0xc9/0x110 [spl]
[ 7352.191383]  [<ffffffff85123161>] ? ftrace_call+0x5/0x2f
[ 7352.194672]  [<ffffffff85123161>] ? ftrace_call+0x5/0x2f
[ 7352.198063]  [<ffffffffc08b8fd1>] __vdev_disk_physio.constprop.11+0x2c1/0x350 [zfs]
[ 7352.202461]  [<ffffffffc08b91bf>] vdev_disk_io_start+0x9f/0x1d0 [zfs]
[ 7352.206393]  [<ffffffffc0937cb6>] zio_vdev_io_start+0xf6/0x5b0 [zfs]
[ 7352.210154]  [<ffffffffc093460c>] zio_nowait+0x11c/0x310 [zfs]
[ 7352.213894]  [<ffffffffc08af846>] vdev_probe+0x2c6/0x360 [zfs]
[ 7352.217458]  [<ffffffffc08b27e0>] ? vdev_writeable+0x40/0x40 [zfs]
[ 7352.221262]  [<ffffffffc08b55c3>] vdev_open+0x5a3/0x8a0 [zfs]
[ 7352.224974]  [<ffffffffc08b5a72>] vdev_open_child+0x22/0x40 [zfs]
[ 7352.229365]  [<ffffffffc06c6c8b>] taskq_thread+0x2eb/0x610 [spl]
[ 7352.232970]  [<ffffffff84acee80>] ? wake_up_state+0x20/0x20
[ 7352.236548]  [<ffffffffc06c69a0>] ? taskq_thread_should_stop.part.3+0x70/0x70 [spl]
[ 7352.240933]  [<ffffffff84abae31>] kthread+0xd1/0xe0
[ 7352.244263]  [<ffffffff84abad60>] ? insert_kthread_work+0x40/0x40
[ 7352.248077]  [<ffffffff8511f5f7>] ret_from_fork_nospec_begin+0x21/0x21
[ 7352.252173]  [<ffffffff84abad60>] ? insert_kthread_work+0x40/0x40

@shartse
Copy link
Contributor Author

shartse commented May 19, 2018

I've been trying to reproduce these failure locally on a Ubuntu 17.10 VMWare VM. So far I haven't been able to get a clean run of the zfs_reload tests just based on master. The issue I'm seeing is zpool_reopen_001_pos and zpool_reopen_002_pos timeout during wait_for_resilver_end. Does this sound like a familiar issue to anyone?

* we will still be 1m aligned. Some devices are sensitive to the
* partition ending alignment as well.
*/
#define NEW_START_BLOCK 2048
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit. Would vdev_disk.h be OK for this disk-specific content?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems reasonable


/* Otherwise assume the full device capacity */
return (get_capacity(bdev->bd_disk) << 9);
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Disks can also be partition-less, typically seen in multi-path configurations. Not sure if we need a third case here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it makes sense to have a third case, at least to match the behavior of the previous implementation. I'm thinking something like this:

    if (part)
        if (wholedev) 
            // corrected capacity
        else:
            //partsize
    else:
       get_capacity(bdev->bd_disk)

@shartse shartse force-pushed the detect-expandsize-zol branch from 092e34b to e460842 Compare May 22, 2018 01:01
return (available << 9);
} else {
/* The partition capacity referenced by the block device */
return (part->nr_sects << 9);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: while we're here let's use SECTOR_BITS instead of 9. It's defined by the kernel and will always be 9.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good

/* Sectors available to the vdev */
uint64_t available = sectors - used;
/* Bytes available to the vdev */
return (available << 9);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Even though wholedisk is set we should add an additional sanity check to verify we never expand in to an existing partition. You can use bdev->bd_contains to access the full block device (/dev/sda) instead of the partition.

The on-disk partition table also somehow needs to be updated to reflect the new expanded size. Otherwise, there's no visibility from user space that this space is in use and it will be reported by gparted and other tools as free space. Since the kernel does support online resizing of partitions have you considered instead updating the on-disk partition table and then triggering a rescan with __blkdev_reread_part(). That should result in an updated part->nr_sects which reflects the new expanded size.

Copy link
Contributor Author

@shartse shartse May 22, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. Sure - I'll look into that.

  2. It's my understanding that the partition table should not be updated until zfs has decided to actually use the new space (i.e. the user runs zpool online -e). At which point the partition is relabeled by zpool_relabel_disk in zpool_vdev_online. I verified that parted showed unused, extra space after the new space was detected but showed the new sized partition (with no unused space) after I ran zpool online -e. I tried this work flow on illumos for comparison and the behavior seems similar: fdisk did not see the new space until it was explicitly onlined. Granted, this was all tested with autoexpand set to off, but I can test autoexpand cases as well.
    I did consider triggering a scan from vdev_disk_open with __blkdev_reread_part() but I don't think that makes sense given what I wrote above. Also, initial attempts at that failed because the BLKRRPART ioctl returns EBUSY for open devices making it unusable for hot-expansion.

Copy link
Contributor

@behlendorf behlendorf May 22, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. zpool online -e

Ahh I see. OK that's reasonable, I'd forgotten the zpool online -e would do the relabel, In that case I think the only remaining issue is to the make sure we don't accidentally stomp on an existing partition (1. above).

Copy link
Contributor Author

@shartse shartse May 22, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool. Should that check be something like bdev == bdev->bd_contains - to make sure that this is the "whole" disk? I'm a little unsure if that makes sense, because a zfs wholedisk configured device should actually have two partitions. Do we want to check that there are only two partitions on the vdev, one of which is the EFI partition size? Or is there some other check I'm not thinking of?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we'd ideally like to scan the kernel's version of the partition table for conflicting partitions. But it looks like the functions needed to easily do this aren't available. So why don't we go with your suggestion and simply verify bdev != bdev->bd_contain and bdev->bd_contain->bd_part_count == 2. The primary EFI partition and legacy partition 9.

Speaking of which, is partition 9 recreated when zpool online -e is run and moved to the new end of the device? What is the illumos behavior here?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One other thing. With your fix in place we should be able to re-enable the zpool_expand_001_pos and zpool_expand_003_neg.ksh tests case which are currently being skipped.

The expansion tests currently create pools on zvols, which can occasionally result in a deadlock, so you might need to adapt them to use a scsi_debug or loopback device. There are some helper function for this in blkdev.shlib. I believe you'll also need to create a zedlet script for the zed to run zpool online -e when the expansion event is received.

Copy link
Contributor Author

@shartse shartse May 23, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure of the benefit of this kind of check. We only called zpool_relabel_disk if wholedisk is true. My understanding is that if wholedisk is true, ZFS believes that it is the only user of the device - let me know if this is wrong.

zpool_relabel_disk is the only caller of efi_use_whole_disk and in efi_use_whole_disk we assume that the reserved partition is the very last partition and that the zfs data partition is the one that comes just before that. That means that if we reach zpool_relabel_disk with a configuration like the following, it would be misinterpreted with B as reserved and reserved as ZFS data. The only way to tell something was wrong would be to notice that there are more than 2 partitions - i.e. we were wrong about the value of wholedisk.

-------------------------------------------------------------------------------
|      A     |            ZFS Data            | reserved |        B          |     
-------------------------------------------------------------------------------

In the following case where efi_use_whole_disk gets the correct values for ZFS data and reserved, a check which verified the only partition in the expanded region is reserved partition would by true by definition since it's already been defined as the last partition. Should this type of configuration be valid for a ZFS wholedisk setup?

---------------------------------------------------------------------
|      A        |            ZFS Data                 | reserved   |     
---------------------------------------------------------------------

My core concern is that we identify partitions based on their relative position to each other and to the end of the partition table, so checking that one only extends into the other doesn't seem meaningful.

Are there other issues that you think we could catch here?

===============
I'll take a look at the zpool expand tests and try and evaluate how much work it would be to get them operational - if it ends up being really involved I might not be able to get to them for awhile.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Though apparently efi_nparts is 128 - so we just care about `physically non-zero partitions'.

Copy link
Contributor

@behlendorf behlendorf May 23, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if wholedisk is true ZFS believes that it is the only user of the device - let me know if this is wrong.

This is definiitely what ZFS believes, unfortunately that doesn't necessarily make it true. The end goal is just to add some logic to verify this is the case before doing the expansion so we do no harm. Even if the admin did something like expand device and manually create a new partition+ext4 filesystem in the B space from your example above.

My core concern is that we identify partitions based on their relative position to each other and to the end of the partition table.

That's definitely not ideal, but it looks like we can improve things in this area. Since the reserved partition is created as part of zpool create, when wholedisk is set, we have a little more information we can use to uniquely indentify it. Then we won't have to rely on it being the last partition. We know:

  • vtoc->efi_parts[].p_size == EFI_MIN_RESV_SIZE, and
  • vtoc->efi_parts[].p_tag == V_RESERVED, and
  • it will always be partition number 9 (index 8).

Copy link
Contributor Author

@shartse shartse May 23, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the clarification - I was starting to doubt everything... I agree that we're treating partitions a little more fast and loose than would be ideal.

Ah, ok, cool! So in efi_use_whole_disk we could add checks that the partition we're treating as the the reserved partition (the last one we find in the table) is actually the one we created. If so, then we're safe to expand because there's no next partition. If not, we should give up because the wholedisk assumption is no longer valid and we have no idea what we might be expanding into.

@shartse shartse force-pushed the detect-expandsize-zol branch 3 times, most recently from da7965b to fd457a0 Compare May 23, 2018 23:11
Copy link
Contributor

@behlendorf behlendorf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Functionally this looks good, it just needs the test cases re-enabled and updated. Let me know if you have any questions about the test suite.

@shartse
Copy link
Contributor Author

shartse commented May 24, 2018

I've started going through the tests and also comparing the work flows to those on Illumos. I agree that I need to make a zpool online -e zedlet - presumably to handle the ESC_ZFS_VDEV_AUTOEXPAND zevent created in spa_async_autoexpand. We call spa_async_autoexpand from the spa_async_thread based on the SPA_ASYNC_AUTOEXPAND task. However, as far as I can tell, this task only ever occurs in spa_import. How do we expect it to get kicked off without re-importing the pool? I've looked the at the code paths in Illumos and it's the same thing. Maybe I'm mis-understanding what autoexpand should being doing, but I can't tell how it would ever work.

@shartse
Copy link
Contributor Author

shartse commented May 25, 2018

In fact, zpool_expand_001_pos is an expected failure in the illumos test suite (zpool_expand_003_neg passes just because it expects autoexpand not to work).

I believe that the changes I've made in this PR wouldn't actually help either zpool_expand_001_pos to pass or zpool_expand_003_neg to be meaningful. Even if I do add the zeflet to do the actual online-ing, it wouldn't be triggered by these tests.

I think my plan will be to improve on or add some manual expand tests that exercise the feature I've added - namely the ability for the user to see newly available space and leave the autoexpand work for a different PR. That work would include a) adding the zedlet and b) either changing the autoexpand tests to re-import the pools or adding autoexpand events elsewhere than just spa_import

@behlendorf
Copy link
Contributor

@shartse thanks for checking the test results on Illumos. I've always assumed these tests worked on Illumos, but from looking at the source code it was never clear to me why. It's good to know I wasn't confused.

In order to get these tests working on Linux I figured we'd leverage the udev block device events generated by the kernel. The ZED receives events from two sources, 1) the zfs kernel modules and 2) the udev monitor via libudev. The udev stream is how we get notified of things like device addition/removal.

Since this is the standard mechanism on Linux I assumed there would be a device capacity change event we could use. Unfortunately, now that I'm looking closely at the kernel source it looks like only a console log message gets generated in check_disk_size_change(). So that's not going to work, bummer.

I think my plan will be to improve on or add some manual expand tests that exercise the feature I've added

Given the circumstances I agree that sounds like the best way forward.

@shartse
Copy link
Contributor Author

shartse commented May 25, 2018

Yeah, it's pretty odd. It's possible that autoexpand used to work the way it was outlined in the test, but maybe the test was disabled for flakiness reasons and the behavior diverged.

Or it's possible that was expected to work on illumos because these are just zvol tests: in zvol_update_live_volsize we generate a LUN expansion event - ESC_DEV_DLE. In the corresponding zvol_update_live_volsize in ZoL there's a TODO about needing to generate an event of some kind (presumably a zevent, now). So that plus a online -e zedlet would probably be the true fix for this particular test. Still doesn't answer any questions about autoexpand for block devices on illumos though - we don't seem to have any tests for them.

The udev stream is how we get notified of things like device addition/removal.

Right - that makes sense. I went down a udev rabbit-hole awhile back as well - it seems like change uevents just aren't terribly common from scsi device drivers.

Lots of room for improvement - I hope to straighten out some of the autoexpand questions in the future.

@grwilson
Copy link
Member

The autoexpand case in illumos (outside of zvols) is triggered by the sd driver. This happens when the driver receives a unit attention (typically 0x2a/0x09 CAPACITY DATA HAS CHANGED). If the capacity has changed then it generates anESC_DEV_DLE event. This event is handled by systeventd which ends up calling zpool_vdev_online for any device which has the autoexpand property set.

It looks like newer linux kernels handle this unit attention and generate a udev event. If zed could listen for this event then it should be able to follow a similar model to syseventd as described above. The uevent that corresponds to the 0x2a/0x09 unit attention is SDEV_UA=CAPACITY_DATA_HAS_CHANGED.

struct hd_struct *part = bdev->bd_part;
uint64_t sectors = get_capacity(bdev->bd_disk);
/* If there are no paritions, return the entire device capacity */
if (!part)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NIT: if (part == NULL)

@shartse shartse force-pushed the detect-expandsize-zol branch from fd457a0 to 5d7a279 Compare May 25, 2018 21:07
@shartse shartse requested a review from jwk404 May 25, 2018 21:08
@shartse shartse force-pushed the detect-expandsize-zol branch from 5d7a279 to 3424397 Compare May 25, 2018 21:14
"$autoexp"
fi
typeset prev_size=$(get_pool_prop size $TESTPOOL1)
typeset zfs_prev_size=$(zfs get -p avail $TESTPOOL1 | tail -1 | \
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know it's not your change, but this could be typeset zfs_prev_size=$(get_prop avail $TESTPOOL1)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure - just changed it.

@shartse shartse force-pushed the detect-expandsize-zol branch from 3424397 to a33a32f Compare May 25, 2018 22:00
@shartse
Copy link
Contributor Author

shartse commented May 29, 2018

@behlendorf It looks like there's a zloop failure, similar to this: #6434
I'm running zloop locally to try and reproduce but I haven't seen it so far. Have you seen failures like this showing up lately?

@behlendorf
Copy link
Contributor

@shartse yes sorry about that, this is a known issue we occasionally see with ztest where the mmp IO can get starved resulting in the pool being suspended. It's pretty rare, but is most likely to manifest itself in a resource contained VM. The failure here isn't related to your patch so this is ready to go.

@behlendorf
Copy link
Contributor

@shartse this needs one last rebase on master to resolve the conflict. Then it looks ready to me.

@shartse shartse force-pushed the detect-expandsize-zol branch 2 times, most recently from c58e482 to 36049e1 Compare May 30, 2018 17:58
@shartse shartse force-pushed the detect-expandsize-zol branch from ef77366 to 0b97924 Compare May 30, 2018 21:40
Update bdev_capacity to have wholedisk vdevs query the
size of the underlying block device (correcting for the size
of the efi parition and partition alignment) and therefore detect
expanded space.

Correct vdev_get_stats_ex so that the expandsize is aligned
to metaslab size and new space is only reported if it is large
enough for a new metaslab.

External-issue: LX-165
Signed-off-by: sara hartse <sara.hartse@delphix.com>
@shartse shartse force-pushed the detect-expandsize-zol branch from 0b97924 to b7e45dd Compare May 30, 2018 21:44
@codecov
Copy link

codecov bot commented May 31, 2018

Codecov Report

Merging #7546 into master will increase coverage by 0.34%.
The diff coverage is 58.82%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #7546      +/-   ##
==========================================
+ Coverage   77.38%   77.72%   +0.34%     
==========================================
  Files         362      362              
  Lines      110288   110299      +11     
==========================================
+ Hits        85342    85727     +385     
+ Misses      24946    24572     -374
Flag Coverage Δ
#kernel 78.37% <90.9%> (+0.25%) ⬆️
#user 66.84% <0%> (+0.41%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 93491c4...b7e45dd. Read the comment docs.

@behlendorf behlendorf merged commit 74d4260 into openzfs:master May 31, 2018
@behlendorf
Copy link
Contributor

@tonyhutter we should consider this fix for inclusion in 0.7.10.

tonyhutter pushed a commit to tonyhutter/zfs that referenced this pull request Aug 15, 2018
Update bdev_capacity to have wholedisk vdevs query the
size of the underlying block device (correcting for the size
of the efi parition and partition alignment) and therefore detect
expanded space.

Correct vdev_get_stats_ex so that the expandsize is aligned
to metaslab size and new space is only reported if it is large
enough for a new metaslab.

Reviewed by: Don Brady <don.brady@delphix.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed by: George Wilson <george.wilson@delphix.com>
Reviewed-by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: John Wren Kennedy <jwk404@gmail.com>
Signed-off-by: sara hartse <sara.hartse@delphix.com>
External-issue: LX-165
Closes openzfs#7546
Issue openzfs#7582
tonyhutter pushed a commit to tonyhutter/zfs that referenced this pull request Aug 23, 2018
Update bdev_capacity to have wholedisk vdevs query the
size of the underlying block device (correcting for the size
of the efi parition and partition alignment) and therefore detect
expanded space.

Correct vdev_get_stats_ex so that the expandsize is aligned
to metaslab size and new space is only reported if it is large
enough for a new metaslab.

Reviewed by: Don Brady <don.brady@delphix.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed by: George Wilson <george.wilson@delphix.com>
Reviewed-by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: John Wren Kennedy <jwk404@gmail.com>
Signed-off-by: sara hartse <sara.hartse@delphix.com>
External-issue: LX-165
Closes openzfs#7546
Issue openzfs#7582
tonyhutter pushed a commit to tonyhutter/zfs that referenced this pull request Sep 5, 2018
Update bdev_capacity to have wholedisk vdevs query the
size of the underlying block device (correcting for the size
of the efi parition and partition alignment) and therefore detect
expanded space.

Correct vdev_get_stats_ex so that the expandsize is aligned
to metaslab size and new space is only reported if it is large
enough for a new metaslab.

Reviewed by: Don Brady <don.brady@delphix.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed by: George Wilson <george.wilson@delphix.com>
Reviewed-by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: John Wren Kennedy <jwk404@gmail.com>
Signed-off-by: sara hartse <sara.hartse@delphix.com>
External-issue: LX-165
Closes openzfs#7546
Issue openzfs#7582
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants