From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750971AbdBANlC (ORCPT ); Wed, 1 Feb 2017 08:41:02 -0500 Received: from relay1.sgi.com ([192.48.180.66]:41225 "EHLO relay.sgi.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750737AbdBANlB (ORCPT ); Wed, 1 Feb 2017 08:41:01 -0500 X-Greylist: delayed 522 seconds by postgrey-1.27 at vger.kernel.org; Wed, 01 Feb 2017 08:41:01 EST Subject: Re: [lustre-devel] [PATCH 60/60] staging: lustre: libcfs: fix minimum size check for libcfs ioctl To: James Simmons , Dan Carpenter References: <1485648328-2141-1-git-send-email-jsimmons@infradead.org> <1485648328-2141-61-git-send-email-jsimmons@infradead.org> <20170130105156.GA6881@mwanda> CC: , Greg Kroah-Hartman , Linux Kernel Mailing List , Oleg Drokin , Amir Shehata , Lustre Development List From: Olaf Weber Organization: SGI Message-ID: <57e8b9b1-e1c8-a5df-e34d-7124671c6888@sgi.com> Date: Wed, 1 Feb 2017 14:32:13 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.7.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="windows-1252"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [144.253.208.60] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 31-01-17 03:25, James Simmons wrote: [...] >> Also I'm uncomfortable with: >> >> data = container_of(hdr, struct libcfs_ioctl_data, ioc_hdr); >> >> If hdr isn't the first member of the struct then the code is broken but >> container_of() implies that that isn't a hard requirement. It should >> just be: >> >> data = (struct libcfs_ioctl_data *)hdr; > > Don't know if hdr being first is a hard requirment. Doug, Amir do you know > if it is an requirement? It's a requirement. -- Olaf Weber SGI Phone: +31(0)30-6696796 Veldzigt 2b Fax: +31(0)30-6696799 Sr Software Engineer 3454 PW de Meern Vnet: 955-6796 Storage Software The Netherlands Email: olaf@sgi.com