Re: svn commit: r354283 - in head: stand/libsa/zfs sys/cddl/boot/zfs

2019-11-03 Thread Toomas Soome via svn-src-all


> On 4. Nov 2019, at 03:42, Alexander Motin  wrote:
> 
> On 03.11.2019 20:19, Xin Li wrote:
>> On 2019-11-03 15:30, Ravi Pokala wrote:
>>> Uh
>>> 
>>> I've had a log device in my boot-pool for months, and have booted without 
>>> issue:
>>> 
>>>[threepio:~] rpokala% zpool status zroot
>>>  pool: zroot
>>> state: ONLINE
>>>  scan: scrub repaired 0 in 0 days 00:04:36 with 0 errors on Mon Oct 28 
>>> 03:10:59 2019
>>>config:
>>> 
>>>NAMESTATE READ WRITE CKSUM
>>>zroot   ONLINE   0 0 0
>>>  nvd1p4ONLINE   0 0 0
>>>logs
>>>  nvd0p1ONLINE   0 0 0
>>> 
>>>errors: No known data errors
>> 
>> 
>> This is not supported, and it's not trivial to support it, because in
>> order to support it, the bootloader would have to know how to replay
>> zilogs, which would add quite a lot of code to it.
> 
> The issue with ZIL not being replayed in case of read-only mount has
> nothing to do with the fact of SLOG device presence.  The issue is the
> same when ZIL resides on the main disks of the pool.  So while
> everything else you said is right, I see no any reason to ban pools with
> SLOG devices in this context.
> 

Yep, indeed. I got myself confused from the fact we return EIO for log device. 
So a bit more cleanup is in order.

However, the big question there is not about how recent update the boot files 
have. To read out the boot files, we need a bit of processing done and to 
understand if those structures are consistent or not. But as I wrote before, 
thats something to be investigated.

rgds,
toomas

___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r354283 - in head: stand/libsa/zfs sys/cddl/boot/zfs

2019-11-03 Thread Alexander Motin
On 03.11.2019 20:19, Xin Li wrote:
> On 2019-11-03 15:30, Ravi Pokala wrote:
>> Uh
>>
>> I've had a log device in my boot-pool for months, and have booted without 
>> issue:
>>
>> [threepio:~] rpokala% zpool status zroot
>>   pool: zroot
>>  state: ONLINE
>>   scan: scrub repaired 0 in 0 days 00:04:36 with 0 errors on Mon Oct 28 
>> 03:10:59 2019
>> config:
>>
>> NAMESTATE READ WRITE CKSUM
>> zroot   ONLINE   0 0 0
>>   nvd1p4ONLINE   0 0 0
>> logs
>>   nvd0p1ONLINE   0 0 0
>>
>> errors: No known data errors
> 
> 
> This is not supported, and it's not trivial to support it, because in
> order to support it, the bootloader would have to know how to replay
> zilogs, which would add quite a lot of code to it.

The issue with ZIL not being replayed in case of read-only mount has
nothing to do with the fact of SLOG device presence.  The issue is the
same when ZIL resides on the main disks of the pool.  So while
everything else you said is right, I see no any reason to ban pools with
SLOG devices in this context.

-- 
Alexander Motin
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r354283 - in head: stand/libsa/zfs sys/cddl/boot/zfs

2019-11-03 Thread Xin Li via svn-src-all


On 2019-11-03 13:32, Toomas Soome wrote:
> 
> 
>> On 3. Nov 2019, at 22:39, Kevin Bowling  wrote:
>>
>> I believe this is/was a common configuration, at least the few
>> spinning disk based systems I have left have a slog.
>>
> 
> On boot pool? um. well, I’ll kick out that return then.

I think it's fine to simply ignore the log in loader, because it's a
read-only consumer.

The full-featured kernel ZFS code would skip replaying the log when
importing read-only, in that case we might see some outdated data, but
it's still guaranteed to be consistent by ZFS.

Cheers,

