Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754740AbbGCVOv (ORCPT ); Fri, 3 Jul 2015 17:14:51 -0400 Received: from out5-smtp.messagingengine.com ([66.111.4.29]:58771 "EHLO out5-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752568AbbGCVOo (ORCPT ); Fri, 3 Jul 2015 17:14:44 -0400 X-Sasl-enc: 50SRSIkW0aGObQLL87TFn4eh0fbLGr84quxjCHbZkZ/l 1435958083 Date: Sat, 4 Jul 2015 00:14:41 +0300 From: Sergei Zviagintsev To: David Herrmann Cc: linux-kernel@vger.kernel.org, Greg Kroah-Hartman , daniel@zonque.org, tixxdz@opendz.org Subject: Re: [PATCH 2/6] kdbus: drop redundant KDBUS_MSG_MAX_ITEMS Message-ID: <20150703211441.GY17917@localhost.localdomain> References: <1435825714-3567-1-git-send-email-dh.herrmann@gmail.com> <1435825714-3567-3-git-send-email-dh.herrmann@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1435825714-3567-3-git-send-email-dh.herrmann@gmail.com> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2051 Lines: 58 Hi, On Thu, Jul 02, 2015 at 10:28:30AM +0200, David Herrmann wrote: > We already limit the size of the message object, there's no reason to add > an arbitrary additional limit on the number of items. We don't do this for > other item-arrays, so lets stop restricting the messages in this way. > > Signed-off-by: David Herrmann > --- > ipc/kdbus/limits.h | 3 --- > ipc/kdbus/message.c | 3 --- > 2 files changed, 6 deletions(-) > > diff --git a/ipc/kdbus/limits.h b/ipc/kdbus/limits.h > index 6450f58..c54925a 100644 > --- a/ipc/kdbus/limits.h > +++ b/ipc/kdbus/limits.h > @@ -19,9 +19,6 @@ > /* maximum size of message header and items */ > #define KDBUS_MSG_MAX_SIZE SZ_8K > > -/* maximum number of message items */ > -#define KDBUS_MSG_MAX_ITEMS 128 > - > /* maximum number of memfd items per message */ > #define KDBUS_MSG_MAX_MEMFD_ITEMS 16 > > diff --git a/ipc/kdbus/message.c b/ipc/kdbus/message.c > index 066e816..c499014 100644 > --- a/ipc/kdbus/message.c > +++ b/ipc/kdbus/message.c > @@ -263,9 +263,6 @@ static int kdbus_msg_scan_items(struct kdbus_kmsg *kmsg, > size_t payload_size = KDBUS_ITEM_PAYLOAD_SIZE(item); > struct iovec *iov = kmsg->iov + kmsg->iov_count; > > - if (++n > KDBUS_MSG_MAX_ITEMS) > - return -E2BIG; > - This change makes useless assigning `n' to zero at line 260. Also `n' could be renamed to smt like `n_res' or dropped. > switch (item->type) { > case KDBUS_ITEM_PAYLOAD_VEC: { > struct kdbus_msg_data *d = res->data + res->data_count; > -- > 2.4.5 > > -- > To unsubscribe from this list: send the line "unsubscribe linux-kernel" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html > Please read the FAQ at http://www.tux.org/lkml/ -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/