From patchwork Thu Nov 18 23:21:28 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: andrew hendry X-Patchwork-Id: 72168 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id E3C9AB71CB for ; Fri, 19 Nov 2010 10:21:38 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1760814Ab0KRXVe (ORCPT ); Thu, 18 Nov 2010 18:21:34 -0500 Received: from mail-vw0-f46.google.com ([209.85.212.46]:56454 "EHLO mail-vw0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1760805Ab0KRXVd (ORCPT ); Thu, 18 Nov 2010 18:21:33 -0500 Received: by mail-vw0-f46.google.com with SMTP id 13so2163943vws.19 for ; Thu, 18 Nov 2010 15:21:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:subject:from:to:content-type :date:message-id:mime-version:x-mailer:content-transfer-encoding; bh=fdnSGSwQjWmIwN/zdGoVbRnFrp/2FIlil6JG/yikFaQ=; b=k4A/VlmzYrkdnFrieIQtTktri0MUdJq+nw0R7fKD4Z0hbuRC5UtmvdRLUUaMX3OQ07 A9wX+G43lgoxqykD6J/4Sh/VPLK7Zfilt92V6zOQp6MomJS3Tdi/4Vb35fj80mrzBAo7 p6ESgUhkbOgplTsKoMQBU0qFNBjUAsSNbj0+M= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=subject:from:to:content-type:date:message-id:mime-version:x-mailer :content-transfer-encoding; b=RPm2hH6BorWf+d7GFyIPJM670gxOMHLHAX6H9PSIglem480U/tqH2MpeZsOVtkQXrN fek7oQpoYW0wwjkC827tpWopEsqRnlkH67r/AHNAHQAQM3Un1SoDpZbkPov5qdc0hpeE hfWoJvGlXEIAYHuwk4uTy2ieMuFFPUiMULlZ4= Received: by 10.220.179.7 with SMTP id bo7mr305314vcb.61.1290122493315; Thu, 18 Nov 2010 15:21:33 -0800 (PST) Received: from [192.168.0.3] ([203.214.34.44]) by mx.google.com with ESMTPS id f18sm236971vcm.11.2010.11.18.15.21.31 (version=SSLv3 cipher=RC4-MD5); Thu, 18 Nov 2010 15:21:32 -0800 (PST) Subject: [PATCH 3/4] X25: remove bkl in inq and outq ioctls From: Andrew Hendry To: netdev@vger.kernel.org Date: Fri, 19 Nov 2010 10:21:28 +1100 Message-ID: <1290122488.20070.62.camel@jaunty> Mime-Version: 1.0 X-Mailer: Evolution 2.30.3 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Signed-off-by: Andrew Hendry --- net/x25/af_x25.c | 6 ++---- 1 files changed, 2 insertions(+), 4 deletions(-) diff --git a/net/x25/af_x25.c b/net/x25/af_x25.c index 2259783..2f235a6 100644 --- a/net/x25/af_x25.c +++ b/net/x25/af_x25.c @@ -1361,12 +1361,10 @@ static int x25_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg) case TIOCOUTQ: { int amount; - lock_kernel(); amount = sk->sk_sndbuf - sk_wmem_alloc_get(sk); if (amount < 0) amount = 0; rc = put_user(amount, (unsigned int __user *)argp); - unlock_kernel(); break; } @@ -1377,11 +1375,11 @@ static int x25_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg) * These two are safe on a single CPU system as * only user tasks fiddle here */ - lock_kernel(); + lock_sock(sk); if ((skb = skb_peek(&sk->sk_receive_queue)) != NULL) amount = skb->len; + release_sock(sk); rc = put_user(amount, (unsigned int __user *)argp); - unlock_kernel(); break; }