> 
> rgds,
> toomas
> 
>> On Sun, Nov 3, 2019 at 10:55 AM Andriy Gapon  wrote:
>>>
>>> On 03/11/2019 15:25, Toomas Soome wrote:
 Author: tsoome
 Date: Sun Nov  3 13:25:47 2019
 New Revision: 354283
 URL: https://svnweb.freebsd.org/changeset/base/354283

 Log:
  loader: we do not support booting from pool with log device

  If pool has log device, stop there and tell about it.
>>>
>>> Why?
>>>
 Modified:
  head/stand/libsa/zfs/zfs.c
  head/stand/libsa/zfs/zfsimpl.c
  head/sys/cddl/boot/zfs/zfsimpl.h
>>>
>>>
>>>
>>> --
>>> Andriy Gapon
>>> ___
>>> svn-src-h...@freebsd.org mailing list
>>> https://lists.freebsd.org/mailman/listinfo/svn-src-head
>>> To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
> 



signature.asc
Description: OpenPGP digital signature


Re: svn commit: r354283 - in head: stand/libsa/zfs sys/cddl/boot/zfs

2019-11-03 Thread Xin Li via svn-src-all
(chosen a random message)

On 2019-11-03 15:30, Ravi Pokala wrote:
> Uh
> 
> I've had a log device in my boot-pool for months, and have booted without 
> issue:
> 
> [threepio:~] rpokala% zpool status zroot
>   pool: zroot
>  state: ONLINE
>   scan: scrub repaired 0 in 0 days 00:04:36 with 0 errors on Mon Oct 28 
> 03:10:59 2019
> config:
> 
> NAMESTATE READ WRITE CKSUM
> zroot   ONLINE   0 0 0
>   nvd1p4ONLINE   0 0 0
> logs
>   nvd0p1ONLINE   0 0 0
> 
> errors: No known data errors


This is not supported, and it's not trivial to support it, because in
order to support it, the bootloader would have to know how to replay
zilogs, which would add quite a lot of code to it.

It's unlikely that you actually hit a problem, however, because the
critical contents to boot the system is rarely written to, and as a
result it's quite likely that the readable, consistent state of your
/boot/ is good enough to boot the system.  That's said, it's still
because you were lucky, and the code was not designed to work that way...

Cheers,



signature.asc
Description: OpenPGP digital signature


Re: svn commit: r354283 - in head: stand/libsa/zfs sys/cddl/boot/zfs

2019-11-03 Thread Ravi Pokala
Uh

I've had a log device in my boot-pool for months, and have booted without issue:

[threepio:~] rpokala% zpool status zroot
  pool: zroot
 state: ONLINE
  scan: scrub repaired 0 in 0 days 00:04:36 with 0 errors on Mon Oct 28 
03:10:59 2019
config:

NAMESTATE READ WRITE CKSUM
zroot   ONLINE   0 0 0
  nvd1p4ONLINE   0 0 0
logs
  nvd0p1ONLINE   0 0 0

errors: No known data errors

-Ravi (rpokala@)

-Original Message-
From:  on behalf of Toomas Soome 

Date: 2019-11-03, Sunday at 05:25
To: , , 

Subject: svn commit: r354283 - in head: stand/libsa/zfs sys/cddl/boot/zfs

Author: tsoome
Date: Sun Nov  3 13:25:47 2019
New Revision: 354283
URL: https://svnweb.freebsd.org/changeset/base/354283

Log:
  loader: we do not support booting from pool with log device
  
  If pool has log device, stop there and tell about it.

Modified:
  head/stand/libsa/zfs/zfs.c
  head/stand/libsa/zfs/zfsimpl.c
  head/sys/cddl/boot/zfs/zfsimpl.h

Modified: head/stand/libsa/zfs/zfs.c

==
--- head/stand/libsa/zfs/zfs.c  Sun Nov  3 13:03:47 2019
(r354282)
+++ head/stand/libsa/zfs/zfs.c  Sun Nov  3 13:25:47 2019
(r354283)
@@ -668,6 +668,11 @@ zfs_dev_open(struct open_file *f, ...)
spa = spa_find_by_guid(dev->pool_guid);
if (!spa)
return (ENXIO);
+   if (spa->spa_with_log) {
+   printf("Reading pool %s is not supported due to log device.\n",
+   spa->spa_name);
+   return (ENXIO);
+   }
mount = malloc(sizeof(*mount));
if (mount == NULL)
return (ENOMEM);

