Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp4474019pxu; Wed, 9 Dec 2020 19:13:12 -0800 (PST) X-Google-Smtp-Source: ABdhPJy/6IaNJIj0YUaC/cNa2i6GgGcuOpq98DuTEmprMu41uepAEk5LPdKo7MkRtmyDjp5XaaIJ X-Received: by 2002:a17:907:6e6:: with SMTP id yh6mr4697532ejb.512.1607569992460; Wed, 09 Dec 2020 19:13:12 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1607569992; cv=pass; d=google.com; s=arc-20160816; b=dJwLDb0nt+do1aIeK1Cse4tBUFBBNjSMqNsikrusDwNbkQ7jxgVyhvo29gq3XjwS3h oEZ/z4Q+gCooKtyM6ku4w3V7ALZxg74rla1MMpE4Yq5+3vaEr6BdRnaQ1g2B5CCK3j3k zk65FpeTOQNmA+GArx6B8QhfmZsaWRxYE0pXr75PWv2J29YPCiapY3FlISSI795oCpNz Szg1ry0J6p4UEvLFQuoEtP6WrR34WE42HdogPaeJJn31yxenFeTrYJWmurwgXwrTdHNu 7L43qE2/liFrwKnEQLueGO3Jxrsu0BYZphLmyiNjm05O1nWuY8b9G436fjjSxjfyS3FC LedQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :in-reply-to:user-agent:date:message-id:from:references:cc:to :subject:dkim-signature; bh=z509Mn9C/4jzOBj1z02gqyKjyMsAkPWhMrPrxO+kM6s=; b=fqP0y4lVD6+nsgo/gSu+tFE5EFqQ1VGI1skaJ94GejgtkqUtz3+S9qVqFg9bK+gkBo W82cXugebmzc6AJfxhKWOvvFB/U1WotyWrhA7i2rTpWpSupjgRxpDf3XXXcILeq+CO+Q sQR+D7UHDVShSaHSM8J0GUtSXnrfHTXla8CyOm0y3lWrap8RvAEM18wFMF8ZmPpWvoB5 eK6309WxYjg+wHQUIH2GAa/XRxmeoNRmzORQHOBY0FcSvh9iAFfryhGEEGdbIqwubY/F 0GhSCxFxoyp6OtF9O81UMOyZJQ4xdr5RIlWym+nHVmiRnq6ZPuCkBx5qU1q0VZi+l9Zb EOXg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@oppoglobal.onmicrosoft.com header.s=selector1-oppoglobal-onmicrosoft-com header.b=dTGhyeJn; arc=pass (i=1 spf=pass spfdomain=oppo.com dkim=pass dkdomain=oppo.com dmarc=pass fromdomain=oppo.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=oppo.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a12si2240740edf.2.2020.12.09.19.12.49; Wed, 09 Dec 2020 19:13:12 -0800 (PST) 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; dkim=pass header.i=@oppoglobal.onmicrosoft.com header.s=selector1-oppoglobal-onmicrosoft-com header.b=dTGhyeJn; arc=pass (i=1 spf=pass spfdomain=oppo.com dkim=pass dkdomain=oppo.com dmarc=pass fromdomain=oppo.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=oppo.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728603AbgLJDK0 (ORCPT + 99 others); Wed, 9 Dec 2020 22:10:26 -0500 Received: from mail-eopbgr1310044.outbound.protection.outlook.com ([40.107.131.44]:49460 "EHLO APC01-SG2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727312AbgLJDK0 (ORCPT ); Wed, 9 Dec 2020 22:10:26 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=bVS401uX7RFSAipB8BbfPP2Q3Uu/LJRXyYRolK0KTrvOQ0ruqnuSj8FOHTlcWd41pK6q9IsvUDJDR/i+TxUdruZ6r5UC0UHlMVBRSsDs+7Svbc/hPwU0n6HcHt5CirQECXKLqwXcSlB7KYrHyqPHsE2Gm0Ecn9I6syOZYCacgCYIHgHe77b+MPHjbG7tZppcvJCcpVTcxc20knWVpVI3QYuTHLNZkS8QbwFo8IXKysQrEfSg2dref5b2LWti71zON7v4ugjH6H7bZ0A9qNQGioY8CWLvTZ4JkYkyPXHGSFb7VqAZ513Yh6D798SZJXyuFlwxI6AE5yXD+51apbj53w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=z509Mn9C/4jzOBj1z02gqyKjyMsAkPWhMrPrxO+kM6s=; b=PC8IwUFO8mqIxX9qjM5AynxMOxIsDRxFuhuUaDXT2rO/FUJafrAYxeySzuc916J1a/DuazlEgyljj19kqtJwsO6UBmMd+0TEB30imMbFQ99Z+5baLhvv3CciZQPHjXGOqIzsdofJ3CI27wjqyzh+G92erL+G/jhnxBSbCTO6qkfgEUkQ7bnQ3dEcoGwX5iSbN40VLgrehdzyCbwefSq5+R3HrAlgSb8BiVeUcJNqzSgo3UnqXnNQXaKy15CfeR7YljLDPMbqxvOk3E6qd3D474ZHjvLHSVfCW8h37jacQoeTjlaNnKPas7fQME/9jztEpKHXP2DUbbGkMHD9bE2HNA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oppo.com; dmarc=pass action=none header.from=oppo.com; dkim=pass header.d=oppo.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oppoglobal.onmicrosoft.com; s=selector1-oppoglobal-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=z509Mn9C/4jzOBj1z02gqyKjyMsAkPWhMrPrxO+kM6s=; b=dTGhyeJndLboeULNdNUDXtMTs/K0vZ39s2D169WgcRE51m9fR8xflavXmHeF2FQRQ76CfgOw6aJpK7HwcI7Zh4bRfbOO65IXWDq62S8Nj4T54D0EAVYUznKk6OTh13Wc1HuMdKo5yi3Zba7GGGr8kp4uILqRNGcQtDqTqEmHOkU= Authentication-Results: oppo.com; dkim=none (message not signed) header.d=none;oppo.com; dmarc=none action=none header.from=oppo.com; Received: from SG2PR02MB4108.apcprd02.prod.outlook.com (2603:1096:4:96::19) by SG2PR02MB3561.apcprd02.prod.outlook.com (2603:1096:4:4d::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3632.22; Thu, 10 Dec 2020 03:08:46 +0000 Received: from SG2PR02MB4108.apcprd02.prod.outlook.com ([fe80::dcd:13c1:2191:feb7]) by SG2PR02MB4108.apcprd02.prod.outlook.com ([fe80::dcd:13c1:2191:feb7%7]) with mapi id 15.20.3654.012; Thu, 10 Dec 2020 03:08:46 +0000 Subject: Re: [PATCH v5] erofs: avoid using generic_block_bmap To: Gao Xiang Cc: linux-erofs@lists.ozlabs.org, linux-kernel@vger.kernel.org, guoweichao@oppo.com, zhangshiming@oppo.com References: <20201209115740.18802-1-huangjianan@oppo.com> <20201210023612.GA247374@xiangao.remote.csb> From: Huang Jianan Message-ID: Date: Thu, 10 Dec 2020 11:08:36 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.5.1 In-Reply-To: <20201210023612.GA247374@xiangao.remote.csb> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-Originating-IP: [58.255.79.104] X-ClientProxiedBy: HK0PR03CA0119.apcprd03.prod.outlook.com (2603:1096:203:b0::35) To SG2PR02MB4108.apcprd02.prod.outlook.com (2603:1096:4:96::19) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from [10.118.0.32] (58.255.79.104) by HK0PR03CA0119.apcprd03.prod.outlook.com (2603:1096:203:b0::35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3654.12 via Frontend Transport; Thu, 10 Dec 2020 03:08:45 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 70e2565c-be3f-4d73-6e4c-08d89cb8e878 X-MS-TrafficTypeDiagnostic: SG2PR02MB3561: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:2657; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 8Pta+5fgq8JOovwW9nbi0G2MGbBJs8E44XRtzxh7I30hGBpDDXfp2y3K+5/mwp/fEVN2RSW+4p7uQrv3ihXDHutLp+vWPQ//ogKn9pFa21ffUY/8GSlg3M5tlZcjZwDQaRacLXYM+gGFpiQY2wceJuSSX3U7am9qJJ4AHg0QeoBeCi8xKH7WBEhWPgn+KsgT74p9I37ZjyUgm8o3E94FBI7+NWAa0WOQ8igZSWV0BtFzDce8/48QbYwP9ykeJvndI3JAUS2VSUAxYYTZz4RyknSqU5kyqmH1HCQz327FxMyftKZ9yCrA8QIkma4w1kJywH/TF4U6sL4ZefegiPJ5Hxff6xqiQaOZfNLrSuUy+ZTfJn4bVzONkPSCdd/fEEPwOu9QYXue4ugVrmfhH0Pc/jWzCNEAUjPHHDXBykZ3O4CFov7ln3TjMkju9l8TqYIRoovyTEjVM2WoPRn/3a+OOX3IyirknEghCBCmdqDMkH9kWe84jNDP71MrpvVnFs96 X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SG2PR02MB4108.apcprd02.prod.outlook.com;PTR:;CAT:NONE;SFS:(4636009)(346002)(376002)(366004)(136003)(66556008)(107886003)(508600001)(16526019)(8676002)(66476007)(83380400001)(26005)(31696002)(8936002)(186003)(4326008)(86362001)(6666004)(34490700003)(66946007)(6486002)(52116002)(5660300002)(956004)(2616005)(31686004)(16576012)(36756003)(6916009)(2906002)(41533002)(11606006)(45980500001)(43740500002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData: =?utf-8?B?ZkJKTGcvejNEMnYzelFBNnlxTm94S1ZWWHNtdndpSlp2b04wV0hZaXAxSnFD?= =?utf-8?B?QTh3RkVJMSt2eEFJYnNNT1VFL05oM1E0QWhLNmQ0TWxyMzBqOU9ycXoydEdn?= =?utf-8?B?Y2dMVnd6dE44clUwdE0rUXJWNW1LQTZ0V3R3TWg0dzBoQ2lHcEw3VThVNkdL?= =?utf-8?B?dWl2R0c2bTUreVlsdmh2K2RXWUltbkFoUFRnQzQwVkN2V1ZpVktNMS9ZeHp1?= =?utf-8?B?SGx0L24rODFzeGx6cHdDVkV0bXY1aUNlaUxwQ084TEQ0NmRTZXdHb2tLSEtE?= =?utf-8?B?SXlxYjRra285WHU1YVd0ckJLNGErQ0RUNi9BK01DbS9BMkVUaUh2Y09sczNs?= =?utf-8?B?WHduY0tObjhBYklBYUUvTEp3dVFTbXVhU3ZtZk9RdUZTWGQ4NmN1aVlobU1K?= =?utf-8?B?enJQVDBnRmN1UG50MGNkV1NtdmExUk9LclBxVVY5QlVnZ2JHYnUwN0RFam5j?= =?utf-8?B?V1RCMFlCQmNtdDZ3QitxMFRtaXNUVHNodmlxZ1VFblFUeWpSTkVnSm5QZ2V6?= =?utf-8?B?dldJV2lQbjZVTVRVQWxXdGpMVHpBR3VzVSs3cG9maE0yZkdISWFBWmI5UDNL?= =?utf-8?B?blhwQjVwTkt3MWRmc2c3QkFPcTh4WStLYnd2ZExtRHoyc3Axd3h2cFF5eUQw?= =?utf-8?B?Vm9TNlFoWU1kYjVFdzljRFVIWUtoaUM1WWxqSXpSUEJyTEpack8xT09ZdkI4?= =?utf-8?B?OTh4NkU0elltVlk4RzNFeWptUHMzKy9KUHhySnR6Z3QvU1M4aGJQSHp4ZTZF?= =?utf-8?B?SlRKRE5IcnJJcmZwQUVXTWg0bzQ1cmxIaHRGRE40T1hJaTZueXFLb1Z0TkFl?= =?utf-8?B?aFM5TmswcFM2Q29NVVZxSDlXbi84NERDVVZ6c3lnKzNTLzQwOGh1RkhNaE1M?= =?utf-8?B?aUFiZE1ZcVNhSjBXbHFlanN2NWtFU3hFU2FmVGVoZ082MEdPMHdyYVRFbEhM?= =?utf-8?B?MzJLMkhTUllYVGlCaThsbHBsVlpkV2NNWnhMaWQ3V3hwcmlPeEVEU2ZpYUJC?= =?utf-8?B?ZTRtMUhhOTdlRFQvR0ppaVZVQVNjWGhUQ1NDUnNKY29Fc0t6aXVvWHFuenUx?= =?utf-8?B?UjdtdnJxUGRRL0RTdHFwYnQvQUREdmFHUlM5M2w1aGFPbUFnZ0NQZFBqckpz?= =?utf-8?B?U0MxNmlYSmhKVks4RlNucGhBVnBYNEx5TnUrZG9JU1Q1SEhJWVpiZEJqUnF4?= =?utf-8?B?VTNwMG8xV0JrbjBmRWFtNFQzcWNZY2tJZlJacnlpcS9EUDlWdmlCTGRYSXZp?= =?utf-8?B?cWlqc3FLRG5FQzBJUk9MYVFNSVcxNE8rM0NGeHN3RHg1YldmYkNIOU5TcSt6?= =?utf-8?Q?dmkAzjdfx0xmv+8Ev/WbWWm6gE+XbJQHrQ?= X-OriginatorOrg: oppo.com X-MS-Exchange-CrossTenant-AuthSource: SG2PR02MB4108.apcprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Dec 2020 03:08:45.9208 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: f1905eb1-c353-41c5-9516-62b4a54b5ee6 X-MS-Exchange-CrossTenant-Network-Message-Id: 70e2565c-be3f-4d73-6e4c-08d89cb8e878 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: xsth3iSSH7Sl7+YJsUquWuN5OtHXqtA260KSK+w/C+XhP1p9l+JhSM87x0L9eOFRwSDzBY2hsLKN9xNgs4JBag== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SG2PR02MB3561 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Thanks for reminding me, I will pay attention about this next time. 在 2020/12/10 10:36, Gao Xiang 写道: > Hi Jianan, > > On Wed, Dec 09, 2020 at 07:57:40PM +0800, Huang Jianan wrote: >> iblock indicates the number of i_blkbits-sized blocks rather than >> sectors. >> >> In addition, considering buffer_head limits mapped size to 32-bits, >> should avoid using generic_block_bmap. >> >> Fixes: 9da681e017a3 ("staging: erofs: support bmap") >> Signed-off-by: Huang Jianan >> Signed-off-by: Guo Weichao > Reviewed-by: Gao Xiang > > Also, I think Chao has sent his Reviewed-by in the previous reply --- > so unless some major modification happens, it needs to be attached with > all new versions as a common practice... > > I will apply it later to for-next, thanks for your patch! > > Thanks, > Gao Xiang > >> --- >> fs/erofs/data.c | 26 +++++++------------------- >> 1 file changed, 7 insertions(+), 19 deletions(-) >> >> diff --git a/fs/erofs/data.c b/fs/erofs/data.c >> index 347be146884c..ea4f693bee22 100644 >> --- a/fs/erofs/data.c >> +++ b/fs/erofs/data.c >> @@ -312,27 +312,12 @@ static void erofs_raw_access_readahead(struct readahead_control *rac) >> submit_bio(bio); >> } >> >> -static int erofs_get_block(struct inode *inode, sector_t iblock, >> - struct buffer_head *bh, int create) >> -{ >> - struct erofs_map_blocks map = { >> - .m_la = iblock << 9, >> - }; >> - int err; >> - >> - err = erofs_map_blocks(inode, &map, EROFS_GET_BLOCKS_RAW); >> - if (err) >> - return err; >> - >> - if (map.m_flags & EROFS_MAP_MAPPED) >> - bh->b_blocknr = erofs_blknr(map.m_pa); >> - >> - return err; >> -} >> - >> static sector_t erofs_bmap(struct address_space *mapping, sector_t block) >> { >> struct inode *inode = mapping->host; >> + struct erofs_map_blocks map = { >> + .m_la = blknr_to_addr(block), >> + }; >> >> if (EROFS_I(inode)->datalayout == EROFS_INODE_FLAT_INLINE) { >> erofs_blk_t blks = i_size_read(inode) >> LOG_BLOCK_SIZE; >> @@ -341,7 +326,10 @@ static sector_t erofs_bmap(struct address_space *mapping, sector_t block) >> return 0; >> } >> >> - return generic_block_bmap(mapping, block, erofs_get_block); >> + if (!erofs_map_blocks(inode, &map, EROFS_GET_BLOCKS_RAW)) >> + return erofs_blknr(map.m_pa); >> + >> + return 0; >> } >> >> /* for uncompressed (aligned) files and raw access for other files */ >> -- >> 2.25.1 >>