ACK w/cmt: [PATCH][SRU][XENIAL] UBUNTU: SAUCE: (noup) Update zfs to 0.6.5.6-0ubuntu10
Tim Gardner
tim.gardner at canonical.com
Thu Jun 23 12:10:00 UTC 2016
On 06/23/2016 05:58 AM, Colin Ian King wrote:
> On 23/06/16 12:42, Tim Gardner wrote:
>> On 06/22/2016 07:40 AM, Colin King wrote:
>>> From: Colin Ian King <colin.king at canonical.com>
>>>
>>> BugLink: http://bugs.launchpad.net/bugs/1594871
>>>
>>> Sync with the latest Xenial zfs-linux 0.6.5.6-0ubuntu10
>>>
>>> Signed-off-by: Colin Ian King <colin.king at canonical.com>
>>> ---
>>> zfs/META | 2 +-
>>> zfs/module/zfs/spa_config.c | 5 +++--
>>> zfs/module/zfs/vdev_disk.c | 31 +++++++++++++++++++++------
>>> zfs/module/zfs/zfs_fm.c | 4 ++--
>>> zfs/module/zfs/zfs_ioctl.c | 5 ++++-
>>> zfs/rpm/redhat/zfs-dkms.spec.in | 3 ++-
>>> zfs/rpm/redhat/zfs.spec.in | 3 ++-
>>> zfs/scripts/zpios-test/large-thread-survey.sh | 1 -
>>> zfs/scripts/zpios-test/large.sh | 1 -
>>> zfs/scripts/zpios-test/medium.sh | 1 -
>>> zfs/scripts/zpios-test/small.sh | 1 -
>>> zfs/scripts/zpios-test/tiny.sh | 1 -
>>> 12 files changed, 39 insertions(+), 19 deletions(-)
>>> mode change 120000 => 100644 zfs/rpm/redhat/zfs-dkms.spec.in
>>> mode change 120000 => 100644 zfs/rpm/redhat/zfs.spec.in
>>> delete mode 120000 zfs/scripts/zpios-test/large-thread-survey.sh
>>> delete mode 120000 zfs/scripts/zpios-test/large.sh
>>> delete mode 120000 zfs/scripts/zpios-test/medium.sh
>>> delete mode 120000 zfs/scripts/zpios-test/small.sh
>>> delete mode 120000 zfs/scripts/zpios-test/tiny.sh
>>>
>>> diff --git a/zfs/META b/zfs/META
>>> index 5a5c0a2..a0dbc97 100644
>>> --- a/zfs/META
>>> +++ b/zfs/META
>>> @@ -2,7 +2,7 @@ Meta: 1
>>> Name: zfs
>>> Branch: 1.0
>>> Version: 0.6.5.6
>>> -Release: 0ubuntu3
>>> +Release: 0ubuntu10
>>> Release-Tags: relext
>>> License: CDDL
>>> Author: OpenZFS on Linux
>>> diff --git a/zfs/module/zfs/spa_config.c b/zfs/module/zfs/spa_config.c
>>> index 929f181..19432e0 100644
>>> --- a/zfs/module/zfs/spa_config.c
>>> +++ b/zfs/module/zfs/spa_config.c
>>> @@ -174,7 +174,7 @@ spa_config_write(spa_config_dirent_t *dp, nvlist_t *nvl)
>>> VERIFY(nvlist_pack(nvl, &buf, &buflen, NV_ENCODE_XDR,
>>> KM_SLEEP) == 0);
>>>
>>> -#ifdef __linux__
>>> +#if defined(__linux__) && defined(_KERNEL)
>>> /*
>>> * Write the configuration to disk. Due to the complexity involved
>>> * in performing a rename from within the kernel the file is truncated
>>> @@ -201,7 +201,8 @@ spa_config_write(spa_config_dirent_t *dp, nvlist_t *nvl)
>>> */
>>> (void) snprintf(temp, MAXPATHLEN, "%s.tmp", dp->scd_path);
>>>
>>> - if (vn_open(temp, UIO_SYSSPACE, oflags, 0644, &vp, CRCREAT, 0) == 0) {
>>> + error = vn_open(temp, UIO_SYSSPACE, oflags, 0644, &vp, CRCREAT, 0);
>>> + if (error == 0) {
>>> if (vn_rdwr(UIO_WRITE, vp, buf, buflen, 0, UIO_SYSSPACE,
>>> 0, RLIM64_INFINITY, kcred, NULL) == 0 &&
>>> VOP_FSYNC(vp, FSYNC, kcred, NULL) == 0) {
>>> diff --git a/zfs/module/zfs/vdev_disk.c b/zfs/module/zfs/vdev_disk.c
>>> index ebf0e8b..9b51ecc 100644
>>> --- a/zfs/module/zfs/vdev_disk.c
>>> +++ b/zfs/module/zfs/vdev_disk.c
>>> @@ -139,7 +139,7 @@ vdev_elevator_switch(vdev_t *v, char *elevator)
>>> return (0);
>>>
>>> /* Leave existing scheduler when set to "none" */
>>> - if (strncmp(elevator, "none", 4) && (strlen(elevator) == 4) == 0)
>>> + if ((strncmp(elevator, "none", 4) == 0) && (strlen(elevator) == 4))
>>> return (0);
>>>
>>> #ifdef HAVE_ELEVATOR_CHANGE
>>> @@ -244,12 +244,12 @@ vdev_disk_open(vdev_t *v, uint64_t *psize, uint64_t *max_psize,
>>> {
>>> struct block_device *bdev = ERR_PTR(-ENXIO);
>>> vdev_disk_t *vd;
>>> - int mode, block_size;
>>> + int count = 0, mode, block_size;
>>>
>>> /* Must have a pathname and it must be absolute. */
>>> if (v->vdev_path == NULL || v->vdev_path[0] != '/') {
>>> v->vdev_stat.vs_aux = VDEV_AUX_BAD_LABEL;
>>> - return (EINVAL);
>>> + return (SET_ERROR(EINVAL));
>>> }
>>>
>>> /*
>>> @@ -264,7 +264,7 @@ vdev_disk_open(vdev_t *v, uint64_t *psize, uint64_t *max_psize,
>>>
>>> vd = kmem_zalloc(sizeof (vdev_disk_t), KM_SLEEP);
>>> if (vd == NULL)
>>> - return (ENOMEM);
>>> + return (SET_ERROR(ENOMEM));
>>>
>>> /*
>>> * Devices are always opened by the path provided at configuration
>>> @@ -279,16 +279,35 @@ vdev_disk_open(vdev_t *v, uint64_t *psize, uint64_t *max_psize,
>>> * /dev/[hd]d devices which may be reordered due to probing order.
>>> * Devices in the wrong locations will be detected by the higher
>>> * level vdev validation.
>>> + *
>>> + * The specified paths may be briefly removed and recreated in
>>> + * response to udev events. This should be exceptionally unlikely
>>> + * because the zpool command makes every effort to verify these paths
>>> + * have already settled prior to reaching this point. Therefore,
>>> + * a ENOENT failure at this point is highly likely to be transient
>>> + * and it is reasonable to sleep and retry before giving up. In
>>> + * practice delays have been observed to be on the order of 100ms.
>>> */
>>> mode = spa_mode(v->vdev_spa);
>>> if (v->vdev_wholedisk && v->vdev_expanding)
>>> bdev = vdev_disk_rrpart(v->vdev_path, mode, vd);
>>> - if (IS_ERR(bdev))
>>> +
>>> + while (IS_ERR(bdev) && count < 50) {
>>> bdev = vdev_bdev_open(v->vdev_path,
>>> vdev_bdev_mode(mode), zfs_vdev_holder);
>>> + if (unlikely(PTR_ERR(bdev) == -ENOENT)) {
>>> + msleep(10);
>>> + count++;
>>> + } else if (IS_ERR(bdev)) {
>>> + break;
>>> + }
>>> + }
>>> +
>>> if (IS_ERR(bdev)) {
>>> + dprintf("failed open v->vdev_path=%s, error=%d count=%d\n",
>>> + v->vdev_path, -PTR_ERR(bdev), count);
>>> kmem_free(vd, sizeof (vdev_disk_t));
>>> - return (-PTR_ERR(bdev));
>>> + return (SET_ERROR(-PTR_ERR(bdev)));
>>> }
>>>
>>> v->vdev_tsd = vd;
>>> diff --git a/zfs/module/zfs/zfs_fm.c b/zfs/module/zfs/zfs_fm.c
>>> index 7e9c473..c7b7180 100644
>>> --- a/zfs/module/zfs/zfs_fm.c
>>> +++ b/zfs/module/zfs/zfs_fm.c
>>> @@ -457,7 +457,8 @@ update_histogram(uint64_t value_arg, uint16_t *hist, uint32_t *count)
>>> /* We store the bits in big-endian (largest-first) order */
>>> for (i = 0; i < 64; i++) {
>>> if (value & (1ull << i)) {
>>> - hist[63 - i]++;
>>> + if (hist[63 - i] < UINT16_MAX)
>>> + hist[63 - i]++;
>>> ++bits;
>>> }
>>> }
>>> @@ -615,7 +616,6 @@ annotate_ecksum(nvlist_t *ereport, zio_bad_cksum_t *info,
>>> if (badbuf == NULL || goodbuf == NULL)
>>> return (eip);
>>>
>>> - ASSERT3U(nui64s, <=, UINT16_MAX);
>>> ASSERT3U(size, ==, nui64s * sizeof (uint64_t));
>>> ASSERT3U(size, <=, SPA_MAXBLOCKSIZE);
>>> ASSERT3U(size, <=, UINT32_MAX);
>>> diff --git a/zfs/module/zfs/zfs_ioctl.c b/zfs/module/zfs/zfs_ioctl.c
>>> index 12d2750..745f713 100644
>>> --- a/zfs/module/zfs/zfs_ioctl.c
>>> +++ b/zfs/module/zfs/zfs_ioctl.c
>>> @@ -5817,8 +5817,11 @@ zfsdev_ioctl(struct file *filp, unsigned cmd, unsigned long arg)
>>> }
>>>
>>>
>>> - if (error == 0 && !(flag & FKIOCTL))
>>> + if (error == 0 && !(flag & FKIOCTL)) {
>>> + cookie = spl_fstrans_mark();
>>> error = vec->zvec_secpolicy(zc, innvl, CRED());
>>> + spl_fstrans_unmark(cookie);
>>> + }
>>>
>>> if (error != 0)
>>> goto out;
>>> diff --git a/zfs/rpm/redhat/zfs-dkms.spec.in b/zfs/rpm/redhat/zfs-dkms.spec.in
>>> deleted file mode 120000
>>> index ffa051b..0000000
>>> --- a/zfs/rpm/redhat/zfs-dkms.spec.in
>>> +++ /dev/null
>>> @@ -1 +0,0 @@
>>> -../generic/zfs-dkms.spec.in
>>> \ No newline at end of file
>>> diff --git a/zfs/rpm/redhat/zfs-dkms.spec.in b/zfs/rpm/redhat/zfs-dkms.spec.in
>>> new file mode 100644
>>> index 0000000..b3e8c13
>>> --- /dev/null
>>> +++ b/zfs/rpm/redhat/zfs-dkms.spec.in
>>> @@ -0,0 +1,2 @@
>>> +%:
>>> + #
>>> diff --git a/zfs/rpm/redhat/zfs.spec.in b/zfs/rpm/redhat/zfs.spec.in
>>> deleted file mode 120000
>>> index 4c80791..0000000
>>> --- a/zfs/rpm/redhat/zfs.spec.in
>>> +++ /dev/null
>>> @@ -1 +0,0 @@
>>> -../generic/zfs.spec.in
>>> \ No newline at end of file
>>> diff --git a/zfs/rpm/redhat/zfs.spec.in b/zfs/rpm/redhat/zfs.spec.in
>>> new file mode 100644
>>> index 0000000..b3e8c13
>>> --- /dev/null
>>> +++ b/zfs/rpm/redhat/zfs.spec.in
>>> @@ -0,0 +1,2 @@
>>> +%:
>>> + #
>>> diff --git a/zfs/scripts/zpios-test/large-thread-survey.sh b/zfs/scripts/zpios-test/large-thread-survey.sh
>>> deleted file mode 120000
>>> index 90b6e3c..0000000
>>> --- a/zfs/scripts/zpios-test/large-thread-survey.sh
>>> +++ /dev/null
>>> @@ -1 +0,0 @@
>>> -1x256th-65536rc-4rs-1cs-4off.sh
>>> \ No newline at end of file
>>> diff --git a/zfs/scripts/zpios-test/large.sh b/zfs/scripts/zpios-test/large.sh
>>> deleted file mode 120000
>>> index b8e22bf..0000000
>>> --- a/zfs/scripts/zpios-test/large.sh
>>> +++ /dev/null
>>> @@ -1 +0,0 @@
>>> -256th-65536rc-4rs-1cs-4off.sh
>>> \ No newline at end of file
>>> diff --git a/zfs/scripts/zpios-test/medium.sh b/zfs/scripts/zpios-test/medium.sh
>>> deleted file mode 120000
>>> index d81027b..0000000
>>> --- a/zfs/scripts/zpios-test/medium.sh
>>> +++ /dev/null
>>> @@ -1 +0,0 @@
>>> -16th-8192rc-4rs-1cs-4off.sh
>>> \ No newline at end of file
>>> diff --git a/zfs/scripts/zpios-test/small.sh b/zfs/scripts/zpios-test/small.sh
>>> deleted file mode 120000
>>> index cbf03b5c..0000000
>>> --- a/zfs/scripts/zpios-test/small.sh
>>> +++ /dev/null
>>> @@ -1 +0,0 @@
>>> -4th-1024rc-4rs-1cs-4off.sh
>>> \ No newline at end of file
>>> diff --git a/zfs/scripts/zpios-test/tiny.sh b/zfs/scripts/zpios-test/tiny.sh
>>> deleted file mode 120000
>>> index ba8b7cd..0000000
>>> --- a/zfs/scripts/zpios-test/tiny.sh
>>> +++ /dev/null
>>> @@ -1 +0,0 @@
>>> -1th-16rc-4rs-1cs-4off.sh
>>> \ No newline at end of file
>>>
>>
>> There are several commits from the upstream zfs repo listed in this bug.
>> Which of them are being applied ? This patch doesn't look big enough for
>> all of them.
> The kernel delta is small because a lot of the commits were on the
> userspace tools.
>
>> Is there a way to separate them so as to be more reviewable ?
>
> Probably. I just used the script you wrote to do the sync; I presumed
> that was our defacto way of doing the zfs delta syncing.
>
And so it should be. I was thrown off by the touches to zfs/scripts and
zfs/rpm. I imagine we can remove that part of the patch ?
rtg
--
Tim Gardner tim.gardner at canonical.com
More information about the kernel-team
mailing list