Modified: head/stand/libsa/zfs/zfsimpl.c

==
--- head/stand/libsa/zfs/zfsimpl.c  Sun Nov  3 13:03:47 2019
(r354282)
+++ head/stand/libsa/zfs/zfsimpl.c  Sun Nov  3 13:25:47 2019
(r354283)
@@ -1109,6 +1109,7 @@ vdev_init_from_nvlist(const unsigned char *nvlist, vde
const unsigned char *kids;
int nkids, i, is_new;
uint64_t is_offline, is_faulted, is_degraded, is_removed, isnt_present;
+   uint64_t is_log;
 
if (nvlist_find(nvlist, ZPOOL_CONFIG_GUID, DATA_TYPE_UINT64,
NULL, &guid)
@@ -1132,17 +1133,20 @@ vdev_init_from_nvlist(const unsigned char *nvlist, 
vde
}
 
is_offline = is_removed = is_faulted = is_degraded = isnt_present = 0;
+   is_log = 0;
 
nvlist_find(nvlist, ZPOOL_CONFIG_OFFLINE, DATA_TYPE_UINT64, NULL,
-   &is_offline);
+   &is_offline);
nvlist_find(nvlist, ZPOOL_CONFIG_REMOVED, DATA_TYPE_UINT64, NULL,
-   &is_removed);
+   &is_removed);
nvlist_find(nvlist, ZPOOL_CONFIG_FAULTED, DATA_TYPE_UINT64, NULL,
-   &is_faulted);
+   &is_faulted);
nvlist_find(nvlist, ZPOOL_CONFIG_DEGRADED, DATA_TYPE_UINT64, NULL,
-   &is_degraded);
+   &is_degraded);
nvlist_find(nvlist, ZPOOL_CONFIG_NOT_PRESENT, DATA_TYPE_UINT64, NULL,
-   &isnt_present);
+   &isnt_present);
+   nvlist_find(nvlist, ZPOOL_CONFIG_IS_LOG, DATA_TYPE_UINT64, NULL,
+   &is_log);
 
