CVS commit: src/sys/dev/dkwedge

2024-04-06 Thread Juergen Hannken-Illjes
Module Name:src Committed By: hannken Date: Sat Apr 6 09:51:34 UTC 2024 Modified Files: src/sys/dev/dkwedge: dkwedge_tos.c Log Message: Use "%zu" for type "size_t". Kernel ALL/i386 compiles again. To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2

CVS commit: src/sys/dev/dkwedge

2024-04-06 Thread Juergen Hannken-Illjes
Module Name:src Committed By: hannken Date: Sat Apr 6 09:51:34 UTC 2024 Modified Files: src/sys/dev/dkwedge: dkwedge_tos.c Log Message: Use "%zu" for type "size_t". Kernel ALL/i386 compiles again. To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2

CVS commit: src/sys/dev/dkwedge

2024-02-26 Thread Charlotte Koch
Module Name:src Committed By: charlotte Date: Mon Feb 26 21:55:05 UTC 2024 Modified Files: src/sys/dev/dkwedge: dkwedge_mbr.c Log Message: In case of trouble reading an MBR, make sure error field is set before reporting it To generate a diff of this commit: cvs rdiff

CVS commit: src/sys/dev/dkwedge

2024-02-26 Thread Charlotte Koch
Module Name:src Committed By: charlotte Date: Mon Feb 26 21:55:05 UTC 2024 Modified Files: src/sys/dev/dkwedge: dkwedge_mbr.c Log Message: In case of trouble reading an MBR, make sure error field is set before reporting it To generate a diff of this commit: cvs rdiff

CVS commit: src/sys/dev/dkwedge

2023-05-22 Thread Taylor R Campbell
Module Name:src Committed By: riastradh Date: Mon May 22 15:00:17 UTC 2023 Modified Files: src/sys/dev/dkwedge: dk.c Log Message: dk(4): Add locking notes. To generate a diff of this commit: cvs rdiff -u -r1.170 -r1.171 src/sys/dev/dkwedge/dk.c Please note that diffs

CVS commit: src/sys/dev/dkwedge

2023-05-22 Thread Taylor R Campbell
Module Name:src Committed By: riastradh Date: Mon May 22 14:59:58 UTC 2023 Modified Files: src/sys/dev/dkwedge: dk.c Log Message: dk(4): Strengthen preconditions of various devsw operations. These can only happen between dkopen and dkclose, so there's no need to test --

CVS commit: src/sys/dev/dkwedge

2023-05-22 Thread Taylor R Campbell
Module Name:src Committed By: riastradh Date: Mon May 22 14:59:50 UTC 2023 Modified Files: src/sys/dev/dkwedge: dk.c Log Message: dk(4): Strengthen dkclose preconditions. Like dkopen, except it is possible for this to be called after the wedge has transitioned to dying.

CVS commit: src/sys/dev/dkwedge

2023-05-22 Thread Taylor R Campbell
Module Name:src Committed By: riastradh Date: Mon May 22 14:59:42 UTC 2023 Modified Files: src/sys/dev/dkwedge: dk.c Log Message: dk(4): Strengthen dkopen preconditions. This cannot be called before dkwedge_attach for the same unit returns, so sc->sc_dev is guaranteed to

CVS commit: src/sys/dev/dkwedge

2023-05-22 Thread Taylor R Campbell
Module Name:src Committed By: riastradh Date: Mon May 22 14:59:34 UTC 2023 Modified Files: src/sys/dev/dkwedge: dk.c Log Message: dk(4): Prevent race between dkwedge_get_parent_name and wedge detach. Still races with parent detach but maybe this is better. XXX Maybe we

CVS commit: src/sys/dev/dkwedge

2023-05-22 Thread Taylor R Campbell
Module Name:src Committed By: riastradh Date: Mon May 22 14:59:34 UTC 2023 Modified Files: src/sys/dev/dkwedge: dk.c Log Message: dk(4): Prevent race between dkwedge_get_parent_name and wedge detach. Still races with parent detach but maybe this is better. XXX Maybe we

CVS commit: src/sys/dev/dkwedge

2023-05-22 Thread Taylor R Campbell
Module Name:src Committed By: riastradh Date: Mon May 22 14:59:25 UTC 2023 Modified Files: src/sys/dev/dkwedge: dk.c Log Message: dk(4): Split unsafe lookups into safe subroutines and unsafe wrappers. No functional change intended. Eventually we should adjust the

CVS commit: src/sys/dev/dkwedge

2023-05-22 Thread Taylor R Campbell
Module Name:src Committed By: riastradh Date: Mon May 22 14:59:17 UTC 2023 Modified Files: src/sys/dev/dkwedge: dk.c Log Message: dk(4): Don't hold lock around uiomove in dkwedge_list. Instead, hold a device reference. dkwedge_detach will not run until the device

CVS commit: src/sys/dev/dkwedge

2023-05-22 Thread Taylor R Campbell
Module Name:src Committed By: riastradh Date: Mon May 22 14:59:08 UTC 2023 Modified Files: src/sys/dev/dkwedge: dk.c Log Message: dk(4): Skip larval wedges in various lookup routines. These have not yet finished a concurent dkwedge_attach, so there's nothing we can

CVS commit: src/sys/dev/dkwedge

2023-05-22 Thread Taylor R Campbell
Module Name:src Committed By: riastradh Date: Mon May 22 14:58:59 UTC 2023 Modified Files: src/sys/dev/dkwedge: dk.c Log Message: dk(4): Simplify dkwedge_delall by detaching directly. No need for O(n^2) algorithm and potentially racy lookups -- not that n is large enough

CVS commit: src/sys/dev/dkwedge

2023-05-22 Thread Taylor R Campbell
Module Name:src Committed By: riastradh Date: Mon May 22 14:58:59 UTC 2023 Modified Files: src/sys/dev/dkwedge: dk.c Log Message: dk(4): Simplify dkwedge_delall by detaching directly. No need for O(n^2) algorithm and potentially racy lookups -- not that n is large enough

CVS commit: src/sys/dev/dkwedge

2023-05-22 Thread Taylor R Campbell
Module Name:src Committed By: riastradh Date: Mon May 22 14:58:51 UTC 2023 Modified Files: src/sys/dev/dkwedge: dk.c Log Message: dk(4): Use device_lookup_private for dkwedge_lookup. No longer necessary to go through the dkwedges array. Currently device_lookup_private

CVS commit: src/sys/dev/dkwedge

2023-05-22 Thread Taylor R Campbell
Module Name:src Committed By: riastradh Date: Mon May 22 15:00:06 UTC 2023 Modified Files: src/sys/dev/dkwedge: dk.c Log Message: dk(4): Explain why no need for device reference in dksize, dkdump. To generate a diff of this commit: cvs rdiff -u -r1.169 -r1.170

CVS commit: src/sys/dev/dkwedge

2023-05-22 Thread Taylor R Campbell
Module Name:src Committed By: riastradh Date: Mon May 22 15:00:06 UTC 2023 Modified Files: src/sys/dev/dkwedge: dk.c Log Message: dk(4): Explain why no need for device reference in dksize, dkdump. To generate a diff of this commit: cvs rdiff -u -r1.169 -r1.170

CVS commit: src/sys/dev/dkwedge

2023-05-22 Thread Taylor R Campbell
Module Name:src Committed By: riastradh Date: Mon May 22 15:00:17 UTC 2023 Modified Files: src/sys/dev/dkwedge: dk.c Log Message: dk(4): Add locking notes. To generate a diff of this commit: cvs rdiff -u -r1.170 -r1.171 src/sys/dev/dkwedge/dk.c Please note that diffs

CVS commit: src/sys/dev/dkwedge

2023-05-22 Thread Taylor R Campbell
Module Name:src Committed By: riastradh Date: Mon May 22 14:59:58 UTC 2023 Modified Files: src/sys/dev/dkwedge: dk.c Log Message: dk(4): Strengthen preconditions of various devsw operations. These can only happen between dkopen and dkclose, so there's no need to test --

CVS commit: src/sys/dev/dkwedge

2023-05-22 Thread Taylor R Campbell
Module Name:src Committed By: riastradh Date: Mon May 22 14:58:33 UTC 2023 Modified Files: src/sys/dev/dkwedge: dk.c Log Message: dk(4): Use config_attach_pseudo_acquire to create wedges. This way, indexing of the dkwedges array coincides with numbering of autoconf dk(4)

CVS commit: src/sys/dev/dkwedge

2023-05-22 Thread Taylor R Campbell
Module Name:src Committed By: riastradh Date: Mon May 22 14:59:50 UTC 2023 Modified Files: src/sys/dev/dkwedge: dk.c Log Message: dk(4): Strengthen dkclose preconditions. Like dkopen, except it is possible for this to be called after the wedge has transitioned to dying.

CVS commit: src/sys/dev/dkwedge

2023-05-22 Thread Taylor R Campbell
Module Name:src Committed By: riastradh Date: Mon May 22 14:58:41 UTC 2023 Modified Files: src/sys/dev/dkwedge: dk.c Log Message: dk(4): dkunit is no longer needed; nix it. dkwedges array indexing now coincides with autoconf device numbering. To generate a diff of this

CVS commit: src/sys/dev/dkwedge

2023-05-22 Thread Taylor R Campbell
Module Name:src Committed By: riastradh Date: Mon May 22 14:59:42 UTC 2023 Modified Files: src/sys/dev/dkwedge: dk.c Log Message: dk(4): Strengthen dkopen preconditions. This cannot be called before dkwedge_attach for the same unit returns, so sc->sc_dev is guaranteed to

CVS commit: src/sys/dev/dkwedge

2023-05-22 Thread Taylor R Campbell
Module Name:src Committed By: riastradh Date: Mon May 22 14:59:25 UTC 2023 Modified Files: src/sys/dev/dkwedge: dk.c Log Message: dk(4): Split unsafe lookups into safe subroutines and unsafe wrappers. No functional change intended. Eventually we should adjust the

CVS commit: src/sys/dev/dkwedge

2023-05-22 Thread Taylor R Campbell
Module Name:src Committed By: riastradh Date: Mon May 22 14:59:17 UTC 2023 Modified Files: src/sys/dev/dkwedge: dk.c Log Message: dk(4): Don't hold lock around uiomove in dkwedge_list. Instead, hold a device reference. dkwedge_detach will not run until the device

