Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp615742pxk; Sun, 30 Aug 2020 16:41:24 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyY2sJ4Ciw34SBLNJD1ca7VgwZCSvUBRpGHKauy/3vq+aACfM0nm9nbBZ5EkMX4WVShlaK6 X-Received: by 2002:a50:e68a:: with SMTP id z10mr3963642edm.100.1598830883842; Sun, 30 Aug 2020 16:41:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598830883; cv=none; d=google.com; s=arc-20160816; b=M99foheaNXp26H8baNIwhfOGuqRW9INqHHgYhFir9gI632xvFfHD5+kV//bc2E0efj 9PweJsK0YoUzNLDuFKhoZ+SSQZpqD0hzdDkYpxS97YYgp7WXKbz8oSUy3rKUda20dGla 8HWjLZ6Q3Y7CoDs+Y/gK9R+wfsMJ9GY5yEPNjuastgNnYndNclXXd0AH2pZelsUPdIf8 RgJbnRkXIk91MtGMSPoKPgiLvJAZ4w834tAmO/wYD2jOoixTD8/G7WjRsdWf6wAFiq+c j02MbzlJ/yD51yhlLpamJ6krnmQZq7/80HG298HW7ksSwFP4GQ+Af6Z+R6R1n7QFHQ3I B3nw== 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:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=EL8TFBMW/hIieihPeTsDrz8LXdOaui0bvelva2VBqDc=; b=dq/nrzFc3okjvCtJjojMizoum15+GaRJauHWluHFzJXhmpFzIjPrAZp5aIWTiVv1IA p69Wo0lP30XJlcABq9qUXSyY3KIyOJFedo00AThzs/7bx+2YjlrvMvOQvq23IkpJtvbb zNggVvaRtzfv8t5DV9ZkmF0qlQMaDgVO+4YRihNfqQf07OvuxSGNAvxU0h7XpnpqBz8I P5wzI1kvwFWs06YnGO4Hsls7jzhsA1CYznO0wiHRgW6OVDzclZkPVWddKIaB8VK3n/S9 4jzMqSooSwgvMF+OtFFeZ59tZAQgzi+TL/jnKnXQOLwLx8M65exC5vdBqMGxzilIuIeL nlBw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=E9sGCz0J; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id qx20si2050236ejb.469.2020.08.30.16.41.00; Sun, 30 Aug 2020 16:41:23 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=E9sGCz0J; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726453AbgH3XhF (ORCPT + 99 others); Sun, 30 Aug 2020 19:37:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48424 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726388AbgH3XhE (ORCPT ); Sun, 30 Aug 2020 19:37:04 -0400 Received: from mail-lj1-x244.google.com (mail-lj1-x244.google.com [IPv6:2a00:1450:4864:20::244]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 572B1C061573 for ; Sun, 30 Aug 2020 16:37:04 -0700 (PDT) Received: by mail-lj1-x244.google.com with SMTP id w14so4661698ljj.4 for ; Sun, 30 Aug 2020 16:37:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=EL8TFBMW/hIieihPeTsDrz8LXdOaui0bvelva2VBqDc=; b=E9sGCz0JrQnaGVrW8I6SnshIT6NkhKRTsNmuQmoK3U1uJOY0azs76dnK5wuqZ+wac1 QY3E1upqQ0Gv/UPI1txoDL65O1AOTPBojxhH2UuRg4PAkFpVgCyDq3QO46wu52gYyfib 9Ez3QwvpWE9xiiMPoApCuZULj/zQ28sB3ubqRUIQUdle6izL5920MnXHRgItGocDawvO XgreeiqyyYf+pGSXhug6YuFJeGHJcs+jMMPTPGC9oCp+7wjoy3LONZTQvG1bB9Z1LGbx WbqptCXOok6oZ8G0+5MFUYjF92rE/tcaQA76THXqdaEdBtMF3XUKeAVBtOkR0UYSBzmx vPBw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=EL8TFBMW/hIieihPeTsDrz8LXdOaui0bvelva2VBqDc=; b=YapIdfRD8Z+EoLKvQ7wuxsWz6z3DoEuW72sBwr+aiFnNMI7biDg4UjYjsPJ5rZm4zD SHfKF5vGiyzIwwkKIxoTTnrq7B9a4G7mAtHs6gRZeIQABS+8Lpin4c1IF12PqBobq+4t Z1dgbVGBP3VilGGXspZPRrsLtsoXst5ovUe+9NFIBfZ7kzDZxlHVleUkCZJ9un+lA/NK X4q1QM6G21oGIhkQrwh36iIkwYFbP98xHJZJ26L0FBejBco1J6jeTUwJQvEkwSvlq8sr crAQLhJ2CLSYov1TcbjUxiGmehsQleAKNfjDG+pCknrXzrZ0tfxJBZVP888ca11bbrFk 6yPQ== X-Gm-Message-State: AOAM530mZ/r2bloGAchgdL3SYg7lz3/0XGSa9Skw2pc6wbOdNSqFEen1 5e7TLYZ4j2AFjPyyWNA1GQ8c0K4y1xL3b1poTLk= X-Received: by 2002:a2e:2c17:: with SMTP id s23mr4259213ljs.265.1598830622417; Sun, 30 Aug 2020 16:37:02 -0700 (PDT) MIME-Version: 1.0 References: <20200828034953.354267-1-daeho43@gmail.com> <44f8d9f3-9438-fdfe-bbc3-f5347a9aaa29@kernel.org> In-Reply-To: <44f8d9f3-9438-fdfe-bbc3-f5347a9aaa29@kernel.org> From: Daeho Jeong Date: Mon, 31 Aug 2020 08:36:51 +0900 Message-ID: Subject: Re: [f2fs-dev] [PATCH] f2fs: make fibmap consistent with fiemap for compression chunk To: Chao Yu Cc: linux-kernel@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net, kernel-team@android.com, Daeho Jeong Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org I got it. Thanks~ :) 2020=EB=85=84 8=EC=9B=94 30=EC=9D=BC (=EC=9D=BC) =EC=98=A4=EC=A0=84 8:44, C= hao Yu =EB=8B=98=EC=9D=B4 =EC=9E=91=EC=84=B1: > > On 2020-8-28 11:49, Daeho Jeong wrote: > > From: Daeho Jeong > > > > Currently fibmap returns zero address for compression chunk. But it > > is not consistent with the output of fiemap, since fiemap returns > > real pysical block address related to the compression chunk. Therefore > > I suggest fibmap returns the same output with fiemap. > > We can return real physical block address in fiemap, because we have set > FIEMAP_EXTENT_ENCODED flag in extent.fe_flags, then user can be noticed t= hat he > can not just read/write that block address for access/update in-there dat= a. > > Quoted from Documentation/filesystems/fiemap.rst > " > FIEMAP_EXTENT_ENCODED > This extent does not consist of plain filesystem blocks but is > encoded (e.g. encrypted or compressed). Reading the data in this > extent via I/O to the block device will have undefined results. > " > > However, there is no such flag in fibmap interface, so I just return bloc= k > address for those logical pages in non-compressed cluster. > > Thanks, > > > > > Signed-off-by: Daeho Jeong > > --- > > fs/f2fs/data.c | 33 --------------------------------- > > 1 file changed, 33 deletions(-) > > > > diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c > > index c1b676be67b9..8c26c5d0c778 100644 > > --- a/fs/f2fs/data.c > > +++ b/fs/f2fs/data.c > > @@ -3708,36 +3708,6 @@ static int f2fs_set_data_page_dirty(struct page = *page) > > return 0; > > } > > > > - > > -static sector_t f2fs_bmap_compress(struct inode *inode, sector_t block= ) > > -{ > > -#ifdef CONFIG_F2FS_FS_COMPRESSION > > - struct dnode_of_data dn; > > - sector_t start_idx, blknr =3D 0; > > - int ret; > > - > > - start_idx =3D round_down(block, F2FS_I(inode)->i_cluster_size); > > - > > - set_new_dnode(&dn, inode, NULL, NULL, 0); > > - ret =3D f2fs_get_dnode_of_data(&dn, start_idx, LOOKUP_NODE); > > - if (ret) > > - return 0; > > - > > - if (dn.data_blkaddr !=3D COMPRESS_ADDR) { > > - dn.ofs_in_node +=3D block - start_idx; > > - blknr =3D f2fs_data_blkaddr(&dn); > > - if (!__is_valid_data_blkaddr(blknr)) > > - blknr =3D 0; > > - } > > - > > - f2fs_put_dnode(&dn); > > - return blknr; > > -#else > > - return 0; > > -#endif > > -} > > - > > - > > static sector_t f2fs_bmap(struct address_space *mapping, sector_t bloc= k) > > { > > struct inode *inode =3D mapping->host; > > @@ -3753,9 +3723,6 @@ static sector_t f2fs_bmap(struct address_space *m= apping, sector_t block) > > if (mapping_tagged(mapping, PAGECACHE_TAG_DIRTY)) > > filemap_write_and_wait(mapping); > > > > - if (f2fs_compressed_file(inode)) > > - blknr =3D f2fs_bmap_compress(inode, block); > > - > > if (!get_data_block_bmap(inode, block, &tmp, 0)) > > blknr =3D tmp.b_blocknr; > > out: > >