| #
6c406b5b
|
| 25-Oct-2025 |
Konstantin Belousov <kib@FreeBSD.org> |
exterror(9): add infra for bufs and bios
The extended error can be stored in either struct bio or struct buf, indicated by BIO_EXTERR bio_flag. At some strategic places, it is copied into the curre
exterror(9): add infra for bufs and bios
The extended error can be stored in either struct bio or struct buf, indicated by BIO_EXTERR bio_flag. At some strategic places, it is copied into the current thread extended error.
This structure is required because io request from the top might pass down through several io threads and the context that can report meaningful extended error does not belong to the thread that initiated the io.
Sizes before the change, on amd64 nodebug: sizeof(struct buf) = 456 sizeof(struct bio) = 376
after: sizeof(struct buf) = 496 sizeof(struct bio) = 408
WIP: more geom providers should handle BIO_EXTERR when passing cloned bios down and then handling completions.
Reviewed by: mckusick Sponsored by: The FreeBSD Foundation Differential revision: https://reviews.freebsd.org/D53351
show more ...
|
| #
36138969
|
| 16-Oct-2025 |
Konstantin Belousov <kib@FreeBSD.org> |
knotes: kqueue: handle copy for trivial filters
Reviewed by: markj Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Differential revision: https://reviews.freebsd.org/D52045
|
| #
656f7f43
|
| 29-Jul-2025 |
Wuyang Chung <wy-chung@outlook.com> |
call g_new_geom instead for callers that pass regular string to g_new_geomf
Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/1786
|
| #
e453e498
|
| 11-Jun-2025 |
Brooks Davis <brooks@FreeBSD.org> |
machine/stdarg.h -> sys/stdarg.h
Switch to using sys/stdarg.h for va_list type and va_* builtins.
Make an attempt to insert the include in a sensible place. Where style(9) was followed this is eas
machine/stdarg.h -> sys/stdarg.h
Switch to using sys/stdarg.h for va_list type and va_* builtins.
Make an attempt to insert the include in a sensible place. Where style(9) was followed this is easy, where it was ignored, aim for the first block of sys/*.h headers and don't get too fussy or try to fix other style bugs.
Reviewed by: imp Exp-run by: antoine (PR 286274) Pull Request: https://github.com/freebsd/freebsd-src/pull/1595
show more ...
|
| #
f7856fe8
|
| 13-Mar-2025 |
Fabian Keil <fk@fabiankeil.de> |
g_dev_orphan(): Return early if the device is already gone
The following panic was the result of running "cdcontrol eject" after using the physical ejection key on the device before the tray was act
g_dev_orphan(): Return early if the device is already gone
The following panic was the result of running "cdcontrol eject" after using the physical ejection key on the device before the tray was actually ejected. So we have hardware racing software.
The device was loaded with a DVD.
Resulted in a NULL pointer dereference
g_dev_orphan() at g_dev_orphan+0x2e/frame 0xfffffe01eba0a9f0 g_resize_provider_event() at g_resize_provider_event+0x71/frame 0xfffffe01eba0aa20 g_run_events() at g_run_events+0x20e/frame 0xfffffe01eba0aa70 fork_exit() at fork_exit+0x85/frame 0xfffffe01eba0aab0 fork_trampoline() at fork_trampoline+0xe/frame 0xfffffe01eba0aab0
Avoid this possibility and return early of dev is NULL already.
PR: 215856 Reviewed by: imp (I've triggered this once or twice over the years too) Sponsored by: Netflix
show more ...
|
| #
ef9ffb85
|
| 25-Nov-2024 |
Mark Johnston <markj@FreeBSD.org> |
kern: Make fileops and filterops tables const where possible
No functional change intended.
MFC after: 1 week
|
| #
fdafd315
|
| 24-Nov-2023 |
Warner Losh <imp@FreeBSD.org> |
sys: Automated cleanup of cdefs and other formatting
Apply the following automated changes to try to eliminate no-longer-needed sys/cdefs.h includes as well as now-empty blank lines in a row.
Remov
sys: Automated cleanup of cdefs and other formatting
Apply the following automated changes to try to eliminate no-longer-needed sys/cdefs.h includes as well as now-empty blank lines in a row.
Remove /^#if.*\n#endif.*\n#include\s+<sys/cdefs.h>.*\n/ Remove /\n+#include\s+<sys/cdefs.h>.*\n+#if.*\n#endif.*\n+/ Remove /\n+#if.*\n#endif.*\n+/ Remove /^#if.*\n#endif.*\n/ Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/types.h>/ Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/param.h>/ Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/capsicum.h>/
Sponsored by: Netflix
show more ...
|
| #
685dc743
|
| 16-Aug-2023 |
Warner Losh <imp@FreeBSD.org> |
sys: Remove $FreeBSD$: one-line .c pattern
Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/
|
| #
bd5d9037
|
| 28-Dec-2022 |
Zhenlei Huang <zlei@FreeBSD.org> |
GEOM: Remove redundant NULL pointer check before g_free()
Reviewed by: melifaro, pjd, imp Approved by: kp (mentor) Differential Revision: https://reviews.freebsd.org/D37779
|
| #
5f438dd3
|
| 10-Jun-2022 |
Alan Somers <asomers@FreeBSD.org> |
ses: don't panic if disk elements have really weird descriptors
SES allows element descriptors to contain characters like spaces and quotes that devfs does not allow to appear in device aliases. Si
ses: don't panic if disk elements have really weird descriptors
SES allows element descriptors to contain characters like spaces and quotes that devfs does not allow to appear in device aliases. Since SES element descriptors are outside of the kernel's control, we should gracefully handle a failure to create a device physical path alias.
PR: 264513 Reported by: Yuri <yuri@aetern.org> Reviewed by: imp, mav Sponsored by: Axcient MFC after: 2 weeks
show more ...
|
| #
65c87a6c
|
| 28-Apr-2022 |
Robert Wing <rew@FreeBSD.org> |
geom_dev: extend kevent support for geom dev
Add support for the following NOTE events: NOTE_OPEN, NOTE_CLOSE, NOTE_CLOSE_WRITE, NOTE_READ, and NOTE_WRITE.
Differential Revision: https://review
geom_dev: extend kevent support for geom dev
Add support for the following NOTE events: NOTE_OPEN, NOTE_CLOSE, NOTE_CLOSE_WRITE, NOTE_READ, and NOTE_WRITE.
Differential Revision: https://reviews.freebsd.org/D34777
show more ...
|
| #
0a90043e
|
| 14-Apr-2022 |
Mitchell Horne <mhorne@FreeBSD.org> |
Remove 12.x ABI compat for kernel dump ioctls
This code was marked gone_in(14), so it can now be removed.
The only consumer of this interface is dumpon(8). We do not maintain strict backwards compa
Remove 12.x ABI compat for kernel dump ioctls
This code was marked gone_in(14), so it can now be removed.
The only consumer of this interface is dumpon(8). We do not maintain strict backwards compatibility for this utility because a) it can't/shouldn't be used from a jail or chroot and b) it is highly specific interface unique to FreeBSD. The host's (presumably more up-to-date) copy of dumpon(8) should be used to configure kernel dump devices.
Reviewed by: markj, emaste MFC after: never Differential Revision: https://reviews.freebsd.org/D34914
show more ...
|
| #
9c90bfcd
|
| 14-Apr-2022 |
Mitchell Horne <mhorne@FreeBSD.org> |
Remove 11.x ABI compat for kernel dump ioctls
This code was marked gone_in(13), so its time has passed.
The only consumer of this interface is dumpon(8). We do not maintain strict backwards compati
Remove 11.x ABI compat for kernel dump ioctls
This code was marked gone_in(13), so its time has passed.
The only consumer of this interface is dumpon(8). We do not maintain strict backwards compatibility for this utility because a) it can't/shouldn't be used from a jail or chroot and b) it is highly specific interface unique to FreeBSD. The host's (presumably more up-to-date) copy of dumpon(8) should be used to configure kernel dump devices.
Reviewed by: markj, emaste MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D34913
show more ...
|
| #
d91d2b51
|
| 20-Jan-2022 |
Mark Johnston <markj@FreeBSD.org> |
geom: Handle partial I/O in g_{read,write,delete}_data()
These routines are used internally by GEOM to dispatch I/O requests to a provider, typically for tasting or for updating GEOM class metadata
geom: Handle partial I/O in g_{read,write,delete}_data()
These routines are used internally by GEOM to dispatch I/O requests to a provider, typically for tasting or for updating GEOM class metadata blocks.
These routines assumed that partial I/O did not occur without setting BIO_ERROR, but this is possible in at least two cases: - Some or all of the I/O range is beyond the provider's mediasize. In this scenario g_io_check() truncates the bounds of the request before it is handed to the target provider. - A read from vnode-backed md(4) device returns EOF (the backing vnode is allowed to be smaller than the device itself) or partial vnode I/O occurs. In these scenarios g_read_data() could return a partially uninitialized buffer. Many consumers are not affected by the first case, since the offsets used for provider metadata or tasting are relative to the provider's mediasize, but in some cases metadata is read at fixed offsets, such as when searching for a UFS superblock using the offsets defined by SBLOCKSEARCH.
Thus, modify the routines to explicitly check for a non-zero residual and return EIO in that case. Remove a related check from the DIOCGDELETE ioctl handler, it is handled within g_delete_data() now.
Reviewed by: mav, imp, kib Reported by: KMSAN MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D31293
show more ...
|
| #
a50e92cc
|
| 18-Jan-2022 |
Robert Wing <rew@FreeBSD.org> |
geom: add kqfilter support for geom dev
The only event hooked up is NOTE_ATTRIB, which is triggered when the device is resized. Support for other NOTE_* events to follow.
Reviewed by: kib, jhb Diff
geom: add kqfilter support for geom dev
The only event hooked up is NOTE_ATTRIB, which is triggered when the device is resized. Support for other NOTE_* events to follow.
Reviewed by: kib, jhb Differential Revision: https://reviews.freebsd.org/D33402
show more ...
|
| #
cd853791
|
| 28-Nov-2020 |
Konstantin Belousov <kib@FreeBSD.org> |
Make MAXPHYS tunable. Bump MAXPHYS to 1M.
Replace MAXPHYS by runtime variable maxphys. It is initialized from MAXPHYS by default, but can be also adjusted with the tunable kern.maxphys.
Make b_pag
Make MAXPHYS tunable. Bump MAXPHYS to 1M.
Replace MAXPHYS by runtime variable maxphys. It is initialized from MAXPHYS by default, but can be also adjusted with the tunable kern.maxphys.
Make b_pages[] array in struct buf flexible. Size b_pages[] for buffer cache buffers exactly to atop(maxbcachebuf) (currently it is sized to atop(MAXPHYS)), and b_pages[] for pbufs is sized to atop(maxphys) + 1. The +1 for pbufs allow several pbuf consumers, among them vmapbuf(), to use unaligned buffers still sized to maxphys, esp. when such buffers come from userspace (*). Overall, we save significant amount of otherwise wasted memory in b_pages[] for buffer cache buffers, while bumping MAXPHYS to desired high value.
Eliminate all direct uses of the MAXPHYS constant in kernel and driver sources, except a place which initialize maxphys. Some random (and arguably weird) uses of MAXPHYS, e.g. in linuxolator, are converted straight. Some drivers, which use MAXPHYS to size embeded structures, get private MAXPHYS-like constant; their convertion is out of scope for this work.
Changes to cam/, dev/ahci, dev/ata, dev/mpr, dev/mpt, dev/mvs, dev/siis, where either submitted by, or based on changes by mav.
Suggested by: mav (*) Reviewed by: imp, mav, imp, mckusick, scottl (intermediate versions) Tested by: pho Sponsored by: The FreeBSD Foundation Differential revision: https://reviews.freebsd.org/D27225
show more ...
|
| #
a3f4217e
|
| 27-Oct-2020 |
Warner Losh <imp@FreeBSD.org> |
Remove frontstuff
Nothing implements this in the tree. Remove the ioctl and the conversion to the geom atttribute stuff.
This was introduced in r94287 in 2002 and was retired in r113390 2003. It ap
Remove frontstuff
Nothing implements this in the tree. Remove the ioctl and the conversion to the geom atttribute stuff.
This was introduced in r94287 in 2002 and was retired in r113390 2003. It appeared in FreeBSD 5.0, but no other releases. This is a vestige that was missed at the time and overlooked until now. No compat is provided for this reason. And there's no implementation of it today. And it was never part of a release from a stable branch.
Reviewed by: phk@ Differential Revision: https://reviews.freebsd.org/D26967
show more ...
|
| #
3001e97d
|
| 19-Oct-2020 |
Edward Tomasz Napierala <trasz@FreeBSD.org> |
Fix fallout from r366811.
PR: 250442 Reported by: lwhsu Reviewed by: mav MFC after: 2 weeks Sponsored by: NetApp, Inc. Sponsored by: Klara, Inc. Differential Revision: https://reviews.freebsd.org/D
Fix fallout from r366811.
PR: 250442 Reported by: lwhsu Reviewed by: mav MFC after: 2 weeks Sponsored by: NetApp, Inc. Sponsored by: Klara, Inc. Differential Revision: https://reviews.freebsd.org/D26855
show more ...
|
| #
d22ff249
|
| 18-Oct-2020 |
Edward Tomasz Napierala <trasz@FreeBSD.org> |
Make g_attach() return ENXIO for orphaned providers; update various classes to add missing error checking.
Reviewed by: imp MFC after: 2 weeks Sponsored by: NetApp, Inc. Sponsored by: Klara, Inc. Di
Make g_attach() return ENXIO for orphaned providers; update various classes to add missing error checking.
Reviewed by: imp MFC after: 2 weeks Sponsored by: NetApp, Inc. Sponsored by: Klara, Inc. Differential Revision: https://reviews.freebsd.org/D26658
show more ...
|
| #
887611b1
|
| 29-Aug-2020 |
Warner Losh <imp@FreeBSD.org> |
Retire devctl_notify_f()
devctl_notify_f isn't needed, so retire it. The flags argument is now unused, so rather than keep it around, retire it. Convert all old users of it to devctl_notify(). This
Retire devctl_notify_f()
devctl_notify_f isn't needed, so retire it. The flags argument is now unused, so rather than keep it around, retire it. Convert all old users of it to devctl_notify(). This path no longer sleeps, so is safe to call from any context. Since it doesn't sleep, it doesn't need to know if it is OK to sleep or not.
Reviewed by: markj@ Differential Revision: https://reviews.freebsd.org/D26140
show more ...
|
| #
e2515283
|
| 27-Aug-2020 |
Glen Barber <gjb@FreeBSD.org> |
MFH
Sponsored by: Rubicon Communications, LLC (netgate.com)
|
| #
773e541e
|
| 21-Aug-2020 |
Warner Losh <imp@FreeBSD.org> |
Use devctl.h instead of bus.h to reduce newbus pollution.
There's no need for these parts of the kernel to know about newbus, so narrow what is included to devctl.h for device_notify_*.
Suggested b
Use devctl.h instead of bus.h to reduce newbus pollution.
There's no need for these parts of the kernel to know about newbus, so narrow what is included to devctl.h for device_notify_*.
Suggested by: kib@
show more ...
|
| #
8510f61a
|
| 09-Jul-2020 |
Xin LI <delphij@FreeBSD.org> |
sys/geom: consistently use _PATH_DEV instead of hardcoding "/dev/".
Reviewed by: cem MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D25565
|
| #
4a711b8d
|
| 25-Jun-2020 |
John Baldwin <jhb@FreeBSD.org> |
Use zfree() instead of explicit_bzero() and free().
In addition to reducing lines of code, this also ensures that the full allocation is always zeroed avoiding possible bugs with incorrect lengths p
Use zfree() instead of explicit_bzero() and free().
In addition to reducing lines of code, this also ensures that the full allocation is always zeroed avoiding possible bugs with incorrect lengths passed to explicit_bzero().
Suggested by: cem Reviewed by: cem, delphij Approved by: csprng (cem) Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D25435
show more ...
|
| #
a9ca503b
|
| 06-Jun-2020 |
Conrad Meyer <cem@FreeBSD.org> |
Revert r361838
Reported by: delphij
|