CVS commit: src/sys/dev/dkwedge

2023-05-22 Thread Taylor R Campbell
Module Name:src Committed By: riastradh Date: Mon May 22 14:59:08 UTC 2023 Modified Files: src/sys/dev/dkwedge: dk.c Log Message: dk(4): Skip larval wedges in various lookup routines. These have not yet finished a concurent dkwedge_attach, so there's nothing we can

CVS commit: src/sys/dev/dkwedge

2023-05-22 Thread Taylor R Campbell
Module Name:src Committed By: riastradh Date: Mon May 22 14:58:51 UTC 2023 Modified Files: src/sys/dev/dkwedge: dk.c Log Message: dk(4): Use device_lookup_private for dkwedge_lookup. No longer necessary to go through the dkwedges array. Currently device_lookup_private

CVS commit: src/sys/dev/dkwedge

2023-05-22 Thread Taylor R Campbell
Module Name:src Committed By: riastradh Date: Mon May 22 14:58:41 UTC 2023 Modified Files: src/sys/dev/dkwedge: dk.c Log Message: dk(4): dkunit is no longer needed; nix it. dkwedges array indexing now coincides with autoconf device numbering. To generate a diff of this

CVS commit: src/sys/dev/dkwedge

2023-05-22 Thread Taylor R Campbell
Module Name:src Committed By: riastradh Date: Mon May 22 14:58:33 UTC 2023 Modified Files: src/sys/dev/dkwedge: dk.c Log Message: dk(4): Use config_attach_pseudo_acquire to create wedges. This way, indexing of the dkwedges array coincides with numbering of autoconf dk(4)

CVS commit: src/sys/dev/dkwedge

2023-05-13 Thread Taylor R Campbell
Module Name:src Committed By: riastradh Date: Sat May 13 10:11:36 UTC 2023 Modified Files: src/sys/dev/dkwedge: dk.c Log Message: dk(4): Need pdk->dk_openlock to read pdk->dk_wedges. To generate a diff of this commit: cvs rdiff -u -r1.157 -r1.158

CVS commit: src/sys/dev/dkwedge

2023-05-13 Thread Taylor R Campbell
Module Name:src Committed By: riastradh Date: Sat May 13 10:11:36 UTC 2023 Modified Files: src/sys/dev/dkwedge: dk.c Log Message: dk(4): Need pdk->dk_openlock to read pdk->dk_wedges. To generate a diff of this commit: cvs rdiff -u -r1.157 -r1.158

CVS commit: src/sys/dev/dkwedge

2023-05-10 Thread Taylor R Campbell
Module Name:src Committed By: riastradh Date: Wed May 10 23:08:24 UTC 2023 Modified Files: src/sys/dev/dkwedge: dk.c Log Message: dk(4): Make it clearer that dkopen EROFS branch doesn't leak. It looked like we may need to sometimes call dklastclose in error branch for

CVS commit: src/sys/dev/dkwedge

2023-05-10 Thread Taylor R Campbell
Module Name:src Committed By: riastradh Date: Wed May 10 23:08:24 UTC 2023 Modified Files: src/sys/dev/dkwedge: dk.c Log Message: dk(4): Make it clearer that dkopen EROFS branch doesn't leak. It looked like we may need to sometimes call dklastclose in error branch for

CVS commit: src/sys/dev/dkwedge

2023-05-09 Thread Taylor R Campbell
Module Name:src Committed By: riastradh Date: Tue May 9 13:14:14 UTC 2023 Modified Files: src/sys/dev/dkwedge: dk.c Log Message: dk(4): Fix typo: sc_state, not sc_satte. Had tested a patch series, but not every patch in it, and I inadvertently fixed the typo in a later

CVS commit: src/sys/dev/dkwedge

2023-05-09 Thread Taylor R Campbell
Module Name:src Committed By: riastradh Date: Tue May 9 13:14:14 UTC 2023 Modified Files: src/sys/dev/dkwedge: dk.c Log Message: dk(4): Fix typo: sc_state, not sc_satte. Had tested a patch series, but not every patch in it, and I inadvertently fixed the typo in a later

CVS commit: src/sys/dev/dkwedge

2023-05-09 Thread Taylor R Campbell
Module Name:src Committed By: riastradh Date: Tue May 9 12:49:00 UTC 2023 Modified Files: src/sys/dev/dkwedge: dk.c Log Message: dk(4): Omit needless sc_iopend, sc_dkdrn mechanism. vdevgone guarantees that all instances are closed by the time it returns, which in turn

CVS commit: src/sys/dev/dkwedge

2023-05-09 Thread Taylor R Campbell
Module Name:src Committed By: riastradh Date: Tue May 9 12:49:00 UTC 2023 Modified Files: src/sys/dev/dkwedge: dk.c Log Message: dk(4): Omit needless sc_iopend, sc_dkdrn mechanism. vdevgone guarantees that all instances are closed by the time it returns, which in turn

CVS commit: src/sys/dev/dkwedge