vdev = vdev_find(guid);
if (!vdev) {
@@ -1217,6 +1221,7 @@ vdev_init_from_nvlist(const unsigned char *nvlist, vde
return (ENOMEM);
vdev->v_name = name;
}
+   vdev->v_islog = is_log == 1;
} else {
is_new = 0;
}
@@ -1433,6 +1438,12 @@ vdev_status(vdev_t *vdev, int indent)
 {
vdev_t *kid;
int ret;
+
+   if (vdev->v_islog) {
+   (void)pager_output("logs\n");
+   indent++;
+   }
+
ret = print_state(indent, vdev->v_name, vdev->v_state);
if (ret != 0)
return (ret);
@@ -1737,6 +1748,12 @@ vdev_probe(vdev_phys_read_t *_read, void *read_priv, 
s
printf("ZFS: inconsistent nvlist contents\n");
return (EIO);
}
+
+   /*
+* We do not support reading pools with log device.
+*/
+   if (vdev->v_islog)
+   spa->spa_with_log = vdev->v_islog;
 
/*
 * Re-evaluate top-level vdev state.

Modified: head/sys/cddl/boot/zfs/zfsimpl.h

==
--- head/sys/cddl/boot/zfs/zfsimpl.hSun Nov  3 13:03:47 2019
(r35428

Re: svn commit: r354283 - in head: stand/libsa/zfs sys/cddl/boot/zfs

2019-11-03 Thread Steven Hartland
Pretty sure we had at least two systems using root with log just fine, so
would be interested to know why this isn’t supported anymore?

On Sun, 3 Nov 2019 at 13:26, Toomas Soome  wrote:

> Author: tsoome
> Date: Sun Nov  3 13:25:47 2019
> New Revision: 354283
> URL: https://svnweb.freebsd.org/changeset/base/354283
>
> Log:
>   loader: we do not support booting from pool with log device
>
>   If pool has log device, stop there and tell about it.
>
> Modified:
>   head/stand/libsa/zfs/zfs.c
>   head/stand/libsa/zfs/zfsimpl.c
>   head/sys/cddl/boot/zfs/zfsimpl.h
>
> Modified: head/stand/libsa/zfs/zfs.c
>
> ==
> --- head/stand/libsa/zfs/zfs.c  Sun Nov  3 13:03:47 2019(r354282)
> +++ head/stand/libsa/zfs/zfs.c  Sun Nov  3 13:25:47 2019(r354283)
> @@ -668,6 +668,11 @@ zfs_dev_open(struct open_file *f, ...)
> spa = spa_find_by_guid(dev->pool_guid);
> if (!spa)
> return (ENXIO);
> +   if (spa->spa_with_log) {
> +   printf("Reading pool %s is not supported due to log
> device.\n",
> +   spa->spa_name);
> +   return (ENXIO);
> +   }
> mount = malloc(sizeof(*mount));
> if (mount == NULL)
> return (ENOMEM);
>
> Modified: head/stand/libsa/zfs/zfsimpl.c
>
> ==
> --- head/stand/libsa/zfs/zfsimpl.c  Sun Nov  3 13:03:47 2019
> (r354282)
> +++ head/stand/libsa/zfs/zfsimpl.c  Sun Nov  3 13:25:47 2019
> (r354283)
> @@ -1109,6 +1109,7 @@ vdev_init_from_nvlist(const unsigned char *nvlist,
> vde
> const unsigned char *kids;
> int nkids, i, is_new;
> uint64_t is_offline, is_faulted, is_degraded, is_removed,
> isnt_present;
> +   uint64_t is_log;
>
> if (nvlist_find(nvlist, ZPOOL_CONFIG_GUID, DATA_TYPE_UINT64,
> NULL, &guid)
> @@ -1132,17 +1133,20 @@ vdev_init_from_nvlist(const unsigned char *nvlist,
> vde
> }
>
> is_offline = is_removed = is_faulted = is_degraded = isnt_present
> = 0;
> +   is_log = 0;
>
> nvlist_find(nvlist, ZPOOL_CONFIG_OFFLINE, DATA_TYPE_UINT64, NULL,
> -   &is_offline);
> +   &is_offline);
> nvlist_find(nvlist, ZPOOL_CONFIG_REMOVED, DATA_TYPE_UINT64, NULL,
> -   &is_removed);
> +   &is_removed);
> nvlist_find(nvlist, ZPOOL_CONFIG_FAULTED, DATA_TYPE_UINT64, NULL,
> -   &is_faulted);
> +   &is_faulted);
> nvlist_find(nvlist, ZPOOL_CONFIG_DEGRADED, DATA_TYPE_UINT64, NULL,
> -   &is_degraded);
> +   &is_degraded);
> nvlist_find(nvlist, ZPOOL_CONFIG_NOT_PRESENT, DATA_TYPE_UINT64,
> NULL,
> -   &isnt_present);
> +   &isnt_present);
> +   nvlist_find(nvlist, ZPOOL_CONFIG_IS_LOG, DATA_TYPE_UINT64, NULL,
> +   &is_log);
>
> vdev = vdev_find(guid);
> if (!vdev) {
> @@ -1217,6 +1221,7 @@ vdev_init_from_nvlist(const unsigned char *nvlist,
> vde
> return (ENOMEM);
> vdev->v_name = name;
> }
> +   vdev->v_islog = is_log == 1;
> } else {
> is_new = 0;
> }
> @@ -1433,6 +1438,12 @@ vdev_status(vdev_t *vdev, int indent)
>  {
> vdev_t *kid;
> int ret;
> +
> +   if (vdev->v_islog) {
> +   (void)pager_output("logs\n");
> +   indent++;
> +   }
> +
> ret = print_state(indent, vdev->v_name, vdev->v_state);
> if (ret != 0)
> return (ret);
> @@ -1737,6 +1748,12 @@ vdev_probe(vdev_phys_read_t *_read, void
> *read_priv, s
> printf("ZFS: inconsistent nvlist contents\n");
> return (EIO);
> }
> +
> +   /*
> +* We do not support reading pools with log device.
> +*/
> +   if (vdev->v_islog)
> +   spa->spa_with_log = vdev->v_islog;
>
> /*
>  * Re-evaluate top-level vdev state.
>
> Modified: head/sys/cddl/boot/zfs/zfsimpl.h
>
> ==
> --- head/sys/cddl/boot/zfs/zfsimpl.hSun Nov  3 13:03:47 2019
> (r354282)
> +++ head/sys/cddl/boot/zfs/zfsimpl.hSun Nov  3 13:25:47 2019
> (r354283)
> @@ -1670,6 +1670,7 @@ typedef struct vdev {
> vdev_phys_read_t *v_phys_read;  /* read from raw leaf vdev */
> vdev_read_t *v_read;/* read from vdev */
> void*v_read_priv;   /* private data for read function
> */
> +   boolean_t   v_islog;
> struct spa  *spa;   /* link to spa */
> /*
>  * Values stored in the config for an indirect or removing vdev.
> @@ -1694,6 +1695,7 @@ typedef struct spa {
> zio_cksum_salt_t spa_cksum_salt;/

Re: svn commit: r354283 - in head: stand/libsa/zfs sys/cddl/boot/zfs

2019-11-03 Thread Kevin Bowling
Yes, some systems with two disks in a mirror and an ssd as slog.

What are you trying to guard against?  I have never seen an issue but would
like to be aware of potential problems with that system.

On Sun, Nov 3, 2019 at 2:32 PM Toomas Soome  wrote:

>
>
> > On 3. Nov 2019, at 22:39, Kevin Bowling 
> wrote:
> >
> > I believe this is/was a common configuration, at least the few
> > spinning disk based systems I have left have a slog.
> >
>
> On boot pool? um. well, I’ll kick out that return then.
>
> rgds,
> toomas
>
> > On Sun, Nov 3, 2019 at 10:55 AM Andriy Gapon  wrote:
> >>
> >> On 03/11/2019 15:25, Toomas Soome wrote:
> >>> Author: tsoome
> >>> Date: Sun Nov  3 13:25:47 2019
> >>> New Revision: 354283
> >>> URL: https://svnweb.freebsd.org/changeset/base/354283
> >>>
> >>> Log:
> >>>  loader: we do not support booting from pool with log device
> >>>
> >>>  If pool has log device, stop there and tell about it.
> >>
> >> Why?
> >>
> >>> Modified:
> >>>  head/stand/libsa/zfs/zfs.c
> >>>  head/stand/libsa/zfs/zfsimpl.c
> >>>  head/sys/cddl/boot/zfs/zfsimpl.h
> >>
> >>
> >>
> >> --
> >> Andriy Gapon
> >> ___
> >> svn-src-h...@freebsd.org mailing list
> >> https://lists.freebsd.org/mailman/listinfo/svn-src-head
> >> To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
>
>
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r354283 - in head: stand/libsa/zfs sys/cddl/boot/zfs

2019-11-03 Thread Toomas Soome via svn-src-all


> On 3. Nov 2019, at 19:42, Andriy Gapon  wrote:
> 
> On 03/11/2019 15:25, Toomas Soome wrote:
>> Author: tsoome
>> Date: Sun Nov  3 13:25:47 2019
>> New Revision: 354283
>> URL: https://svnweb.freebsd.org/changeset/base/354283
>> 
>> Log:
>>  loader: we do not support booting from pool with log device
>> 
>>  If pool has log device, stop there and tell about it.
> 
> Why?
> 

because it is not implemented? We already return EIO from vdev_probe() for LOG 
device. I mean I does not have to stay this way, but also we have some weird 
unexplained error cases… 

anyhow, it is trivial to undo the disable, and definitely open to ideas about 
handling the reading the log.

rgds,
toomas
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r354283 - in head: stand/libsa/zfs sys/cddl/boot/zfs

2019-11-03 Thread Toomas Soome via svn-src-all


> On 3. Nov 2019, at 22:39, Kevin Bowling  wrote:
> 
> I believe this is/was a common configuration, at least the few
> spinning disk based systems I have left have a slog.
> 

On boot pool? um. well, I’ll kick out that return then.

rgds,
toomas

> On Sun, Nov 3, 2019 at 10:55 AM Andriy Gapon  wrote:
>> 
>> On 03/11/2019 15:25, Toomas Soome wrote:
>>> Author: tsoome
>>> Date: Sun Nov  3 13:25:47 2019
>>> New Revision: 354283
>>> URL: https://svnweb.freebsd.org/changeset/base/354283
>>> 
>>> Log:
>>>  loader: we do not support booting from pool with log device
>>> 
>>>  If pool has log device, stop there and tell about it.
>> 
>> Why?
>> 
>>> Modified:
>>>  head/stand/libsa/zfs/zfs.c
>>>  head/stand/libsa/zfs/zfsimpl.c
>>>  head/sys/cddl/boot/zfs/zfsimpl.h
>> 
>> 
>> 
>> --
>> Andriy Gapon
>> ___
>> svn-src-h...@freebsd.org mailing list
>> https://lists.freebsd.org/mailman/listinfo/svn-src-head
>> To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r354283 - in head: stand/libsa/zfs sys/cddl/boot/zfs

2019-11-03 Thread Kevin Bowling
I believe this is/was a common configuration, at least the few
spinning disk based systems I have left have a slog.

On Sun, Nov 3, 2019 at 10:55 AM Andriy Gapon  wrote:
>
> On 03/11/2019 15:25, Toomas Soome wrote:
> > Author: tsoome
> > Date: Sun Nov  3 13:25:47 2019
> > New Revision: 354283
> > URL: https://svnweb.freebsd.org/changeset/base/354283
> >
> > Log:
> >   loader: we do not support booting from pool with log device
> >
> >   If pool has log device, stop there and tell about it.
>
> Why?
>
> > Modified:
> >   head/stand/libsa/zfs/zfs.c
> >   head/stand/libsa/zfs/zfsimpl.c
> >   head/sys/cddl/boot/zfs/zfsimpl.h
>
>
>
> --
> Andriy Gapon
> ___
> svn-src-h...@freebsd.org mailing list
> https://lists.freebsd.org/mailman/listinfo/svn-src-head
> To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r354283 - in head: stand/libsa/zfs sys/cddl/boot/zfs

2019-11-03 Thread Andriy Gapon
On 03/11/2019 15:25, Toomas Soome wrote:
> Author: tsoome
> Date: Sun Nov  3 13:25:47 2019
> New Revision: 354283
> URL: https://svnweb.freebsd.org/changeset/base/354283
> 
> Log:
>   loader: we do not support booting from pool with log device
>   
>   If pool has log device, stop there and tell about it.

Why?

> Modified:
>   head/stand/libsa/zfs/zfs.c
>   head/stand/libsa/zfs/zfsimpl.c
>   head/sys/cddl/boot/zfs/zfsimpl.h



-- 
Andriy Gapon
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r354283 - in head: stand/libsa/zfs sys/cddl/boot/zfs

2019-11-03 Thread Toomas Soome
Author: tsoome
Date: Sun Nov  3 13:25:47 2019
New Revision: 354283
URL: https://svnweb.freebsd.org/changeset/base/354283

Log:
  loader: we do not support booting from pool with log device
  
  If pool has log device, stop there and tell about it.

Modified:
  head/stand/libsa/zfs/zfs.c
  head/stand/libsa/zfs/zfsimpl.c
  head/sys/cddl/boot/zfs/zfsimpl.h

Modified: head/stand/libsa/zfs/zfs.c
==
--- head/stand/libsa/zfs/zfs.c  Sun Nov  3 13:03:47 2019(r354282)
+++ head/stand/libsa/zfs/zfs.c  Sun Nov  3 13:25:47 2019(r354283)
@@ -668,6 +668,11 @@ zfs_dev_open(struct open_file *f, ...)
spa = spa_find_by_guid(dev->pool_guid);
if (!spa)
return (ENXIO);
+   if (spa->spa_with_log) {
+   printf("Reading pool %s is not supported due to log device.\n",
+   spa->spa_name);
+   return (ENXIO);
+   }
mount = malloc(sizeof(*mount));
if (mount == NULL)
return (ENOMEM);

Modified: head/stand/libsa/zfs/zfsimpl.c
==
--- head/stand/libsa/zfs/zfsimpl.c  Sun Nov  3 13:03:47 2019
(r354282)
+++ head/stand/libsa/zfs/zfsimpl.c  Sun Nov  3 13:25:47 2019
(r354283)
@@ -1109,6 +1109,7 @@ vdev_init_from_nvlist(const unsigned char *nvlist, vde
const unsigned char *kids;
int nkids, i, is_new;
uint64_t is_offline, is_faulted, is_degraded, is_removed, isnt_present;
+   uint64_t is_log;
 
if (nvlist_find(nvlist, ZPOOL_CONFIG_GUID, DATA_TYPE_UINT64,
NULL, &guid)
@@ -1132,17 +1133,20 @@ vdev_init_from_nvlist(const unsigned char *nvlist, vde
}
 
is_offline = is_removed = is_faulted = is_degraded = isnt_present = 0;
+   is_log = 0;
 
nvlist_find(nvlist, ZPOOL_CONFIG_OFFLINE, DATA_TYPE_UINT64, NULL,
-   &is_offline);
+   &is_offline);
nvlist_find(nvlist, ZPOOL_CONFIG_REMOVED, DATA_TYPE_UINT64, NULL,
-   &is_removed);
+   &is_removed);
nvlist_find(nvlist, ZPOOL_CONFIG_FAULTED, DATA_TYPE_UINT64, NULL,
-   &is_faulted);
+   &is_faulted);
nvlist_find(nvlist, ZPOOL_CONFIG_DEGRADED, DATA_TYPE_UINT64, NULL,
-   &is_degraded);
+   &is_degraded);
nvlist_find(nvlist, ZPOOL_CONFIG_NOT_PRESENT, DATA_TYPE_UINT64, NULL,
-   &isnt_present);
+   &isnt_present);
+   nvlist_find(nvlist, ZPOOL_CONFIG_IS_LOG, DATA_TYPE_UINT64, NULL,
+   &is_log);
 
vdev = vdev_find(guid);
if (!vdev) {
@@ -1217,6 +1221,7 @@ vdev_init_from_nvlist(const unsigned char *nvlist, vde
return (ENOMEM);
vdev->v_name = name;
}
+   vdev->v_islog = is_log == 1;
} else {
is_new = 0;
}
@@ -1433,6 +1438,12 @@ vdev_status(vdev_t *vdev, int indent)
 {
vdev_t *kid;
int ret;
+
+   if (vdev->v_islog) {
+   (void)pager_output("logs\n");
+   indent++;
+   }
+
ret = print_state(indent, vdev->v_name, vdev->v_state);
if (ret != 0)
return (ret);
@@ -1737,6 +1748,12 @@ vdev_probe(vdev_phys_read_t *_read, void *read_priv, s
printf("ZFS: inconsistent nvlist contents\n");
return (EIO);
}
+
+   /*
+* We do not support reading pools with log device.
+*/
+   if (vdev->v_islog)
+   spa->spa_with_log = vdev->v_islog;
 
/*
 * Re-evaluate top-level vdev state.

Modified: head/sys/cddl/boot/zfs/zfsimpl.h
==
--- head/sys/cddl/boot/zfs/zfsimpl.hSun Nov  3 13:03:47 2019
(r354282)
+++ head/sys/cddl/boot/zfs/zfsimpl.hSun Nov  3 13:25:47 2019
(r354283)
@@ -1670,6 +1670,7 @@ typedef struct vdev {
vdev_phys_read_t *v_phys_read;  /* read from raw leaf vdev */
vdev_read_t *v_read;/* read from vdev */
void*v_read_priv;   /* private data for read function */
+   boolean_t   v_islog;
struct spa  *spa;   /* link to spa */
/*
 * Values stored in the config for an indirect or removing vdev.
@@ -1694,6 +1695,7 @@ typedef struct spa {
zio_cksum_salt_t spa_cksum_salt;/* secret salt for cksum */
void*spa_cksum_tmpls[ZIO_CHECKSUM_FUNCTIONS];
int spa_inited; /* initialized */
+   boolean_t   spa_with_log;   /* this pool has log */
 } spa_t;
 
 /* IO related arguments. */
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscri