History log of /freebsd/stand/libsa/zfs/zfs.c (Results 1 – 25 of 50)
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
# 1b3f4ccb 25-Feb-2024 Toomas Soome <tsoome@FreeBSD.org>

loader: we can only env_discard() existing variable

While dropping nvpair from nvstore, we also remove the corresponding
environment variable. By doing so, we should be careful not to try
to unset n

loader: we can only env_discard() existing variable

While dropping nvpair from nvstore, we also remove the corresponding
environment variable. By doing so, we should be careful not to try
to unset non-existing variable.

Reviewed by: imp
MFC after: 2 week
Differential revision: https://reviews.freebsd.org/D44083

show more ...


# 3e15b01d 22-Feb-2024 Warner Losh <imp@FreeBSD.org>

libsa: Remove redundant sys/cdefs.h

Sponsored by: Netflix


Revision tags: release/14.0.0
# 1d386b48 16-Aug-2023 Warner Losh <imp@FreeBSD.org>

Remove $FreeBSD$: one-line .c pattern

Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/


# b3e76948 16-Aug-2023 Warner Losh <imp@FreeBSD.org>

Remove $FreeBSD$: two-line .h pattern

Remove /^\s*\*\n \*\s+\$FreeBSD\$$\n/


# b765cfa3 01-May-2023 Warner Losh <imp@FreeBSD.org>

stand/zfs: Refactor zfs_get_bootonce

Lookup the spa and pass it into zfs_get_bootonce_spa to process the boot
once protocol.

Sponsored by: Netflix
Reviewed by: tsoome, kevans
Differential Revisio

stand/zfs: Refactor zfs_get_bootonce

Lookup the spa and pass it into zfs_get_bootonce_spa to process the boot
once protocol.

Sponsored by: Netflix
Reviewed by: tsoome, kevans
Differential Revision: https://reviews.freebsd.org/D39411

show more ...


# 4dcae288 01-May-2023 Warner Losh <imp@FreeBSD.org>

stand/zfs: Refactor zfs_set_bootenv

Refactor zfs_set_bootenv to split out the lookup of spa from the
rest. zfs_set_bootenv_spa flushes the benv to the vdevs and updates the
cached benv.

Sponsored b

stand/zfs: Refactor zfs_set_bootenv

Refactor zfs_set_bootenv to split out the lookup of spa from the
rest. zfs_set_bootenv_spa flushes the benv to the vdevs and updates the
cached benv.

Sponsored by: Netflix
Reviewed by: tsoome, kevans
Differential Revision: https://reviews.freebsd.org/D39410

show more ...


# 6479bd1b 01-May-2023 Warner Losh <imp@FreeBSD.org>

stand/zfs: Refactor zfs_get_bootenv

Create a new interface to zfs_get_bootenv called zfs_get_bootenv_spa
which takes a spa instead of a void * (effectively a devdesc *). Use
that in zfs_get_bootenv.

stand/zfs: Refactor zfs_get_bootenv

Create a new interface to zfs_get_bootenv called zfs_get_bootenv_spa
which takes a spa instead of a void * (effectively a devdesc *). Use
that in zfs_get_bootenv.

Sponsored by: Netflix
Reviewed by: tsoome, kevans
Differential Revision: https://reviews.freebsd.org/D39409

show more ...


# 439a9766 01-May-2023 Warner Losh <imp@FreeBSD.org>

stand/zfs: Move spa_find_by_dev from zfsimpl.c to zfs.c

zfsimpl.c doesn't know about devdesc at all, but zfs.c does. Move it to
zfs.c, which is the only user. Keep it static for now, but it could be

stand/zfs: Move spa_find_by_dev from zfsimpl.c to zfs.c

zfsimpl.c doesn't know about devdesc at all, but zfs.c does. Move it to
zfs.c, which is the only user. Keep it static for now, but it could be
exposed later if something else were to need it.

Sponsored by: Netflix
Reviewed by: tsoome, kevans
Differential Revision: https://reviews.freebsd.org/D39408

show more ...


Revision tags: release/13.2.0
# 5385c7e1 13-Jan-2023 Warner Losh <imp@FreeBSD.org>

stand/zfs: Fix memory leaking on error cases

Now that we return an allocated zfs_devdesc, we have to free it. These
frees were missing from the error cases. In addition, simplify the code
a bit for

stand/zfs: Fix memory leaking on error cases

Now that we return an allocated zfs_devdesc, we have to free it. These
frees were missing from the error cases. In addition, simplify the code
a bit for the out of memory case.

Sponsored by: Netflix
Reviewed by: kevans
Differential Revision: https://reviews.freebsd.org/D38006

