aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4
diff options
context:
space:
mode:
authorHerbert Xu <herbert@gondor.apana.org.au>2008-02-28 14:23:17 -0500
committerDavid S. Miller <davem@davemloft.net>2008-02-28 14:23:17 -0500
commit21e43188f272c7fd9efc84b8244c0b1dfccaa105 (patch)
treead0313f88c3abe948e5a5ec61fd404a5cbfd2972 /net/ipv4
parent60717f7e761ca04925d17e90e556e689ab134cdc (diff)
[IPCOMP]: Disable BH on output when using shared tfm
Because we use shared tfm objects in order to conserve memory, (each tfm requires 128K of vmalloc memory), BH needs to be turned off on output as that can occur in process context. Previously this was done implicitly by the xfrm output code. That was lost when it became lockless. So we need to add the BH disabling to IPComp directly. Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4')
-rw-r--r--net/ipv4/ipcomp.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/net/ipv4/ipcomp.c b/net/ipv4/ipcomp.c
index ae1f45fc23b9..58b60b2fb011 100644
--- a/net/ipv4/ipcomp.c
+++ b/net/ipv4/ipcomp.c
@@ -108,8 +108,11 @@ static int ipcomp_compress(struct xfrm_state *x, struct sk_buff *skb)
108 const int cpu = get_cpu(); 108 const int cpu = get_cpu();
109 u8 *scratch = *per_cpu_ptr(ipcomp_scratches, cpu); 109 u8 *scratch = *per_cpu_ptr(ipcomp_scratches, cpu);
110 struct crypto_comp *tfm = *per_cpu_ptr(ipcd->tfms, cpu); 110 struct crypto_comp *tfm = *per_cpu_ptr(ipcd->tfms, cpu);
111 int err = crypto_comp_compress(tfm, start, plen, scratch, &dlen); 111 int err;
112 112
113 local_bh_disable();
114 err = crypto_comp_compress(tfm, start, plen, scratch, &dlen);
115 local_bh_enable();
113 if (err) 116 if (err)
114 goto out; 117 goto out;
115 118