Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp401922ybb; Sat, 28 Mar 2020 01:40:48 -0700 (PDT) X-Google-Smtp-Source: ADFU+vs3UWm/Dkwco4bh2St1ZXEJVwQIFNnvPVJ++atdee/OLjE/gDf49TEZaym4ZuHhdj2fOQRt X-Received: by 2002:a4a:a11a:: with SMTP id i26mr2626970ool.87.1585384848724; Sat, 28 Mar 2020 01:40:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585384848; cv=none; d=google.com; s=arc-20160816; b=i6/EO8IiV7l8RzMo9P8E8ZnNmCVd6e/DMPHPyv9RoMnlPcecxtl8acnSdPGEiZ4m1N rXSxgZVa7wgXTCjTEKFeIZzXQVqHE6v2t2OiOSpSdRN2hUFpbAIYFCryBFA7pZSw4vNY U7sUJJsitDYFlfRXJhSPh+utl4akjeNFdA9JGgseLyB0UxgthfN+S3rani2at166+0CN uo76j2IpvTOXrpKlBZ1pJniolb8gHw+RBCF1otl4V9F5HF7TOB4TTTKiHCO6/V3iuVOG AFH20YKA39KxZPxqDzRlolE0Fgh5RVzYD2X1YJNj5CWpukz/vPCHzDuFBTItcZ4nPD+j C6RA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=ZHgNvgU6XaywbhShpi+DyT3Yz9W+DlVpT27IblHcGig=; b=xO1hnoCbDajh9LvlQ13jjs1QO2qcRywoxLZ5VSXVN86bouhnA2JSiy/CxvN91omJZa mBDYt+jdmQJYSxVkTfrvemU0Os+Ke672nnUr1y0/8Y+V3RyHTWNzfB3DCx8Klxu6Z350 uwZgwU6pjCCAJroVUhB8FhH+cxJZGeYg90USGB6sRlNr2/V1unlezgB7I7eJPjsiU764 hm2/V/otxQd7gzuYXVvVrztSyJzelk/KrzddI5pM4CwGqLlkEGcKs8eg+GKsO/pp35yD 3bYGXh5gfPD7N7gaCdxaR9btJ4bTsy3Q9jvTJ/kVXiGxlyKwSPn8rBrN0XZ/gx9ghDDs Cs3w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k18si1873771otf.285.2020.03.28.01.40.36; Sat, 28 Mar 2020 01:40:48 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726283AbgC1Ii5 (ORCPT + 99 others); Sat, 28 Mar 2020 04:38:57 -0400 Received: from szxga06-in.huawei.com ([45.249.212.32]:51390 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725937AbgC1Ii5 (ORCPT ); Sat, 28 Mar 2020 04:38:57 -0400 Received: from DGGEMS404-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id 5A3213A18FC3287734DC; Sat, 28 Mar 2020 16:38:30 +0800 (CST) Received: from [10.134.22.195] (10.134.22.195) by smtp.huawei.com (10.3.19.204) with Microsoft SMTP Server (TLS) id 14.3.487.0; Sat, 28 Mar 2020 16:38:28 +0800 Subject: Re: [PATCH 3/3] f2fs: fix to check f2fs_compressed_file() in f2fs_bmap() To: Jaegeuk Kim CC: , , References: <20200327102953.104035-1-yuchao0@huawei.com> <20200327102953.104035-3-yuchao0@huawei.com> <20200327193233.GB186975@google.com> From: Chao Yu Message-ID: Date: Sat, 28 Mar 2020 16:38:27 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <20200327193233.GB186975@google.com> Content-Type: text/plain; charset="windows-1252" Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [10.134.22.195] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2020/3/28 3:32, Jaegeuk Kim wrote: > On 03/27, Chao Yu wrote: >> Otherwise, for compressed inode, returned physical block address >> may be wrong. > > We can use bmap to check the allocated (non)compressed blocks. Sure, I've updated it in v2. Thanks, > >> >> Signed-off-by: Chao Yu >> --- >> fs/f2fs/data.c | 2 ++ >> 1 file changed, 2 insertions(+) >> >> diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c >> index 24643680489b..f22f3ba10a48 100644 >> --- a/fs/f2fs/data.c >> +++ b/fs/f2fs/data.c >> @@ -3591,6 +3591,8 @@ static sector_t f2fs_bmap(struct address_space *mapping, sector_t block) >> >> if (f2fs_has_inline_data(inode)) >> return 0; >> + if (f2fs_compressed_file(inode)) >> + return 0; >> >> /* make sure allocating whole blocks */ >> if (mapping_tagged(mapping, PAGECACHE_TAG_DIRTY)) >> -- >> 2.18.0.rc1 > . >