From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.sourceforge.net (lists.sourceforge.net [216.105.38.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 236A9C6FD1D for ; Fri, 7 Apr 2023 20:59:35 +0000 (UTC) Received: from [127.0.0.1] (helo=sfs-ml-1.v29.lw.sourceforge.com) by sfs-ml-1.v29.lw.sourceforge.com with esmtp (Exim 4.95) (envelope-from ) id 1pktBG-0002bX-Bu; Fri, 07 Apr 2023 20:59:33 +0000 Received: from [172.30.20.202] (helo=mx.sourceforge.net) by sfs-ml-1.v29.lw.sourceforge.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1pktBF-0002bQ-Sw for linux-f2fs-devel@lists.sourceforge.net; Fri, 07 Apr 2023 20:59:33 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=In-Reply-To:Content-Type:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=fcObKQ18X4QENw5z5wgy3RbMSH7kIsRP9wdBVD6F7VI=; b=HWfSlNA8mx3Z/aKM8mw0Icuspc EB7++yAGryUBwCPKUdcFw3zVwPeFuCE4Wwtj1wWZUYqQux4Qv0HRXyhtXfGUp6mBJGjyVoGJPioLY vKzZe5Nb8F4sP5zXfIL5euLmt6SNESaQZ6CZlI/TnnpNpBqr7bPl/1v1XZnYn7GDxc58=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=In-Reply-To:Content-Type:MIME-Version:References:Message-ID:Subject:Cc:To :From:Date:Sender:Reply-To:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=fcObKQ18X4QENw5z5wgy3RbMSH7kIsRP9wdBVD6F7VI=; b=kumFugQnTdmXKw6+K+/k1RNCEy UUjM/Bgk8jWht5AVObeH2bYjbChrx7pTycsQmw3dlu+mR91bAvW+NgbB0+K4a0F9mmdAZ7h1rzvpY v72uExY/IPOIOJ23ABdBnfRQqkhUAv7pFsIf/WHhF4IsSjWxDdHwEmNUEz/nBYTzFGWo=; Received: from dfw.source.kernel.org ([139.178.84.217]) by sfi-mx-1.v28.lw.sourceforge.com with esmtps (TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.95) id 1pktBE-000U5I-Bw for linux-f2fs-devel@lists.sourceforge.net; Fri, 07 Apr 2023 20:59:32 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 305DC6129A for ; Fri, 7 Apr 2023 20:59:26 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7AE92C433EF; Fri, 7 Apr 2023 20:59:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1680901165; bh=T9eB8QdjMGMVT/DK1Yt9pviXcxgW+FQv8ahMZ8rJJWs=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=NT08vvwvuEn44vtimLvpex7KgTITAUypeP1kRh/nV+MPl2DY8iwEhVVlRAD9c6bLg Fr0JvThfh+vv8zLbAQ1QYfqVAd9sNXAm4EoJR40iox0D8lFL4ZWplQuWTIhNaCphDA +ARBw5eA4XQZEiHXy6CPWIxTJNjWprfwYC3aylbEv5a45rdjq/NXOU3iDyTcz4LDAF xHJb+zbwLcvejNthoA5UwBfE3dL6T1NmzHPQsEufr9N6T9y1N/aWymvWwvadIHl+tP GyX47hXgeltx7u2ecnIpXS//PHRHzamJhCeMmXsskEB/RJSQIGj/2GswKmJuIciZ0L xZhFibWav8wyg== Date: Fri, 7 Apr 2023 13:59:23 -0700 From: Jaegeuk Kim To: Chao Yu Message-ID: References: <20230405144359.930253-1-chao@kernel.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20230405144359.930253-1-chao@kernel.org> X-Headers-End: 1pktBE-000U5I-Bw Subject: Re: [f2fs-dev] [PATCH] f2fs: fix to tag FIEMAP_EXTENT_DELALLOC in fiemap() for delay allocated extent X-BeenThere: linux-f2fs-devel@lists.sourceforge.net X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-kernel@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: linux-f2fs-devel-bounces@lists.sourceforge.net This breaks generic/009? On 04/05, Chao Yu wrote: > xfstest generic/614 fails to run due below reason: > > generic/614 1s ... [not run] test requires delayed allocation buffered writes > > The root cause is f2fs tags wrong fiemap flag for delay allocated > extent. > > Quoted from fiemap.h: > FIEMAP_EXTENT_UNKNOWN 0x00000002 /* Data location unknown. */ > FIEMAP_EXTENT_DELALLOC 0x00000004 /* Location still pending. > * Sets EXTENT_UNKNOWN. */ > FIEMAP_EXTENT_UNWRITTEN 0x00000800 /* Space allocated, but > * no data (i.e. zero). */ > > FIEMAP_EXTENT_UNWRITTEN means block address is preallocated, but w/o > been written any data, which status f2fs is not supported now, for all > NEW_ADDR block addresses, it means delay allocated blocks, so let's > tag FIEMAP_EXTENT_DELALLOC instead. > > Testcase: > xfs_io -f -c 'pwrite 0 64k' /mnt/f2fs/file; > filefrag -v /mnt/f2fs/file > > Output: > - Before > Filesystem type is: f2f52010 > Fize of /mnt/f2fs/file is 65536 (16 blocks of 4096 bytes) > ext: logical_offset: physical_offset: length: expected: flags: > 0: 0.. 15: 0.. 15: 16: last,unwritten,merged,eof > /mnt/f2fs/file: 1 extent found > > After: > Filesystem type is: f2f52010 > File size of /mnt/f2fs/file is 65536 (16 blocks of 4096 bytes) > ext: logical_offset: physical_offset: length: expected: flags: > 0: 0.. 15: 0.. 0: 0: last,unknown_loc,delalloc,eof > /mnt/f2fs/file: 1 extent found > > Fixes: 7f63eb77af7b ("f2fs: report unwritten area in f2fs_fiemap") > Signed-off-by: Chao Yu > --- > fs/f2fs/data.c | 7 +++++-- > 1 file changed, 5 insertions(+), 2 deletions(-) > > diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c > index 359de650772e..3afc9764743e 100644 > --- a/fs/f2fs/data.c > +++ b/fs/f2fs/data.c > @@ -1995,7 +1995,10 @@ int f2fs_fiemap(struct inode *inode, struct fiemap_extent_info *fieinfo, > } > > if (size) { > - flags |= FIEMAP_EXTENT_MERGED; > + if (flags & FIEMAP_EXTENT_DELALLOC) > + phys = 0; > + else > + flags |= FIEMAP_EXTENT_MERGED; > if (IS_ENCRYPTED(inode)) > flags |= FIEMAP_EXTENT_DATA_ENCRYPTED; > > @@ -2035,7 +2038,7 @@ int f2fs_fiemap(struct inode *inode, struct fiemap_extent_info *fieinfo, > size += blks_to_bytes(inode, 1); > } > } else if (map.m_flags & F2FS_MAP_DELALLOC) { > - flags = FIEMAP_EXTENT_UNWRITTEN; > + flags = FIEMAP_EXTENT_DELALLOC; > } > > start_blk += bytes_to_blks(inode, size); > -- > 2.36.1 _______________________________________________ Linux-f2fs-devel mailing list Linux-f2fs-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 87F6CC6FD1D for ; Fri, 7 Apr 2023 20:59:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229842AbjDGU73 (ORCPT ); Fri, 7 Apr 2023 16:59:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50162 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229462AbjDGU71 (ORCPT ); Fri, 7 Apr 2023 16:59:27 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A5AEA6A5A for ; Fri, 7 Apr 2023 13:59:26 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 2D1EF6114E for ; Fri, 7 Apr 2023 20:59:26 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7AE92C433EF; Fri, 7 Apr 2023 20:59:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1680901165; bh=T9eB8QdjMGMVT/DK1Yt9pviXcxgW+FQv8ahMZ8rJJWs=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=NT08vvwvuEn44vtimLvpex7KgTITAUypeP1kRh/nV+MPl2DY8iwEhVVlRAD9c6bLg Fr0JvThfh+vv8zLbAQ1QYfqVAd9sNXAm4EoJR40iox0D8lFL4ZWplQuWTIhNaCphDA +ARBw5eA4XQZEiHXy6CPWIxTJNjWprfwYC3aylbEv5a45rdjq/NXOU3iDyTcz4LDAF xHJb+zbwLcvejNthoA5UwBfE3dL6T1NmzHPQsEufr9N6T9y1N/aWymvWwvadIHl+tP GyX47hXgeltx7u2ecnIpXS//PHRHzamJhCeMmXsskEB/RJSQIGj/2GswKmJuIciZ0L xZhFibWav8wyg== Date: Fri, 7 Apr 2023 13:59:23 -0700 From: Jaegeuk Kim To: Chao Yu Cc: linux-f2fs-devel@lists.sourceforge.net, linux-kernel@vger.kernel.org Subject: Re: [PATCH] f2fs: fix to tag FIEMAP_EXTENT_DELALLOC in fiemap() for delay allocated extent Message-ID: References: <20230405144359.930253-1-chao@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230405144359.930253-1-chao@kernel.org> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This breaks generic/009? On 04/05, Chao Yu wrote: > xfstest generic/614 fails to run due below reason: > > generic/614 1s ... [not run] test requires delayed allocation buffered writes > > The root cause is f2fs tags wrong fiemap flag for delay allocated > extent. > > Quoted from fiemap.h: > FIEMAP_EXTENT_UNKNOWN 0x00000002 /* Data location unknown. */ > FIEMAP_EXTENT_DELALLOC 0x00000004 /* Location still pending. > * Sets EXTENT_UNKNOWN. */ > FIEMAP_EXTENT_UNWRITTEN 0x00000800 /* Space allocated, but > * no data (i.e. zero). */ > > FIEMAP_EXTENT_UNWRITTEN means block address is preallocated, but w/o > been written any data, which status f2fs is not supported now, for all > NEW_ADDR block addresses, it means delay allocated blocks, so let's > tag FIEMAP_EXTENT_DELALLOC instead. > > Testcase: > xfs_io -f -c 'pwrite 0 64k' /mnt/f2fs/file; > filefrag -v /mnt/f2fs/file > > Output: > - Before > Filesystem type is: f2f52010 > Fize of /mnt/f2fs/file is 65536 (16 blocks of 4096 bytes) > ext: logical_offset: physical_offset: length: expected: flags: > 0: 0.. 15: 0.. 15: 16: last,unwritten,merged,eof > /mnt/f2fs/file: 1 extent found > > After: > Filesystem type is: f2f52010 > File size of /mnt/f2fs/file is 65536 (16 blocks of 4096 bytes) > ext: logical_offset: physical_offset: length: expected: flags: > 0: 0.. 15: 0.. 0: 0: last,unknown_loc,delalloc,eof > /mnt/f2fs/file: 1 extent found > > Fixes: 7f63eb77af7b ("f2fs: report unwritten area in f2fs_fiemap") > Signed-off-by: Chao Yu > --- > fs/f2fs/data.c | 7 +++++-- > 1 file changed, 5 insertions(+), 2 deletions(-) > > diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c > index 359de650772e..3afc9764743e 100644 > --- a/fs/f2fs/data.c > +++ b/fs/f2fs/data.c > @@ -1995,7 +1995,10 @@ int f2fs_fiemap(struct inode *inode, struct fiemap_extent_info *fieinfo, > } > > if (size) { > - flags |= FIEMAP_EXTENT_MERGED; > + if (flags & FIEMAP_EXTENT_DELALLOC) > + phys = 0; > + else > + flags |= FIEMAP_EXTENT_MERGED; > if (IS_ENCRYPTED(inode)) > flags |= FIEMAP_EXTENT_DATA_ENCRYPTED; > > @@ -2035,7 +2038,7 @@ int f2fs_fiemap(struct inode *inode, struct fiemap_extent_info *fieinfo, > size += blks_to_bytes(inode, 1); > } > } else if (map.m_flags & F2FS_MAP_DELALLOC) { > - flags = FIEMAP_EXTENT_UNWRITTEN; > + flags = FIEMAP_EXTENT_DELALLOC; > } > > start_blk += bytes_to_blks(inode, size); > -- > 2.36.1