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 14463C47DD9 for ; Mon, 25 Mar 2024 03:06:23 +0000 (UTC) Received: from [127.0.0.1] (helo=sfs-ml-3.v29.lw.sourceforge.com) by sfs-ml-3.v29.lw.sourceforge.com with esmtp (Exim 4.95) (envelope-from ) id 1roafF-00071x-0w; Mon, 25 Mar 2024 03:06:21 +0000 Received: from [172.30.20.202] (helo=mx.sourceforge.net) by sfs-ml-3.v29.lw.sourceforge.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1roafE-00071q-2V for linux-f2fs-devel@lists.sourceforge.net; Mon, 25 Mar 2024 03:06:20 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=Content-Transfer-Encoding:Content-Type:In-Reply-To: From:References:Cc:To:Subject:MIME-Version:Date:Message-ID:Sender:Reply-To: 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=s/mTgyc/x/PJOED2DxyGIvurmInOJQW/Y/5HSqBxIfk=; b=kY4NrVwDrhw2Q787w1IqigwanI 3I5GvHncSFt/W+0fmrSy+aa2dZktsuQZlRUHmC6KOrFT+Umh0ecfFDZZuYBTAoqaZN3/X1GiJ56OI 9u5May/Gc2Yu9pJW3qDQqOuUoaEaRuY3io4GpGaXa56rfN60OrbrmQPFmra6OswP1mJA=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:From:References:Cc:To: Subject:MIME-Version:Date:Message-ID:Sender:Reply-To: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=s/mTgyc/x/PJOED2DxyGIvurmInOJQW/Y/5HSqBxIfk=; b=RoMzi0FaErasCrLh9eL7PIcNop bHUihv4X9zPUw9XAqN1jNwBdqHhwuoaTeINkZQs/qoTT2IqkcJtg/hP2ETY5WgvFdqt0yiQg1rJYR F9jJzrGR2j7uEIHdtFCEcW/Z/7mHSiapFwuFSikyaxNrqtcATmh8RPqp7a6pRabw84zw=; Received: from dfw.source.kernel.org ([139.178.84.217]) by sfi-mx-2.v28.lw.sourceforge.com with esmtps (TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.95) id 1roafA-0007H5-QF for linux-f2fs-devel@lists.sourceforge.net; Mon, 25 Mar 2024 03:06:20 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id B638C60C8A; Mon, 25 Mar 2024 03:06:06 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id DC052C433C7; Mon, 25 Mar 2024 03:06:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1711335966; bh=m0pLVWc50tF42FKUpj7r22FDMHA0roMZnY6ibDzMcZo=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=LqAL/54mco4tPpXgGDR4Wrkr9H/RnX6Z5Ghmcek0H1CdYgLTyTXE+o9kKmwRecPXd Q2xmm9MRy4ny7PfZ8e1a7qQcRvsHDOZ4mjfY5Xx0xqVRjyeXT4/1lWe/HbcMg5B1tF 8L11rdjJyfZilO9Xk5Nn3vTjSdcwcgzR4EuKdaRi9ttuRI1Htu/GdH/bftgpzo8lCt d3ENb/kk0psbZlTbXXtlSLr81aPTVT8ILghmHQRrHzU0cyQqgat1095Fgye7pZUYgj 9iY0IFLyhewTbjhKo7XVUgcBLtb9YT7vyh7oUD6toTgDkE5LYoNddW6CNiNrlejhKs 6vzsh/DAozhyg== Message-ID: Date: Mon, 25 Mar 2024 11:06:02 +0800 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird To: Shinichiro Kawasaki References: Content-Language: en-US From: Chao Yu In-Reply-To: X-Headers-End: 1roafA-0007H5-QF Subject: Re: [f2fs-dev] [bug report]WARNING: CPU: 22 PID: 44011 at fs/iomap/iter.c:51 iomap_iter+0x32b observed with blktests zbd/010 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-block , Jaegeuk Kim , Yi Zhang , Bart Van Assche , "linux-f2fs-devel@lists.sourceforge.net" Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Errors-To: linux-f2fs-devel-bounces@lists.sourceforge.net On 2024/3/25 10:14, Shinichiro Kawasaki wrote: > On Mar 24, 2024 / 20:13, Chao Yu wrote: > ... >> Hi Shinichiro, >> >> Can you please check below diff? IIUC, for the case: f2fs_map_blocks() >> returns zero blkaddr in non-primary device, which is a verified valid >> block address, we'd better to check m_flags & F2FS_MAP_MAPPED instead >> of map.m_pblk != NULL_ADDR to decide whether tagging IOMAP_MAPPED flag >> or not. >> >> --- >> fs/f2fs/data.c | 2 +- >> 1 file changed, 1 insertion(+), 1 deletion(-) >> >> diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c >> index 6f66e3e4221a..41a56d4298c8 100644 >> --- a/fs/f2fs/data.c >> +++ b/fs/f2fs/data.c >> @@ -4203,7 +4203,7 @@ static int f2fs_iomap_begin(struct inode *inode, loff_t offset, loff_t length, >> if (WARN_ON_ONCE(map.m_pblk == COMPRESS_ADDR)) >> return -EINVAL; >> >> - if (map.m_pblk != NULL_ADDR) { >> + if (map.m_flags & F2FS_MAP_MAPPED) { >> iomap->length = blks_to_bytes(inode, map.m_len); >> iomap->type = IOMAP_MAPPED; >> iomap->flags |= IOMAP_F_MERGED; >> > > Thanks Chao, I confirmed that the diff above avoids the WARN and zbd/010 > failure. From that point of view, it looks good. Thank you for the confirmation. :) > > One thing I noticed is that the commit message of 8d3c1fa3fa5ea ("f2fs: > don't rely on F2FS_MAP_* in f2fs_iomap_begin") says that f2fs_map_blocks() > might be setting F2FS_MAP_* flag on a hole, and that's why the commit > avoided the F2FS_MAP_MAPPED flag check. So I was not sure if it is the > right thing to reintroduce the flag check. I didn't see such logic in previous f2fs_map_blocks(, F2FS_GET_BLOCK_DIO) codebase, I doubt it hits the same case: map.m_pblk is valid zero blkaddr which locates in the head of secondary device? What do you think? Quoted commit message from 8d3c1fa3fa5ea: When testing with a mixed zoned / convention device combination, there are regular but not 100% reproducible failures in xfstests generic/113 where the __is_valid_data_blkaddr assert hits due to finding a hole. Previous code: - if (map.m_flags & (F2FS_MAP_MAPPED | F2FS_MAP_UNWRITTEN)) { - iomap->length = blks_to_bytes(inode, map.m_len); - if (map.m_flags & F2FS_MAP_MAPPED) { - iomap->type = IOMAP_MAPPED; - iomap->flags |= IOMAP_F_MERGED; - } else { - iomap->type = IOMAP_UNWRITTEN; - } - if (WARN_ON_ONCE(!__is_valid_data_blkaddr(map.m_pblk))) - return -EINVAL; Thanks, _______________________________________________ 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 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CB99026AD7E for ; Mon, 25 Mar 2024 03:06:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711335967; cv=none; b=HQQQpHnFWqmUkX8Wo+0DRUt2Oc7a+qgwARfR26htlZ4XupK2a8hGpzS4cJ0qBp0fcO+UEeQKl4U7v+QfyriptoQolotIJClCoUBf7advBQDHMSHK/fJ5u/h4zz8gdRPwrV7Hx8x/TkJ6OC2WzePKystj8FsXTm0LUVsf9gmVhAE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711335967; c=relaxed/simple; bh=m0pLVWc50tF42FKUpj7r22FDMHA0roMZnY6ibDzMcZo=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=ZaZ0NaGVaN4zGqXFuOCo2xW5OjOw9M1jwukr6DJ4b6gkTEnQCoaMvBeCJLOyzwvho5bxLGXjAPtkrTZiwwmcK9MIiGCY2cR1RfJ+9D3d+86NgSp3xclcJkruq3lApZeBXdpJcO+KlLb4yJAWtFSHsVWEuYxKHY266q9dAWqGnjo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=LqAL/54m; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="LqAL/54m" Received: by smtp.kernel.org (Postfix) with ESMTPSA id DC052C433C7; Mon, 25 Mar 2024 03:06:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1711335966; bh=m0pLVWc50tF42FKUpj7r22FDMHA0roMZnY6ibDzMcZo=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=LqAL/54mco4tPpXgGDR4Wrkr9H/RnX6Z5Ghmcek0H1CdYgLTyTXE+o9kKmwRecPXd Q2xmm9MRy4ny7PfZ8e1a7qQcRvsHDOZ4mjfY5Xx0xqVRjyeXT4/1lWe/HbcMg5B1tF 8L11rdjJyfZilO9Xk5Nn3vTjSdcwcgzR4EuKdaRi9ttuRI1Htu/GdH/bftgpzo8lCt d3ENb/kk0psbZlTbXXtlSLr81aPTVT8ILghmHQRrHzU0cyQqgat1095Fgye7pZUYgj 9iY0IFLyhewTbjhKo7XVUgcBLtb9YT7vyh7oUD6toTgDkE5LYoNddW6CNiNrlejhKs 6vzsh/DAozhyg== Message-ID: Date: Mon, 25 Mar 2024 11:06:02 +0800 Precedence: bulk X-Mailing-List: linux-block@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [f2fs-dev] [bug report]WARNING: CPU: 22 PID: 44011 at fs/iomap/iter.c:51 iomap_iter+0x32b observed with blktests zbd/010 To: Shinichiro Kawasaki Cc: Yi Zhang , linux-block , Jaegeuk Kim , Bart Van Assche , "linux-f2fs-devel@lists.sourceforge.net" References: Content-Language: en-US From: Chao Yu In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 2024/3/25 10:14, Shinichiro Kawasaki wrote: > On Mar 24, 2024 / 20:13, Chao Yu wrote: > ... >> Hi Shinichiro, >> >> Can you please check below diff? IIUC, for the case: f2fs_map_blocks() >> returns zero blkaddr in non-primary device, which is a verified valid >> block address, we'd better to check m_flags & F2FS_MAP_MAPPED instead >> of map.m_pblk != NULL_ADDR to decide whether tagging IOMAP_MAPPED flag >> or not. >> >> --- >> fs/f2fs/data.c | 2 +- >> 1 file changed, 1 insertion(+), 1 deletion(-) >> >> diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c >> index 6f66e3e4221a..41a56d4298c8 100644 >> --- a/fs/f2fs/data.c >> +++ b/fs/f2fs/data.c >> @@ -4203,7 +4203,7 @@ static int f2fs_iomap_begin(struct inode *inode, loff_t offset, loff_t length, >> if (WARN_ON_ONCE(map.m_pblk == COMPRESS_ADDR)) >> return -EINVAL; >> >> - if (map.m_pblk != NULL_ADDR) { >> + if (map.m_flags & F2FS_MAP_MAPPED) { >> iomap->length = blks_to_bytes(inode, map.m_len); >> iomap->type = IOMAP_MAPPED; >> iomap->flags |= IOMAP_F_MERGED; >> > > Thanks Chao, I confirmed that the diff above avoids the WARN and zbd/010 > failure. From that point of view, it looks good. Thank you for the confirmation. :) > > One thing I noticed is that the commit message of 8d3c1fa3fa5ea ("f2fs: > don't rely on F2FS_MAP_* in f2fs_iomap_begin") says that f2fs_map_blocks() > might be setting F2FS_MAP_* flag on a hole, and that's why the commit > avoided the F2FS_MAP_MAPPED flag check. So I was not sure if it is the > right thing to reintroduce the flag check. I didn't see such logic in previous f2fs_map_blocks(, F2FS_GET_BLOCK_DIO) codebase, I doubt it hits the same case: map.m_pblk is valid zero blkaddr which locates in the head of secondary device? What do you think? Quoted commit message from 8d3c1fa3fa5ea: When testing with a mixed zoned / convention device combination, there are regular but not 100% reproducible failures in xfstests generic/113 where the __is_valid_data_blkaddr assert hits due to finding a hole. Previous code: - if (map.m_flags & (F2FS_MAP_MAPPED | F2FS_MAP_UNWRITTEN)) { - iomap->length = blks_to_bytes(inode, map.m_len); - if (map.m_flags & F2FS_MAP_MAPPED) { - iomap->type = IOMAP_MAPPED; - iomap->flags |= IOMAP_F_MERGED; - } else { - iomap->type = IOMAP_UNWRITTEN; - } - if (WARN_ON_ONCE(!__is_valid_data_blkaddr(map.m_pblk))) - return -EINVAL; Thanks,