From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.2 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8FCF9C63777 for ; Fri, 27 Nov 2020 10:37:17 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 3E88B21D46 for ; Fri, 27 Nov 2020 10:37:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727479AbgK0KhQ (ORCPT ); Fri, 27 Nov 2020 05:37:16 -0500 Received: from mx2.suse.de ([195.135.220.15]:42494 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727350AbgK0KhQ (ORCPT ); Fri, 27 Nov 2020 05:37:16 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 7E166AF38; Fri, 27 Nov 2020 10:37:14 +0000 (UTC) Subject: Re: [PATCH 11/44] block: remove a superflous check in blkpg_do_ioctl To: Christoph Hellwig , Jens Axboe Cc: Tejun Heo , Josef Bacik , Coly Li , Mike Snitzer , Greg Kroah-Hartman , Jan Kara , Johannes Thumshirn , dm-devel@redhat.com, Jan Kara , linux-block@vger.kernel.org, linux-bcache@vger.kernel.org, linux-mtd@lists.infradead.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org References: <20201126130422.92945-1-hch@lst.de> <20201126130422.92945-12-hch@lst.de> From: Hannes Reinecke Message-ID: Date: Fri, 27 Nov 2020 11:37:10 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.4.0 MIME-Version: 1.0 In-Reply-To: <20201126130422.92945-12-hch@lst.de> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-bcache@vger.kernel.org On 11/26/20 2:03 PM, Christoph Hellwig wrote: > sector_t is now always a u64, so this check is not needed. > > Signed-off-by: Christoph Hellwig > Acked-by: Tejun Heo > Reviewed-by: Jan Kara > --- > block/ioctl.c | 9 --------- > 1 file changed, 9 deletions(-) > > diff --git a/block/ioctl.c b/block/ioctl.c > index 6b785181344fe1..0c09bb7a6ff35f 100644 > --- a/block/ioctl.c > +++ b/block/ioctl.c > @@ -35,15 +35,6 @@ static int blkpg_do_ioctl(struct block_device *bdev, > start = p.start >> SECTOR_SHIFT; > length = p.length >> SECTOR_SHIFT; > > - /* check for fit in a hd_struct */ > - if (sizeof(sector_t) < sizeof(long long)) { > - long pstart = start, plength = length; > - > - if (pstart != start || plength != length || pstart < 0 || > - plength < 0 || p.pno > 65535) > - return -EINVAL; > - } > - > switch (op) { > case BLKPG_ADD_PARTITION: > /* check if partition is aligned to blocksize */ > Reviewed-by: Hannes Reinecke Cheers, Hannes -- Dr. Hannes Reinecke Kernel Storage Architect hare@suse.de +49 911 74053 688 SUSE Software Solutions GmbH, Maxfeldstr. 5, 90409 Nürnberg HRB 36809 (AG Nürnberg), Geschäftsführer: Felix Imendörffer