From patchwork Thu Jul 10 09:37:19 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Borkmann X-Patchwork-Id: 368546 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 B2CD0140108 for ; Thu, 10 Jul 2014 19:37:41 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752497AbaGJJhi (ORCPT ); Thu, 10 Jul 2014 05:37:38 -0400 Received: from mx1.redhat.com ([209.132.183.28]:30101 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752234AbaGJJhf (ORCPT ); Thu, 10 Jul 2014 05:37:35 -0400 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s6A9bNq7002540 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 10 Jul 2014 05:37:23 -0400 Received: from [10.36.7.133] (vpn1-7-133.ams2.redhat.com [10.36.7.133]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id s6A9bJ32018121 (version=TLSv1/SSLv3 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Thu, 10 Jul 2014 05:37:21 -0400 Message-ID: <53BE5ECF.3050202@redhat.com> Date: Thu, 10 Jul 2014 11:37:19 +0200 From: Daniel Borkmann User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/17.0 Thunderbird/17.0 MIME-Version: 1.0 To: David Laight CC: "'Neil Horman'" , Vlad Yasevich , "davem@davemloft.net" , "geirola@gmail.com" , "netdev@vger.kernel.org" , "linux-sctp@vger.kernel.org" Subject: Re: [PATCH net-next 0/5] SCTP updates References: <20140708111408.GA23026@hmsreliant.think-freely.org> <53BBFAA6.80408@redhat.com> <20140708144127.GB23026@hmsreliant.think-freely.org> <53BD1211.4080504@redhat.com> <20140709104958.GA3784@hmsreliant.think-freely.org> <53BD4363.70306@redhat.com> <20140709151354.GA5250@localhost.localdomain> <53BD6167.1030000@gmail.com> <20140709154428.GD5250@localhost.localdomain> <53BD6EB7.7070302@gmail.com> <20140709183508.GB14509@hmsreliant.think-freely.org> <063D6719AE5E284EB5DD2968C1650D6D1726FBA0@AcuExch.aculab.com> In-Reply-To: <063D6719AE5E284EB5DD2968C1650D6D1726FBA0@AcuExch.aculab.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On 07/10/2014 11:02 AM, David Laight wrote: > From: Neil Horman > ... >>> No there is not direct overlap between the two. However, as Michael pointed out, >>> there is a new option to control SCTP_RCVINFO. So would could add a deprecation >>> warning to the over SCTP_EVENTS option and carry SCTP_SNDRCVINFO with it. >>> Once SCTP_EVENTS goes away so can SCTP_SNDRCVINFO. >>> >> Ok, so we should still consider deprecation warnings then. Daniel, what about >> ratelimited warnings with pids included then? > > Can you defer any deprecation warnings for a few kernel versions? > This gives time for applications to be recoded. I am fine either way, adding the warning a bit later seems fine, too. Right now, even in-kernel users like dlm would hit it if we include it immediately. Otherwise, I'll just add something like the below ... > Including argv[0] (even just the exec-time value) is much more use than the pid. > > Actually this is 'right PITA' for an application. > A program binary that needs to work with old and new kernels will have to > try the new option, and if it fails fall back to the old one, and then > conditionally create/inspect the cmsg data. > I can't actually imagine anyone bothering! > > Our sctp code is actually in a kernel module, so we can look at the kernel > version when (part of) the driver is compiled on the target system. > > David > > > --- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/net/sctp/socket.c b/net/sctp/socket.c index d95a50c..6a0e5a4 100644 --- a/net/sctp/socket.c +++ b/net/sctp/socket.c @@ -2205,8 +2205,13 @@ static int sctp_setsockopt_events(struct sock *sk, char __user *optval, if (copy_from_user(&sctp_sk(sk)->subscribe, optval, optlen)) return -EFAULT; - /* - * At the time when a user app subscribes to SCTP_SENDER_DRY_EVENT, + if (sctp_sk(sk)->subscribe.sctp_data_io_event) + pr_warn_ratelimited(DEPRECATED "%s (pid %d) " + "Requested SCTP_SNDRCVINFO event.\n" + "Use SCTP_RCVINFO through SCTP_RECVRCVINFO option instead.\n", + current->comm, task_pid_nr(current)); + + /* At the time when a user app subscribes to SCTP_SENDER_DRY_EVENT, * if there is no data to be sent or retransmit, the stack will * immediately send up this notification. */