2023-05-09 Thread Taylor R Campbell
Module Name:src Committed By: riastradh Date: Tue May 9 12:03:55 UTC 2023 Modified Files: src/sys/dev/dkwedge: dk.c Log Message: dk(4): dkclose must handle a dying wedge too to close the parent. Otherwise the parent open leaks on detach (or revoke) when the wedge was

CVS commit: src/sys/dev/dkwedge

2023-05-09 Thread Taylor R Campbell
Module Name:src Committed By: riastradh Date: Tue May 9 12:03:55 UTC 2023 Modified Files: src/sys/dev/dkwedge: dk.c Log Message: dk(4): dkclose must handle a dying wedge too to close the parent. Otherwise the parent open leaks on detach (or revoke) when the wedge was

CVS commit: src/sys/dev/dkwedge

2023-04-29 Thread Taylor R Campbell
Module Name:src Committed By: riastradh Date: Sat Apr 29 13:00:17 UTC 2023 Modified Files: src/sys/dev/dkwedge: dk.c Log Message: dk(4): Rename label for consistency. No functional change intended. To generate a diff of this commit: cvs rdiff -u -r1.151 -r1.152

CVS commit: src/sys/dev/dkwedge

2023-04-29 Thread Taylor R Campbell
Module Name:src Committed By: riastradh Date: Sat Apr 29 13:00:17 UTC 2023 Modified Files: src/sys/dev/dkwedge: dk.c Log Message: dk(4): Rename label for consistency. No functional change intended. To generate a diff of this commit: cvs rdiff -u -r1.151 -r1.152

CVS commit: src/sys/dev/dkwedge

2023-04-29 Thread Taylor R Campbell
Module Name:src Committed By: riastradh Date: Sat Apr 29 06:23:37 UTC 2023 Modified Files: src/sys/dev/dkwedge: dk.c Log Message: dk(4): Fix lock assertion in size increase: parent's, not wedge's. Reported-by: syzbot+d4dc610473cacc518...@syzkaller.appspotmail.com

CVS commit: src/sys/dev/dkwedge

2023-04-29 Thread Taylor R Campbell
Module Name:src Committed By: riastradh Date: Sat Apr 29 06:23:37 UTC 2023 Modified Files: src/sys/dev/dkwedge: dk.c Log Message: dk(4): Fix lock assertion in size increase: parent's, not wedge's. Reported-by: syzbot+d4dc610473cacc518...@syzkaller.appspotmail.com

CVS commit: src/sys/dev/dkwedge

2023-04-22 Thread Taylor R Campbell
Module Name:src Committed By: riastradh Date: Sat Apr 22 13:11:50 UTC 2023 Modified Files: src/sys/dev/dkwedge: dk.c Log Message: dk(4): Convert tests to assertions in various devsw operations. .d_cancel, .d_strategy, .d_read, .d_write, .d_ioctl, and .d_discard are only

CVS commit: src/sys/dev/dkwedge

2023-04-22 Thread Taylor R Campbell
Module Name:src Committed By: riastradh Date: Sat Apr 22 13:11:50 UTC 2023 Modified Files: src/sys/dev/dkwedge: dk.c Log Message: dk(4): Convert tests to assertions in various devsw operations. .d_cancel, .d_strategy, .d_read, .d_write, .d_ioctl, and .d_discard are only

CVS commit: src/sys/dev/dkwedge

2023-04-22 Thread Taylor R Campbell
Module Name:src Committed By: riastradh Date: Sat Apr 22 12:33:46 UTC 2023 Modified Files: src/sys/dev/dkwedge: dk.c Log Message: dk(4): Fix racy access to sc->sc_dk.dk_openmask in dkwedge_delall1. Need sc->sc_parent->dk_rawlock for this, as used in dkopen/dkclose. To

CVS commit: src/sys/dev/dkwedge

2023-04-22 Thread Taylor R Campbell
Module Name:src Committed By: riastradh Date: Sat Apr 22 12:33:46 UTC 2023 Modified Files: src/sys/dev/dkwedge: dk.c Log Message: dk(4): Fix racy access to sc->sc_dk.dk_openmask in dkwedge_delall1. Need sc->sc_parent->dk_rawlock for this, as used in dkopen/dkclose. To

CVS commit: src/sys/dev/dkwedge

2023-04-21 Thread Taylor R Campbell
Module Name:src Committed By: riastradh Date: Fri Apr 21 18:54:09 UTC 2023 Modified Files: src/sys/dev/dkwedge: dk.c Log Message: dk(4): Narrow the scope of the device numbering lookup on detach. Just need it for vdevgone, order relative to other things in detach doesn't

CVS commit: src/sys/dev/dkwedge

2023-04-21 Thread Taylor R Campbell
Module Name:src Committed By: riastradh Date: Fri Apr 21 18:54:09 UTC 2023 Modified Files: src/sys/dev/dkwedge: dk.c Log Message: dk(4): Narrow the scope of the device numbering lookup on detach. Just need it for vdevgone, order relative to other things in detach doesn't

CVS commit: src/sys/dev/dkwedge

