Don't open with exclusive bit, swapon(8) wants to trash our swapdev.

Add XXX comment with a rating of this concept.
This commit is contained in:
Poul-Henning Kamp 2003-09-02 05:53:44 +00:00
parent 7d43c8c902
commit afeb65e61d
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=119663

View File

@ -2411,7 +2411,7 @@ swapgeom_close_ev(void *arg, int flags)
struct g_consumer *cp;
cp = arg;
g_access_rel(cp, -1, -1, -1);
g_access_rel(cp, -1, -1, 0);
g_detach(cp);
g_destroy_consumer(cp);
}
@ -2465,7 +2465,13 @@ swapongeom_ev(void *arg, int flags)
}
cp = g_new_consumer(gp);
g_attach(cp, pp);
error = g_access_rel(cp, 1, 1, 1);
/*
* XXX: Everytime you think you can improve the margin for
* footshooting, somebody depends on the ability to do so:
* savecore(8) wants to write to our swapdev so we cannot
* set an exclusive count :-(
*/
error = g_access_rel(cp, 1, 1, 0);
if (error) {
g_detach(cp);
g_destroy_consumer(cp);