Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp2815407ybb; Fri, 27 Mar 2020 12:35:00 -0700 (PDT) X-Google-Smtp-Source: ADFU+vvsd8qESHREK9CWRiZy7XuGqvFqfGy6aKeRVDrizakfp0c92f9zjUxHi2I8B3uKQ+6AvvFN X-Received: by 2002:a9d:bf5:: with SMTP id 108mr242497oth.260.1585337700427; Fri, 27 Mar 2020 12:35:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585337700; cv=none; d=google.com; s=arc-20160816; b=JdllkcjYPVYeomIjTBFCNRzw0cLg7fw7/R5F23frhYVzTuI1dVBdCWqfTGBWyqaWfe pOAOcK8y+j43xfZnAiXPoKwRDwnNQiWgSK2JvC/tA/7s2KtW5CvWB8rdtSQX0rdJKDis Ci53P/Gk+/gq8NRN94KEDEfHL0+A5DkQUzs6sbhNFt74eixRqW6TRwVGUDYGRFXW5Y8c RfYRBe4Vj8sEt1KyBumswou7H9HaDJJejHR/nE/7QOJ1gOj2Rf5y57oj7x5Go37v1NJP oCUrncQqdEZ3977uTf8fOa+Wf4/kItwgygGz6oPw9ZFNxBSZTOQusrjhPV+UQie3kF7i rMPA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=/HMMyirqvp+PVUVaPvmDMQ4oNIOCk9gieu2P+uqNYyg=; b=s+2ffX8Q1lbQLSfBUTVCUXORywDHJVOuzCdS6uRJEzcpkdYsqduxknusTt/9OsAUGE fnz4zsXs9bO7yVHywtXahlXRah5aWYYe15kibPBIR2qbGOAbONS73m3EpJpQ8vhp4b/r anAeUkPbBRIhbpi8ffKJeXPCaFwYaaxPGXO5ttw2grwtt+R/PtxSw2O5ImLDhe84YTVV nUjNNoG7QvrTRjwmUFPBF0gW9XKewusWWUlotWYUj18g+4Ae0z98idEPlpF+EC4b702l oQUSJ0+mgYsy/IBiD+9XSLAHyDzEefBOjxvgSMjJ0Bj0qchODuzN3DO7ioOejN6meVq8 IJQA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=ZIdX+zVL; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m23si2945136ots.325.2020.03.27.12.34.34; Fri, 27 Mar 2020 12:35:00 -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; dkim=pass header.i=@kernel.org header.s=default header.b=ZIdX+zVL; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727349AbgC0Tce (ORCPT + 99 others); Fri, 27 Mar 2020 15:32:34 -0400 Received: from mail.kernel.org ([198.145.29.99]:33232 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726738AbgC0Tce (ORCPT ); Fri, 27 Mar 2020 15:32:34 -0400 Received: from localhost (unknown [104.132.1.66]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 8F43F20575; Fri, 27 Mar 2020 19:32:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1585337553; bh=wWoAjZwt2nR5X1UPX0ZZp4acCT8N6K2BluWge4uJRGQ=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=ZIdX+zVLGrFZGp9dBUOVypptkgXVWdke59yk8jKqMZpdpClIGzxKm2WW990B2Xq3w Ycgwyu0RSSByNv0YKGZ2hWNga+DXU4+PwFWzck9gYDldbJWpDsfE1qHVMH/JkWe4Ha IniH6OY7izr4MJGs8sp2auOMJRfD+eAD4WKlRqOI= Date: Fri, 27 Mar 2020 12:32:33 -0700 From: Jaegeuk Kim To: Chao Yu Cc: linux-f2fs-devel@lists.sourceforge.net, linux-kernel@vger.kernel.org, chao@kernel.org Subject: Re: [PATCH 3/3] f2fs: fix to check f2fs_compressed_file() in f2fs_bmap() Message-ID: <20200327193233.GB186975@google.com> References: <20200327102953.104035-1-yuchao0@huawei.com> <20200327102953.104035-3-yuchao0@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200327102953.104035-3-yuchao0@huawei.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. > > 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