2023-04-21 Thread Taylor R Campbell
Module Name:src Committed By: riastradh Date: Fri Apr 21 18:45:13 UTC 2023 Modified Files: src/sys/dev/dkwedge: dk.c Log Message: dk(4): dkdump: Simplify. No functional change intended. To generate a diff of this commit: cvs rdiff -u -r1.146 -r1.147

CVS commit: src/sys/dev/dkwedge

2023-04-21 Thread Taylor R Campbell
Module Name:src Committed By: riastradh Date: Fri Apr 21 18:45:13 UTC 2023 Modified Files: src/sys/dev/dkwedge: dk.c Log Message: dk(4): dkdump: Simplify. No functional change intended. To generate a diff of this commit: cvs rdiff -u -r1.146 -r1.147

CVS commit: src/sys/dev/dkwedge

2023-04-21 Thread Taylor R Campbell
Module Name:src Committed By: riastradh Date: Fri Apr 21 18:44:59 UTC 2023 Modified Files: src/sys/dev/dkwedge: dk.c Log Message: dk(4): Omit needless locking in dksize, dkdump. All the members these use are stable after initialization, except for the wedge size, which

CVS commit: src/sys/dev/dkwedge

2023-04-21 Thread Taylor R Campbell
Module Name:src Committed By: riastradh Date: Fri Apr 21 18:44:59 UTC 2023 Modified Files: src/sys/dev/dkwedge: dk.c Log Message: dk(4): Omit needless locking in dksize, dkdump. All the members these use are stable after initialization, except for the wedge size, which

CVS commit: src/sys/dev/dkwedge

2023-04-21 Thread Taylor R Campbell
Module Name:src Committed By: riastradh Date: Fri Apr 21 18:44:18 UTC 2023 Modified Files: src/sys/dev/dkwedge: dk.c Log Message: dk(4): Take a read-lock on dkwedges_lock if we're only reading. - dkwedge_find_by_name - dkwedge_find_by_parent - dkwedge_print_wnames To

CVS commit: src/sys/dev/dkwedge

2023-04-21 Thread Taylor R Campbell
Module Name:src Committed By: riastradh Date: Fri Apr 21 18:44:18 UTC 2023 Modified Files: src/sys/dev/dkwedge: dk.c Log Message: dk(4): Take a read-lock on dkwedges_lock if we're only reading. - dkwedge_find_by_name - dkwedge_find_by_parent - dkwedge_print_wnames To

CVS commit: src/sys/dev/dkwedge

2023-04-21 Thread Taylor R Campbell
Module Name:src Committed By: riastradh Date: Fri Apr 21 18:31:00 UTC 2023 Modified Files: src/sys/dev/dkwedge: dk.c Log Message: dk(4): Set .d_cfdriver and .d_devtounit to plug open/detach race. This way, opening dkN or rdkN will wait if attach or detach is still in

CVS commit: src/sys/dev/dkwedge

2023-04-21 Thread Taylor R Campbell
Module Name:src Committed By: riastradh Date: Fri Apr 21 18:31:00 UTC 2023 Modified Files: src/sys/dev/dkwedge: dk.c Log Message: dk(4): Set .d_cfdriver and .d_devtounit to plug open/detach race. This way, opening dkN or rdkN will wait if attach or detach is still in

CVS commit: src/sys/dev/dkwedge

