mirror of
https://git.FreeBSD.org/src.git
synced 2024-12-17 10:26:15 +00:00
Implement a handle for efficient implementation of perforations in
lower extremities. Setting bit 4 in debugflags (sysctl kern.geom.debugflags=16) will allow any open to succeed on rank#1 providers. This will generally correspond to the physical disk devices: ad0, da0, md0 etc. This fundamentally violates the mechanics of GEOMs autoconfiguration, and is only provided as a debugging facility, so obviously error reports on GEOM where this bit is or has been set will not be accepted.
This commit is contained in:
parent
487106ce7a
commit
8ebd558f5d
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=110759
@ -42,10 +42,13 @@ TAILQ_HEAD(event_tailq_head, g_event);
|
||||
extern struct event_tailq_head events;
|
||||
extern int g_collectstats;
|
||||
extern int g_debugflags;
|
||||
/* 1 G_T_TOPOLOGY */
|
||||
/* 2 G_T_BIO */
|
||||
/* 4 G_T_ACCESS */
|
||||
/* 8 enable sanity checks */
|
||||
/*
|
||||
* 1 G_T_TOPOLOGY
|
||||
* 2 G_T_BIO
|
||||
* 4 G_T_ACCESS
|
||||
* 8 enable sanity checks
|
||||
* 16 Allow footshooting on rank#1 providers
|
||||
*/
|
||||
|
||||
/*
|
||||
* Various internal actions are tracked by tagging g_event[s] onto
|
||||
|
@ -418,14 +418,17 @@ g_access_rel(struct g_consumer *cp, int dcr, int dcw, int dce)
|
||||
pp->acr, pp->acw, pp->ace,
|
||||
pp, pp->name);
|
||||
|
||||
/* If foot-shooting is enabled, any open on rank#1 is OK */
|
||||
if ((g_debugflags & 16) && pp->geom->rank == 1)
|
||||
;
|
||||
/* If we try exclusive but already write: fail */
|
||||
if (dce > 0 && pw > 0)
|
||||
else if (dce > 0 && pw > 0)
|
||||
return (EPERM);
|
||||
/* If we try write but already exclusive: fail */
|
||||
if (dcw > 0 && pe > 0)
|
||||
else if (dcw > 0 && pe > 0)
|
||||
return (EPERM);
|
||||
/* If we try to open more but provider is error'ed: fail */
|
||||
if ((dcr > 0 || dcw > 0 || dce > 0) && pp->error != 0)
|
||||
else if ((dcr > 0 || dcw > 0 || dce > 0) && pp->error != 0)
|
||||
return (pp->error);
|
||||
|
||||
/* Ok then... */
|
||||
|
Loading…
Reference in New Issue
Block a user