Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp878786pxv; Thu, 15 Jul 2021 18:43:59 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxpAOMossHPbmPIMiMvkU0KJQwi1xs9Aiji9HD/Nv9CpbttizJ0k9Bj7v5wDl8zTbXHFZFM X-Received: by 2002:a92:cb4d:: with SMTP id f13mr4932723ilq.57.1626399838909; Thu, 15 Jul 2021 18:43:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626399838; cv=none; d=google.com; s=arc-20160816; b=lm14Xfr7+yRTV7sr9asF07dwR7pw2ZWOfL1TqAR7NhxEXC5FcsysI+qa2qLaj1s/fv wn+reep/1pCfMm8+OId1Me+LtecKrs4lehCMXUUh9vpWoZf10R3FHrKDiDtewkqJ3d1P Qw7TNSTmBRYbte/LRM4S0lz+y6+5dVjLWxvINbGAC7Ats5U1k1lBBJBV+UvTESlhiQhL pXQZlKX5mlTowSpN74ZjcFWBW2n1YQum4JKBo5HnC4qcqI7ZTUiBJyIJ6z8QiDPH6ZVZ 5Ih39xXR8L1HfkriCvI/s18h4ZngpC/iVWYcnmvcz11Cd6bPQ+aFJbGHIdupig9JahPJ hCHg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=z8MK1LP1jvl0mvMR6klJ92auSZHvmLjFEOKnJLkKMdg=; b=kVzmajx9+cAKk7tbqg/5KnKSCmMTr8G9sZpPSvvyjClHezjw07Lq8un+ZDiSi5uUd3 YK6TOiy6OwGtOrrYIrYjdD5d3YuBUhv9ylg+9nBNRpTpTH/8ZAzHGp192hmauG38vxlY HeyZAXyHpx3AzSH9CVzxwsHfqREJto/vnWJ6hKXci3AaPCwfDVVn6s5euxHiYqL4DHX7 XvlWEdItp7rZpKVH/ZkwdXO/FYwahVaWnCRhbPb3Zb6tZWmoZ7nOWKIbZKFeRpsfIqJx 0F0R/cfFIi2SOm8uAd9oSVsb+SvrjQvvawPpGHVHZ5YMIa4dauns7xNBAKW9rRXrCH5X KpdQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id h12si7854571ild.123.2021.07.15.18.43.46; Thu, 15 Jul 2021 18:43:58 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230480AbhGPBpR (ORCPT + 99 others); Thu, 15 Jul 2021 21:45:17 -0400 Received: from szxga02-in.huawei.com ([45.249.212.188]:6939 "EHLO szxga02-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230388AbhGPBpQ (ORCPT ); Thu, 15 Jul 2021 21:45:16 -0400 Received: from dggeme703-chm.china.huawei.com (unknown [172.30.72.55]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4GQv5x1kZ0z7v3J; Fri, 16 Jul 2021 09:38:45 +0800 (CST) Received: from [10.174.178.125] (10.174.178.125) by dggeme703-chm.china.huawei.com (10.1.199.99) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2176.2; Fri, 16 Jul 2021 09:42:19 +0800 Subject: Re: [PATCH] mtd: fix size in mtd_info_user to support 64-bit To: Miquel Raynal CC: , , , , , , , References: <20210708131359.21591-1-linmiaohe@huawei.com> <20210716010224.44582046@xps13> From: Miaohe Lin Message-ID: <95e3d455-ccb1-0e22-ee83-78dc6ad8aab1@huawei.com> Date: Fri, 16 Jul 2021 09:42:19 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.6.0 MIME-Version: 1.0 In-Reply-To: <20210716010224.44582046@xps13> Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 8bit X-Originating-IP: [10.174.178.125] X-ClientProxiedBy: dggems705-chm.china.huawei.com (10.3.19.182) To dggeme703-chm.china.huawei.com (10.1.199.99) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2021/7/16 7:02, Miquel Raynal wrote: > Hi Miaohe, > > Miaohe Lin wrote on Thu, 8 Jul 2021 21:13:59 > +0800: > >> From: Feilong Lin >> >> The size in struct mtd_info_user is 32-bit, which will cause errors >> when obtaining the size of large-capacity MTD devices, such as TLC >> NAND FLASH-2048Gb. > > Besides the fact that such devices are far from being supported by the > Linux kernel, this change would basically break userspace, it cannot > enter as-is... > I see. Many thanks for your reply! We're working with these large-capacity MTD devices now, any suggestion to work around this? Thanks again! >> Fixes: 69423d99fc18 ("[MTD] update internal API to support 64-bit device size") >> Signed-off-by: Feilong Lin >> --- >> include/uapi/mtd/mtd-abi.h | 2 +- >> 1 file changed, 1 insertion(+), 1 deletion(-) >> >> diff --git a/include/uapi/mtd/mtd-abi.h b/include/uapi/mtd/mtd-abi.h >> index b869990c2db2..efe0b53b10c1 100644 >> --- a/include/uapi/mtd/mtd-abi.h >> +++ b/include/uapi/mtd/mtd-abi.h >> @@ -128,7 +128,7 @@ struct mtd_write_req { >> struct mtd_info_user { >> __u8 type; >> __u32 flags; >> - __u32 size; /* Total size of the MTD */ >> + __u64 size; /* Total size of the MTD */ >> __u32 erasesize; >> __u32 writesize; >> __u32 oobsize; /* Amount of OOB data per block (e.g. 16) */ > > Thanks, > Miquèl > . >