opnsense-src/sys
Eugene Grosbein cea05ed9a9 geom_part: extend kern.geom.part.check_integrity to work on GPT
There are multiple USB/SATA bridges on the market that unconditionally
cut some LBAs off connected media. This could be a problem
for pre-partitioned drives so GEOM complains and does not create
devices in /dev for slices/partitions preventing access to existing data.

We have kern.geom.part.check_integrity that allows us to correct
partitioning if changed from default 1 to 0 but it works for MBR only.
If backup copy of GPT is unavailable due to decreases number of LBAs,
kernel still does not give access to partitions and prints to dmesg:

GEOM: md0: corrupt or invalid GPT detected.
GEOM: md0: GPT rejected -- may not be recoverable.

This change makes it work for GPT too, so it created partitions in /dev
and prints to dmesg this instead:

GEOM: md0: the secondary GPT table is corrupt or invalid.
GEOM: md0: using the primary only -- recovery suggested.

Then "gpart recover" re-created backup copy of GPT
and allows further manipulations with partitions.

This change is no-op for default configuration having
kern.geom.part.check_integrity=1

Reported by:	Alex Korchmar
MFC after:	3 days.
2020-09-08 22:23:53 +00:00
..
amd64 Include the psind in data returned by mincore(2). 2020-09-02 18:16:43 +00:00
arm Allwinner USB DRD support (musb_otg) 2020-09-07 06:39:00 +00:00
arm64 arm64: export new HWCAP features 2020-09-08 15:36:38 +00:00
bsm bsm: add AUE_CLOSERANGE 2020-04-24 01:27:25 +00:00
cam mmc_da: universally use uint8_t for the partition index 2020-09-08 06:19:23 +00:00
cddl Tighten frame pointer checking in DTrace's amd64 stack unwinder. 2020-09-01 15:15:44 +00:00
compat Add emulation support for the Linux kcov(4) ioctl API. 2020-09-04 00:12:28 +00:00
conf RISC-V: enable MK_FORMAT_EXTENSIONS 2020-09-08 13:24:44 +00:00
contrib ZFS: MFV 2.0-rc1-gfd20a8 2020-09-04 22:25:14 +00:00
crypto padlock(4): fix instapanics with geli authentication 2020-09-06 19:25:31 +00:00
ddb ddb: clean up empty lines in .c and .h files 2020-09-01 22:14:30 +00:00
dev RISC-V: fix some mismatched format specifiers 2020-09-08 13:21:13 +00:00
dts Remove licenses 2020-06-04 17:20:58 +00:00
fs tmpfs: drop spurious cache_purge in tmpfs_reclaim 2020-09-04 19:30:15 +00:00
gdb gdb(4): Support empty qSupported queries 2020-08-18 20:59:10 +00:00
geom geom_part: extend kern.geom.part.check_integrity to work on GPT 2020-09-08 22:23:53 +00:00
gnu Import DTS files for arm, arm64, riscv from Linux 5.8 2020-08-04 19:44:43 +00:00
i386 Include the psind in data returned by mincore(2). 2020-09-02 18:16:43 +00:00
isa sc(4) md bits: stop setting sc->kbd entirely 2019-12-30 02:07:55 +00:00
kern fd: fix fhold on an uninitialized var in fdcopy_remapped 2020-09-08 16:07:47 +00:00
kgssapi kgssapi: clean up empty lines in .c and .h files 2020-09-01 22:15:02 +00:00
libkern arm64: check for CRC32 support via HWCAP 2020-09-08 15:39:19 +00:00
mips Add the MEM_EXTRACT_PADDR ioctl to /dev/mem. 2020-09-02 18:12:47 +00:00
modules ZFS: remove some extra defines 2020-09-08 17:47:30 +00:00
net Fix panic with net.fibs tunable set in loader.conf. 2020-09-08 21:39:34 +00:00
net80211 net: clean up empty lines in .c and .h files 2020-09-01 21:19:14 +00:00
netgraph ng_ether: Enter NET_EPOCH where required 2020-09-02 11:49:22 +00:00
netinet bbr: remove unused static function 2020-09-05 00:20:32 +00:00
netinet6 net: clean up empty lines in .c and .h files 2020-09-01 21:19:14 +00:00
netipsec net: clean up empty lines in .c and .h files 2020-09-01 21:19:14 +00:00
netpfil net: clean up empty lines in .c and .h files 2020-09-01 21:19:14 +00:00
netsmb net: clean up empty lines in .c and .h files 2020-09-01 21:19:14 +00:00
nfs nfs: clean up empty lines in .c and .h files 2020-09-01 21:25:39 +00:00
nfsclient nfs: clean up empty lines in .c and .h files 2020-09-01 21:25:39 +00:00
nfsserver nfs: clean up empty lines in .c and .h files 2020-09-01 21:25:39 +00:00
nlm nlm: clean up empty lines in .c and .h files 2020-09-01 22:14:52 +00:00
ofed infiniband: Appease Coverty 2020-08-31 16:17:28 +00:00
opencrypto Name the on-stack union of compat thunks. 2020-08-26 22:36:08 +00:00
powerpc [PowerPC] Implement VDSO timebase access on powerpc* 2020-09-08 03:00:31 +00:00
riscv RISC-V: fix some mismatched format specifiers 2020-09-08 13:21:13 +00:00
rpc Fix a potential memory leak in the NFS over TLS handling code. 2020-09-05 00:50:52 +00:00
security mac_framework.h: fix build with DEBUG_VFS_LOCKS and !MAC 2020-09-03 20:30:52 +00:00
sys arm64: fix incorrect HWCAP definitions 2020-09-08 15:08:20 +00:00
teken
tests Add small tool to invoke kernel test framework tests. 2020-09-02 09:20:40 +00:00
tools makesyscalls.lua: improve syscall ordering validation 2020-08-04 21:49:13 +00:00
ufs ufs: clean up empty lines in .c and .h files 2020-09-01 21:23:00 +00:00
vm vm_object_split(): Handle orig_object type changes. 2020-09-07 23:28:33 +00:00
x86 x86: clean up empty lines in .c and .h files 2020-09-01 21:23:59 +00:00
xdr xdr: clean up empty lines in .c and .h files 2020-09-01 22:13:28 +00:00
xen xen: clean up empty lines in .c and .h files 2020-09-01 21:21:55 +00:00
Makefile Remove sparc64 kernel support 2020-02-03 17:35:11 +00:00