show more ...


# 71bbe6fb 17-Dec-2022 Warner Losh <imp@FreeBSD.org>

stand/zfs: Add a third argument to zfs_probe_dev: part_too

Pass in 'true' if you'd like to search this device's partitions or
'false' if you should just search the device. EFI and (in the future)
kb

stand/zfs: Add a third argument to zfs_probe_dev: part_too

Pass in 'true' if you'd like to search this device's partitions or
'false' if you should just search the device. EFI and (in the future)
kboot have discrete partitions that aren't accessed via the full disk
device. Weird things happen if you try to search in these cases.

Sponsored by: Netflix

show more ...


# 33bbe5dd 30-Nov-2022 Warner Losh <imp@FreeBSD.org>

stand: parsedev API change: devspec now points to start of full device name

To support more flexible device matching, we now pass in the full
devspec to the parsedev routines. For everything execpt

stand: parsedev API change: devspec now points to start of full device name

To support more flexible device matching, we now pass in the full
devspec to the parsedev routines. For everything execpt uboot, this is
just a drop in (since everything except uboot and openfirmware always
uses disk...: and/or zfs:, but openfirmware isn't really affected).

uboot we kludge around it by subtracting 4 from where the rest of the
device name starts. This is unforunate, and can compute the address one
before the string. But we never dereference that address. uboot needs
more work, and this is an acceptable UB until that other work happens.

OFW doesn't really use the parsedev routines these days (since none of
the supported device uses this... yet). It too needs more work, but it
needs device matching support first.

Sponsored by: Netflix
Reviewed by: delphij
Differential Revision: https://reviews.freebsd.org/D37553

show more ...


# 90412431 30-Nov-2022 Warner Losh <imp@FreeBSD.org>

stand: make zfs_parsedev static

It's now unreferenced outside of zfs.c.

Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D37344


# ca0654ba 30-Nov-2022 Warner Losh <imp@FreeBSD.org>

stand/zfs: Connect dv_parsedev to zfs_parsedev

Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D37348


# ba11bc36 30-Nov-2022 Warner Losh <imp@FreeBSD.org>

stand: Change zfs_parsedev() API

Change the first argument to zfs_parsedev() to be a pointer to a struct
devdesc *. This now gets filled in with a malloc'd structure that's
returned to the caller th

stand: Change zfs_parsedev() API

Change the first argument to zfs_parsedev() to be a pointer to a struct
devdesc *. This now gets filled in with a malloc'd structure that's
returned to the caller that the caller is repsonsible for freeing. Most
nplaces in the tree passed in a malloc'd pointer anyway, and this moves
knowledge of zfs_devdesc more firmly into the zfs.c code.

Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D37336

show more ...


Revision tags: release/12.4.0
# d98de744 14-Aug-2022 Toomas Soome <tsoome@FreeBSD.org>

loader: zfs reader should only store devdesc in f_devdata

Use d_opendata for device specific data.

PR: 265825
Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D36202


# edb26097 11-Aug-2022 Warner Losh <imp@FreeBSD.org>

stand: Replace zfs_fmtdev with generic devformat()

Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D35973


# 654b7837 11-Aug-2022 Warner Losh <imp@FreeBSD.org>

stand: For zfs, set dv_fmtdev to zfs_fmtdev

Add a generic way to get the string representation of a zfs device / mount.

Sponsored by: Netflix
Reviewed by: tsoome (prior version)
Differential Revi

stand: For zfs, set dv_fmtdev to zfs_fmtdev

Add a generic way to get the string representation of a zfs device / mount.

Sponsored by: Netflix
Reviewed by: tsoome (prior version)
Differential Revision: https://reviews.freebsd.org/D35923

show more ...


# d2d4e127 11-Aug-2022 Warner Losh <imp@FreeBSD.org>

stand: Change zfs_fmtdev to take a struct devdesc *

Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D35974


# e98f952c 27-Jul-2022 Warner Losh <imp@FreeBSD.org>

stand: Make sure nobody has a NULL pointer for dv_cleanup

dv_cleanup is specified almost everywhere. Use nullsys instead of NULL
to indicate 'do nothing'. Also, be consistent in trailing commas that

stand: Make sure nobody has a NULL pointer for dv_cleanup

dv_cleanup is specified almost everywhere. Use nullsys instead of NULL
to indicate 'do nothing'. Also, be consistent in trailing commas that
were missing before.

Sponsored by: Netflix
Reviewed by: tsoome
Differential Revision: https://reviews.freebsd.org/D35913

show more ...


