Received: by 2002:a05:7412:d1aa:b0:fc:a2b0:25d7 with SMTP id ba42csp320395rdb; Mon, 29 Jan 2024 03:28:28 -0800 (PST) X-Google-Smtp-Source: AGHT+IE3xy7Dtei1igqDYocW+dTRLClOcLGNNUdbgmIpceP9box2jQAIza4cMHAptCae00yfbAUe X-Received: by 2002:a05:6a00:3d15:b0:6da:fc2b:5a88 with SMTP id lo21-20020a056a003d1500b006dafc2b5a88mr4843922pfb.15.1706527707890; Mon, 29 Jan 2024 03:28:27 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706527707; cv=pass; d=google.com; s=arc-20160816; b=RRcPQCjwmO1n/y0GQdD1Y47VCoqqrhlNHjRICdH3Z0wdRgTp+I48D9JRCX9rnzZmrc DU9bS1nK+qyF/V+meQ+2g70nVUwMp30+uUIusXUIVFHPIgU5+tP5WFmgabZ7ZkXXZT6z qFu5tIvmvs7WicbOOarkhKcvjXwyonWzsrSSJ1H5fuxgbVHA2chlP+mgrPOZ8SRLJ8MM LDjprN8p7Vgt2AmrcHgsbcwRhKeyRM5f+u3hHJJLWUElyUJhxcxlTlE2cUd54NziD+os 6GCH1HHeXONH0EXTNeaNTJlS1xmvrJ7hhhbia6+sK5PxqSBV9ISR/1w17cP7eIb/FObF Jl/A== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature; bh=Fh5OzlMbfiE5vdb/EO4Ei2S0zKYcBbzdy+KecbYhNXE=; fh=3gbPhre1OB9gPaTtmCq689W9XI462kLAqPsb9Z8n0A8=; b=oxlJfTu/hUl1SewiQI8Xk48U3PJ4m6cPpRD31DiyG+Ez7FLkLc7Bh0mr2IB0SWFE0r Jh57Ed7NKii2gAY+KOiTRaE8q0GHwdafs8PjkosyelE4ErAB7H6GVeOw1r2IT8d3r4Bc iRANHJQgl+nGrrlWjDJrGJ6SdqKm4+h4TbgxNbmV1dslHGzsWlxtnmJqTjhl7OpJicaj hP75W5MD1zFvAE1PReqq8jpy3Nt82X5JSoqR1r6sPfCtwKtgQTST5WIJjWJ6WJ44hSIj UXw3SHQl7P31HhK9qaee/ZTco3yVwFI4u0NAd7K1A1uzJGlUoLCle0qetyzs+yCELnN4 ejXw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=N8fAALCA; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-42612-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-42612-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id ln12-20020a056a003ccc00b006ddc03c4266si5531216pfb.152.2024.01.29.03.28.27 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 Jan 2024 03:28:27 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-42612-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=N8fAALCA; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-42612-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-42612-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id D024E282C03 for ; Mon, 29 Jan 2024 11:28:00 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 6AED55BAE7; Mon, 29 Jan 2024 11:27:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="N8fAALCA" 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 838BE5BAC0 for ; Mon, 29 Jan 2024 11:27:52 +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=1706527672; cv=none; b=HhRHuycmRuBYGKLJqQuOdtmX76Y/ZyWcGFYDVDgGyhioK5VmLfiW/YZMeMKn+7ymOCGWi9q6unInGcTXSWPNLi3IEB1huOAmTpIKTECo6Q1oieR+RGCRvCP0C8fj/CAks28JimM216R9NyAGcq1bKbeQTAxoT3GTu3OuRxVz45c= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706527672; c=relaxed/simple; bh=K+SoEOU6xu54KZgacf/5Gi6Jlpq+URdws/owLbfDtyk=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=Rrdh0SsAj1e8/7buMuJh15mXpHDoMZnXsaDAdsXsK25MnG+Rhqbju/4sMFfWUtPpJPoUaI0suidjXmQ7p2Ug9lp/QTxJRPQod1W0qOabiPNnhQ4wScFUocWUktY+OPkpm/HrEL88GF8ABeD2+9x22B9cIVOI9F9ZtPdJtf1rQvc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=N8fAALCA; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id B2A2CC433C7; Mon, 29 Jan 2024 11:27:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1706527672; bh=K+SoEOU6xu54KZgacf/5Gi6Jlpq+URdws/owLbfDtyk=; h=From:To:Cc:Subject:Date:From; b=N8fAALCAOzGymJZPOGyuPKdywZ0KLY/CSMt6p06Q9Bbrmk6oDIyrzEcXpTGJmhuGj tED0fFlgYtd4ws09ioEWHM47oJoVKdEcfpZD/LrWzbp/TvPjhkC7ZgAcMhVLr2RVLY j28kR4dgZIV6pQbimFWM4cR6mDMHioxsf+p1GLheWLyKUreMLC8z/8wtPhwiJxgvkZ ExRyyIxF5zXCh4d21vlAYesFzpRCKrqTruKTIOZPfi1ow7bZMAwsD3K2waD3w9qCA0 frhZFsB96kX5eFFl6mN0k9i0Ja/+N8NH0VEMmkvn92HqpPcWXALHye47KkfN9AZysD HYsl+FD2PsJrQ== From: Chao Yu To: jaegeuk@kernel.org Cc: linux-f2fs-devel@lists.sourceforge.net, linux-kernel@vger.kernel.org, Chao Yu , Daeho Jeong Subject: [PATCH] f2fs: zone: fix to wait completion of last bio in zone correctly Date: Mon, 29 Jan 2024 19:27:40 +0800 Message-Id: <20240129112740.1908649-1-chao@kernel.org> X-Mailer: git-send-email 2.40.1 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit It needs to check last zone_pending_bio and wait IO completion before traverse next fio in io->io_list, otherwise, bio in next zone may be submitted before all IO completion in current zone. Fixes: e067dc3c6b9c ("f2fs: maintain six open zones for zoned devices") Cc: Daeho Jeong Signed-off-by: Chao Yu --- fs/f2fs/data.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c index f45ecb810ae6..8cdbc5ae44db 100644 --- a/fs/f2fs/data.c +++ b/fs/f2fs/data.c @@ -1006,7 +1006,7 @@ void f2fs_submit_page_write(struct f2fs_io_info *fio) f2fs_bug_on(sbi, is_read_io(fio->op)); f2fs_down_write(&io->io_rwsem); - +next: #ifdef CONFIG_BLK_DEV_ZONED if (f2fs_sb_has_blkzoned(sbi) && btype < META && io->zone_pending_bio) { wait_for_completion_io(&io->zone_wait); @@ -1016,7 +1016,6 @@ void f2fs_submit_page_write(struct f2fs_io_info *fio) } #endif -next: if (fio->in_list) { spin_lock(&io->io_lock); if (list_empty(&io->io_list)) { -- 2.40.1