2023-04-21 Thread Taylor R Campbell
Module Name:src Committed By: riastradh Date: Fri Apr 21 18:30:52 UTC 2023 Modified Files: src/sys/dev/dkwedge: dk.c Log Message: dk(4): Use disk_begindetach and rely on vdevgone to close instances. The first step is to decide whether we can detach (if forced, yes; if

CVS commit: src/sys/dev/dkwedge

2023-04-21 Thread Taylor R Campbell
Module Name:src Committed By: riastradh Date: Fri Apr 21 18:30:52 UTC 2023 Modified Files: src/sys/dev/dkwedge: dk.c Log Message: dk(4): Use disk_begindetach and rely on vdevgone to close instances. The first step is to decide whether we can detach (if forced, yes; if

CVS commit: src/sys/dev/dkwedge

2023-04-21 Thread Taylor R Campbell
Module Name:src Committed By: riastradh Date: Fri Apr 21 18:30:32 UTC 2023 Modified Files: src/sys/dev/dkwedge: dk.c Log Message: dk(4): Fix callout detach race. 1. Set a flag sc_iostop under the lock sc_iolock so dkwedge_detach and dkstart don't race over it. 2.

CVS commit: src/sys/dev/dkwedge

2023-04-21 Thread Taylor R Campbell
Module Name:src Committed By: riastradh Date: Fri Apr 21 18:30:21 UTC 2023 Modified Files: src/sys/dev/dkwedge: dk.c Log Message: dk(4): Add null d_cancel routine to devsw. This way, dkclose is guaranteed that dkopen, dkread, dkwrite, dkioctl, , have all returned before

CVS commit: src/sys/dev/dkwedge

2023-04-21 Thread Taylor R Campbell
Module Name:src Committed By: riastradh Date: Fri Apr 21 18:30:21 UTC 2023 Modified Files: src/sys/dev/dkwedge: dk.c Log Message: dk(4): Add null d_cancel routine to devsw. This way, dkclose is guaranteed that dkopen, dkread, dkwrite, dkioctl, , have all returned before

CVS commit: src/sys/dev/dkwedge

2023-04-21 Thread Taylor R Campbell
Module Name:src Committed By: riastradh Date: Fri Apr 21 18:29:43 UTC 2023 Modified Files: src/sys/dev/dkwedge: dk.c Log Message: dk(4): Require dk_openlock in dk_set_geometry. Not strictly necessary but this makes reasoning easier and documents with an assertion how

CVS commit: src/sys/dev/dkwedge

2023-04-21 Thread Taylor R Campbell
Module Name:src Committed By: riastradh Date: Fri Apr 21 18:29:43 UTC 2023 Modified Files: src/sys/dev/dkwedge: dk.c Log Message: dk(4): Require dk_openlock in dk_set_geometry. Not strictly necessary but this makes reasoning easier and documents with an assertion how

CVS commit: src/sys/dev/dkwedge

2023-04-21 Thread Taylor R Campbell
Module Name:src Committed By: riastradh Date: Fri Apr 21 18:29:34 UTC 2023 Modified Files: src/sys/dev/dkwedge: dk.c Log Message: dk(4): Assert dkwedges[unit] is the sc we're about to free. To generate a diff of this commit: cvs rdiff -u -r1.138 -r1.139

CVS commit: src/sys/dev/dkwedge

2023-04-21 Thread Taylor R Campbell
Module Name:src Committed By: riastradh Date: Fri Apr 21 18:29:34 UTC 2023 Modified Files: src/sys/dev/dkwedge: dk.c Log Message: dk(4): Assert dkwedges[unit] is the sc we're about to free. To generate a diff of this commit: cvs rdiff -u -r1.138 -r1.139

CVS commit: src/sys/dev/dkwedge

2023-04-21 Thread Taylor R Campbell
Module Name:src Committed By: riastradh Date: Fri Apr 21 18:29:26 UTC 2023 Modified Files: src/sys/dev/dkwedge: dk.c Log Message: dk(4): Assert parent vp is nonnull before we stash it away. Let's enable early attribution if this goes wrong. If it's not the parent's

CVS commit: src/sys/dev/dkwedge

2023-04-21 Thread Taylor R Campbell
Module Name:src Committed By: riastradh Date: Fri Apr 21 18:29:18 UTC 2023 Modified Files: src/sys/dev/dkwedge: dk.c Log Message: dk(4): Don't touch dkwedges or ndkwedges outside dkwedges_lock. To generate a diff of this commit: cvs rdiff -u -r1.136 -r1.137

CVS commit: src/sys/dev/dkwedge

2023-04-21 Thread Taylor R Campbell
Module Name:src Committed By: riastradh Date: Fri Apr 21 18:29:26 UTC 2023 Modified Files: src/sys/dev/dkwedge: dk.c Log Message: dk(4): Assert parent vp is nonnull before we stash it away. Let's enable early attribution if this goes wrong. If it's not the parent's

CVS commit: src/sys/dev/dkwedge

2023-04-21 Thread Taylor R Campbell
Module Name:src Committed By: riastradh Date: Fri Apr 21 18:29:18 UTC 2023 Modified Files: src/sys/dev/dkwedge: dk.c Log Message: dk(4): Don't touch dkwedges or ndkwedges outside dkwedges_lock. To generate a diff of this commit: cvs rdiff -u -r1.136 -r1.137

CVS commit: src/sys/dev/dkwedge

2023-04-21 Thread Taylor R Campbell
Module Name:src Committed By: riastradh Date: Fri Apr 21 18:26:36 UTC 2023 Modified Files: src/sys/dev/dkwedge: dk.c Log Message: dk(4): Move CFDRIVER_DECL and CFATTACH_DECL3_NEW earlier in file. Follows the pattern of most drivers, and will be necessary for referencing

CVS commit: src/sys/dev/dkwedge

2023-04-21 Thread Taylor R Campbell
Module Name:src Committed By: riastradh Date: Fri Apr 21 18:26:36 UTC 2023 Modified Files: src/sys/dev/dkwedge: dk.c Log Message: dk(4): Move CFDRIVER_DECL and CFATTACH_DECL3_NEW earlier in file. Follows the pattern of most drivers, and will be necessary for referencing

CVS commit: src/sys/dev/dkwedge

2023-04-21 Thread Taylor R Campbell
Module Name:src Committed By: riastradh Date: Fri Apr 21 18:25:49 UTC 2023 Modified Files: src/sys/dev/dkwedge: dk.c Log Message: dk(4): Prevent races in access to struct dkwedge_softc::sc_size. Rules: 1. Only ever increases, never decreases. (Decreases require

CVS commit: src/sys/dev/dkwedge

2023-04-21 Thread Taylor R Campbell
Module Name:src Committed By: riastradh Date: Fri Apr 21 18:25:49 UTC 2023 Modified Files: src/sys/dev/dkwedge: dk.c Log Message: dk(4): Prevent races in access to struct dkwedge_softc::sc_size. Rules: 1. Only ever increases, never decreases. (Decreases require

CVS commit: src/sys/dev/dkwedge

2023-04-21 Thread Taylor R Campbell
Module Name:src Committed By: riastradh Date: Fri Apr 21 18:25:30 UTC 2023 Modified Files: src/sys/dev/dkwedge: dk.c Log Message: dk(4): for rwlock(9). To generate a diff of this commit: cvs rdiff -u -r1.133 -r1.134 src/sys/dev/dkwedge/dk.c Please note that diffs are

CVS commit: src/sys/dev/dkwedge

2023-04-21 Thread Taylor R Campbell
Module Name:src Committed By: riastradh Date: Fri Apr 21 18:25:30 UTC 2023 Modified Files: src/sys/dev/dkwedge: dk.c Log Message: dk(4): for rwlock(9). To generate a diff of this commit: cvs rdiff -u -r1.133 -r1.134 src/sys/dev/dkwedge/dk.c Please note that diffs are

CVS commit: src/sys/dev/dkwedge

2023-04-21 Thread Taylor R Campbell
Module Name:src Committed By: riastradh Date: Fri Apr 21 18:25:22 UTC 2023 Modified Files: src/sys/dev/dkwedge: dk.c Log Message: dk(4): KNF: Sort includes. No functional change intended. To generate a diff of this commit: cvs rdiff -u -r1.132 -r1.133

CVS commit: src/sys/dev/dkwedge

2023-04-21 Thread Taylor R Campbell
Module Name:src Committed By: riastradh Date: Fri Apr 21 18:25:22 UTC 2023 Modified Files: src/sys/dev/dkwedge: dk.c Log Message: dk(4): KNF: Sort includes. No functional change intended. To generate a diff of this commit: cvs rdiff -u -r1.132 -r1.133

CVS commit: src/sys/dev/dkwedge

2023-04-21 Thread Taylor R Campbell
Module Name:src Committed By: riastradh Date: Fri Apr 21 18:25:09 UTC 2023 Modified Files: src/sys/dev/dkwedge: dk.c Log Message: dk(4): ENXIO, not ENODEV, means no such device. ENXIO is `device not configured', meaning there is no such device. ENODEV is `operation not

CVS commit: src/sys/dev/dkwedge

2023-04-21 Thread Taylor R Campbell
Module Name:src Committed By: riastradh Date: Fri Apr 21 18:25:09 UTC 2023 Modified Files: src/sys/dev/dkwedge: dk.c Log Message: dk(4): ENXIO, not ENODEV, means no such device. ENXIO is `device not configured', meaning there is no such device. ENODEV is `operation not

CVS commit: src/sys/dev/dkwedge

2023-04-21 Thread Taylor R Campbell
Module Name:src Committed By: riastradh Date: Fri Apr 21 18:24:56 UTC 2023 Modified Files: src/sys/dev/dkwedge: dk.c Log Message: dk(4): Fix typo in comment: dkstrategy, not dkstragegy. No functional change intended. To generate a diff of this commit: cvs rdiff -u

CVS commit: src/sys/dev/dkwedge

2023-04-21 Thread Taylor R Campbell
Module Name:src Committed By: riastradh Date: Fri Apr 21 18:24:56 UTC 2023 Modified Files: src/sys/dev/dkwedge: dk.c Log Message: dk(4): Fix typo in comment: dkstrategy, not dkstragegy. No functional change intended. To generate a diff of this commit: cvs rdiff -u

CVS commit: src/sys/dev/dkwedge

2023-04-21 Thread Taylor R Campbell
Module Name:src Committed By: riastradh Date: Fri Apr 21 18:24:48 UTC 2023 Modified Files: src/sys/dev/dkwedge: dk.c Log Message: dk(4): Omit needless void * cast. No functional change intended. To generate a diff of this commit: cvs rdiff -u -r1.129 -r1.130

CVS commit: src/sys/dev/dkwedge

2023-04-21 Thread Taylor R Campbell
Module Name:src Committed By: riastradh Date: Fri Apr 21 18:24:48 UTC 2023 Modified Files: src/sys/dev/dkwedge: dk.c Log Message: dk(4): Omit needless void * cast. No functional change intended. To generate a diff of this commit: cvs rdiff -u -r1.129 -r1.130

CVS commit: src/sys/dev/dkwedge

2023-04-21 Thread Taylor R Campbell
Module Name:src Committed By: riastradh Date: Fri Apr 21 18:24:39 UTC 2023 Modified Files: src/sys/dev/dkwedge: dk.c Log Message: dk(4): KNF: Whitespace. No functional change intended. To generate a diff of this commit: cvs rdiff -u -r1.128 -r1.129

CVS commit: src/sys/dev/dkwedge

2023-04-21 Thread Taylor R Campbell
Module Name:src Committed By: riastradh Date: Fri Apr 21 18:24:39 UTC 2023 Modified Files: src/sys/dev/dkwedge: dk.c Log Message: dk(4): KNF: Whitespace. No functional change intended. To generate a diff of this commit: cvs rdiff -u -r1.128 -r1.129

CVS commit: src/sys/dev/dkwedge

2023-04-21 Thread Taylor R Campbell
Module Name:src Committed By: riastradh Date: Fri Apr 21 18:24:32 UTC 2023 Modified Files: src/sys/dev/dkwedge: dk.c Log Message: dk(4): KNF: return (v) -> return v. No functional change intended. To generate a diff of this commit: cvs rdiff -u -r1.127 -r1.128

CVS commit: src/sys/dev/dkwedge

2023-04-21 Thread Taylor R Campbell
Module Name:src Committed By: riastradh Date: Fri Apr 21 18:24:32 UTC 2023 Modified Files: src/sys/dev/dkwedge: dk.c Log Message: dk(4): KNF: return (v) -> return v. No functional change intended. To generate a diff of this commit: cvs rdiff -u -r1.127 -r1.128

CVS commit: src/sys/dev/dkwedge

2023-04-21 Thread Taylor R Campbell
Module Name:src Committed By: riastradh Date: Fri Apr 21 18:24:19 UTC 2023 Modified Files: src/sys/dev/dkwedge: dk.c Log Message: dk(4): Avoid holding dkwedges_lock while allocating array. This is not great -- we shouldn't be choosing the unit number here anyway; we

CVS commit: src/sys/dev/dkwedge

2023-04-21 Thread Taylor R Campbell
Module Name:src Committed By: riastradh Date: Fri Apr 21 18:24:19 UTC 2023 Modified Files: src/sys/dev/dkwedge: dk.c Log Message: dk(4): Avoid holding dkwedges_lock while allocating array. This is not great -- we shouldn't be choosing the unit number here anyway; we

CVS commit: src/sys/dev/dkwedge

2023-04-21 Thread Taylor R Campbell
Module Name:src Committed By: riastradh Date: Fri Apr 21 18:09:38 UTC 2023 Modified Files: src/sys/dev/dkwedge: dk.c Log Message: dk(4): Restore assertions in dklastclose. We only enter dklastclose if the wedge is open (sc->sc_dk.dk_openmask != 0), which can happen only

CVS commit: src/sys/dev/dkwedge

2023-04-21 Thread Taylor R Campbell
Module Name:src Committed By: riastradh Date: Fri Apr 21 18:09:38 UTC 2023 Modified Files: src/sys/dev/dkwedge: dk.c Log Message: dk(4): Restore assertions in dklastclose. We only enter dklastclose if the wedge is open (sc->sc_dk.dk_openmask != 0), which can happen only

CVS commit: src/sys/dev/dkwedge

2023-04-13 Thread Taylor R Campbell
Module Name:src Committed By: riastradh Date: Thu Apr 13 08:30:41 UTC 2023 Modified Files: src/sys/dev/dkwedge: dk.c Log Message: dk(4): Explain why dk_rawopens can't overflow and assert it. To generate a diff of this commit: cvs rdiff -u -r1.124 -r1.125

CVS commit: src/sys/dev/dkwedge

2023-04-13 Thread Taylor R Campbell
Module Name:src Committed By: riastradh Date: Thu Apr 13 08:30:41 UTC 2023 Modified Files: src/sys/dev/dkwedge: dk.c Log Message: dk(4): Explain why dk_rawopens can't overflow and assert it. To generate a diff of this commit: cvs rdiff -u -r1.124 -r1.125

Re: CVS commit: src/sys/dev/dkwedge

2023-04-13 Thread Taylor R Campbell
> Date: Tue, 11 Apr 2023 21:50:49 +0200 > From: Michael van Elst > > On Wed, Apr 12, 2023 at 01:10:40AM +0700, Robert Elz wrote: > > > > | In that state then decrementing dk_rawopens beyond zero will make > > | dklastclose do the right thing: nothing. > > > > Except that if that happens,

Re: CVS commit: src/sys/dev/dkwedge

2023-04-11 Thread Michael van Elst
On Wed, Apr 12, 2023 at 01:10:40AM +0700, Robert Elz wrote: > > | In that state then decrementing dk_rawopens beyond zero will make > | dklastclose do the right thing: nothing. > > Except that if that happens, dk_rawopens will be left == ~0 and the next > open attempt will then increment it,

Re: CVS commit: src/sys/dev/dkwedge

2023-04-11 Thread Robert Elz
Date:Tue, 11 Apr 2023 17:21:17 +0200 From:Michael van Elst Message-ID: | In that state then decrementing dk_rawopens beyond zero will make | dklastclose do the right thing: nothing. Except that if that happens, dk_rawopens will be left == ~0 and the next open

Re: CVS commit: src/sys/dev/dkwedge

2023-04-11 Thread Michael van Elst
On Tue, Apr 11, 2023 at 09:07:49AM +, Taylor R Campbell wrote: > > (a) how we can legitimately enter a state where the assertions are > violated, and dklastclose is called when the close operation ends in no more openers. There is nothing that guarantees that any open was successful

Re: CVS commit: src/sys/dev/dkwedge

2023-04-11 Thread Taylor R Campbell
> Module Name:src > Committed By: mlelstv > Date: Tue Sep 27 17:04:52 UTC 2022 > > Modified Files: > src/sys/dev/dkwedge: dk.c > > Log Message: > Remove bogus assertions. > > @@ -1221,8 +1221,6 @@ dklastclose(struct dkwedge_softc *sc) > >

  1   2   >