Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp2328474ybb; Fri, 27 Mar 2020 03:32:03 -0700 (PDT) X-Google-Smtp-Source: ADFU+vuOIhB9A4UFPz88csKLtDysUkuzOkIrVdSbKi7E6hKgDs8pdWxEAjUmuNS5sUqIMa9x3p5z X-Received: by 2002:a9d:344:: with SMTP id 62mr10389367otv.102.1585305122955; Fri, 27 Mar 2020 03:32:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585305122; cv=none; d=google.com; s=arc-20160816; b=bET3ZrjDryqo4c4JGkSY8JqS9xk3YqepAk+8DvbkwiAECtPF+aWPNHAXMe1foXyDSH 9qo2yBRmtaP+5m3/m2KDtTOtGrgVXj/xTdDCucP70316cYboV7MEqmmIsPnvYO0u1JLY kEPkL3kJfBam3FsyO8FPMDm2B6HWc3y99sT6mwWKSaGiERqczZxkESki6SLXq8JAbLK3 VFTN0Y8wT16aDHTbw4MIda/S9xtGUS0XbxrFHgqkvy6NFGDpoj8qyisJAmS/4RePAWkL BufcIoaNR4NDV4o+kmnnODWjDCnGlEdjNFGs9gNYT1Mlmy4NyUP7Tk4KjdZR6ep5N2LK u31g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from; bh=EQlv4U5qpLZoqsoVBExTEwOENdI//CXguKnbBxqkBeI=; b=KvxQNeUEG/KJjHgng7uFDm6oyfCqa/v3wwpyATNQ/m1EhTJdFBjwEaCb6mi5jBlpXi oK6h5UKOJZLyZcY4o8WozkgsIaL5Fv/1VkWtTsCWIMEcHMSOgXX5I4laWbY3eOGbh2GQ PPOfXsw3ZPoq61a1HDYLEmP+ClPCHWkDssDRFQ8hL0YUkKcwaTZGsiVHK55uzOgZ2ZvL Ao2Jniakcav2ewh7t13bVmDE5c1qi0Ch+r0AWeYQPb2peoWfS5NEXWtgbyYEz8bhd+qb fkqwNNxigYjA+4pXgnibwANTFNHPVcRrjF+A3njxwL2WBfiYtFrg2jcDwI7D/SACTV31 bvWQ== 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 d8si2190966oti.306.2020.03.27.03.31.34; Fri, 27 Mar 2020 03:32:02 -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 S1727606AbgC0KaN (ORCPT + 99 others); Fri, 27 Mar 2020 06:30:13 -0400 Received: from szxga04-in.huawei.com ([45.249.212.190]:12140 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726454AbgC0KaM (ORCPT ); Fri, 27 Mar 2020 06:30:12 -0400 Received: from DGGEMS408-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id 8685B9729DC3EC16A2A0; Fri, 27 Mar 2020 18:30:08 +0800 (CST) Received: from szvp000203569.huawei.com (10.120.216.130) by DGGEMS408-HUB.china.huawei.com (10.3.19.208) with Microsoft SMTP Server id 14.3.487.0; Fri, 27 Mar 2020 18:29:58 +0800 From: Chao Yu To: CC: , , , Chao Yu Subject: [PATCH 3/3] f2fs: fix to check f2fs_compressed_file() in f2fs_bmap() Date: Fri, 27 Mar 2020 18:29:53 +0800 Message-ID: <20200327102953.104035-3-yuchao0@huawei.com> X-Mailer: git-send-email 2.18.0.rc1 In-Reply-To: <20200327102953.104035-1-yuchao0@huawei.com> References: <20200327102953.104035-1-yuchao0@huawei.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.120.216.130] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Otherwise, for compressed inode, returned physical block address may be wrong. 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