Revision tags: release/13.1.0, release/12.3.0
# b4cb3fe0 12-Aug-2021 Toomas Soome <tsoome@FreeBSD.org>

loader: implement mount/unmount rootfs

We want to keep our root file system open to preserve bcache segment
between file accesses, thus reducing physical disk IO.

Reviewed by: imp, allanjude, kevan

loader: implement mount/unmount rootfs

We want to keep our root file system open to preserve bcache segment
between file accesses, thus reducing physical disk IO.

Reviewed by: imp, allanjude, kevans (previous version)
Differential Revision: https://reviews.freebsd.org/D30848
MFC after: 1 month

show more ...


Revision tags: release/13.0.0, release/12.2.0
# e416eecb 22-Oct-2020 Toomas Soome <tsoome@FreeBSD.org>

loader: revert r342161 and r342151

We are using asize property from pool label and we do not depend
on partition data to find last two pool labels and to validate LBA for disk IO.

This does allow u

loader: revert r342161 and r342151

We are using asize property from pool label and we do not depend
on partition data to find last two pool labels and to validate LBA for disk IO.

This does allow us to re-enable support for partitionless disk setups.

show more ...


# 867ae3c3 23-Sep-2020 Toomas Soome <tsoome@FreeBSD.org>

loader: zfs_probe_dev should pick first matching zfs pool

During devswitch probe, we pick boot pool based on boot disk, if the boot
disk happens to have multiple pools in freebsd-zfs partitions, the

loader: zfs_probe_dev should pick first matching zfs pool

During devswitch probe, we pick boot pool based on boot disk, if the boot
disk happens to have multiple pools in freebsd-zfs partitions, the current
code does pick last pool from boot disk as boot pool. While there is no
way at that stage to test, the more logical approach would be to pick
first matching pool.

This patch is assuming we do pass pool guid pointer with guid value 0,
this will help us to determine, if the guid value is already set or not.

The general suggestion would be not to share disk between different pools.

Reported by: Alexander Leidinger

show more ...


# e307eb94 21-Sep-2020 Toomas Soome <tsoome@FreeBSD.org>

loader: zfs should support bootonce an nextboot

bootonce feature is temporary, one time boot, activated by
"bectl activate -t BE", "bectl activate -T BE" will reset the bootonce flag.

By default, t

loader: zfs should support bootonce an nextboot

bootonce feature is temporary, one time boot, activated by
"bectl activate -t BE", "bectl activate -T BE" will reset the bootonce flag.

By default, the bootonce setting is reset on attempt to boot and the next
boot will use previously active BE.

By setting zfs_bootonce_activate="YES" in rc.conf, the bootonce BE will
be set permanently active.

bootonce dataset name is recorded in boot pool labels, bootenv area.

in case of nextboot, the nextboot_enable boolean variable is recorded in
freebsd:nvstore nvlist, also stored in boot pool label bootenv area.
On boot, the loader will process /boot/nextboot.conf if nextboot_enable
is "YES", and will set nextboot_enable to "NO", preventing /boot/nextboot.conf
processing on next boot.

bootonce and nextboot features are usable in both UEFI and BIOS boot.

To use bootonce/nextboot features, the boot loader needs to be updated on disk;
if loader.efi is stored on ESP, then ESP needs to be updated and
for BIOS boot, stage2 (zfsboot or gptzfsboot) needs to be updated
(gpart or other tools).

At this time, only lua loader is updated.

Sponsored by: Netflix, Klara Inc.
Differential Revision: https://reviews.freebsd.org/D25512

show more ...


# e2515283 27-Aug-2020 Glen Barber <gjb@FreeBSD.org>

MFH

Sponsored by: Rubicon Communications, LLC (netgate.com)


# 277f38ab 18-Aug-2020 Mariusz Zaborski <oshogbo@FreeBSD.org>

zfs: add an option to the bootloader to rewind the ZFS checkpoint

The checkpoints are another way of keeping the state of ZFS.
During the rewind, the pool has to be exported.
This makes checkpoints

zfs: add an option to the bootloader to rewind the ZFS checkpoint

The checkpoints are another way of keeping the state of ZFS.
During the rewind, the pool has to be exported.
This makes checkpoints unusable when using ZFS as root.
Add the option to rewind the ZFS checkpoint at the boot time.
If checkpoint exists, a new option for rewinding a checkpoint will appear in
the bootloader menu.
We fully support boot environments.
If the rewind option is selected, the boot loader will show a list of
boot environments that existed before the checkpoint.

Reviewed by: tsoome, allanjude, kevans (ok with high-level overview)
Differential Revision: https://reviews.freebsd.org/D24920

show more ...


12