mirror of
https://git.FreeBSD.org/src.git
synced 2024-12-25 11:37:56 +00:00
Revert to the old behavior of allocating table/table entries using
M_NOWAIT. Currently, the code allows for sleeping in the ioctl path to guarantee allocation. However code also handles ENOMEM gracefully, so propagate this error back to user-space, rather than sleeping while holding the global pf mutex. Reviewed by: glebius Discussed with: bz
This commit is contained in:
parent
7f40c1f876
commit
5646ad6d27
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=230119
@ -927,16 +927,12 @@ pfr_create_kentry(struct pfr_addr *ad, int intr)
|
||||
{
|
||||
struct pfr_kentry *ke;
|
||||
|
||||
#ifdef __FreeBSD__
|
||||
ke = pool_get(&V_pfr_kentry_pl, PR_NOWAIT | PR_ZERO);
|
||||
#else
|
||||
if (intr)
|
||||
#ifdef __FreeBSD__
|
||||
ke = pool_get(&V_pfr_kentry_pl, PR_NOWAIT | PR_ZERO);
|
||||
#else
|
||||
ke = pool_get(&pfr_kentry_pl, PR_NOWAIT | PR_ZERO);
|
||||
#endif
|
||||
else
|
||||
#ifdef __FreeBSD__
|
||||
ke = pool_get(&V_pfr_kentry_pl, PR_WAITOK|PR_ZERO);
|
||||
#else
|
||||
ke = pool_get(&pfr_kentry_pl, PR_WAITOK|PR_ZERO|PR_LIMITFAIL);
|
||||
#endif
|
||||
if (ke == NULL)
|
||||
@ -2081,16 +2077,12 @@ pfr_create_ktable(struct pfr_table *tbl, long tzero, int attachruleset,
|
||||
struct pfr_ktable *kt;
|
||||
struct pf_ruleset *rs;
|
||||
|
||||
#ifdef __FreeBSD__
|
||||
kt = pool_get(&V_pfr_ktable_pl, PR_NOWAIT|PR_ZERO);
|
||||
#else
|
||||
if (intr)
|
||||
#ifdef __FreeBSD__
|
||||
kt = pool_get(&V_pfr_ktable_pl, PR_NOWAIT|PR_ZERO);
|
||||
#else
|
||||
kt = pool_get(&pfr_ktable_pl, PR_NOWAIT|PR_ZERO|PR_LIMITFAIL);
|
||||
#endif
|
||||
else
|
||||
#ifdef __FreeBSD__
|
||||
kt = pool_get(&V_pfr_ktable_pl, PR_WAITOK|PR_ZERO);
|
||||
#else
|
||||
kt = pool_get(&pfr_ktable_pl, PR_WAITOK|PR_ZERO|PR_LIMITFAIL);
|
||||
#endif
|
||||
if (kt == NULL)
|
||||
|
Loading…
Reference in New Issue
Block a user