Received: by 2002:ab2:6857:0:b0:1ef:ffd0:ce49 with SMTP id l23csp2396639lqp; Sun, 24 Mar 2024 17:41:17 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCU5K+Sd73iA+YKTrMGAkmBmc+calg8l5K+53fLveQ3azxvVtZouzoFVKpi3QSEm/AcWcpfCroPcBAoGiuWkHHx3NKQtNrvu/uuQCpjaTQ== X-Google-Smtp-Source: AGHT+IGgV1C4fSSk1j0eFZ1ehSCGAltnscUksRfWRdApis9mQGZsYaIAEn/Hpdxhn63ptl+dP10G X-Received: by 2002:ac8:7e96:0:b0:431:46c6:df2b with SMTP id w22-20020ac87e96000000b0043146c6df2bmr5799144qtj.1.1711327277667; Sun, 24 Mar 2024 17:41:17 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711327277; cv=pass; d=google.com; s=arc-20160816; b=cVh4jMU4dOcJPCYb8YSvPU1meR7ohVH2hb2v3YWuV8uSykbIY8GB5n+dOOA7QyXXnb /ELMXPMCEF88hbQt2O1g1171ApsZs9T9sCbDgVycvxeLtwCmnLXXQKsgulBmTqbFS/o6 Re427wAdBL+kZZ/4H0bBPK+kmQ4GYR6P0rwfAXuFdpcs28tqdVfOZJaNi0CDvyNB0C28 d9yG8hhSaSBn+hep883eJ0R59ThI33vbbofAwElnf/mFGFy5+yRy6jR9Q4AY6c1dCn/D unFl8L9XYvMD1bEG7V8q6PZ11SyTabMyPHhQx9mIlJhhyCJPsTSS3kNKxqt1xiyYxogA vm0g== 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:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=D7zZb61pXASq66CslDnzpGULvsO93nHdPTw1RiZpmVs=; fh=j/x7sSRnXo0LaHT7QL10tuC6FCXce9x5R+7s6GpGj34=; b=BaTZN8plwKRLIA8HYyasuzlVABDFC46eq7f4nTJqZAduBqDESo+6OJ8G0E7V4ZNwbH phSHuOuEeffKA4EJil0DCd/YAK86p9EYawDJR702QGvYsVhR0vvWISD+127X84Vc0A3E tGqW1DkXyDSr9RHVG7cRjSust8T2bUZRMyPEEdmGPMAt07k26WG5ffT0cYNDX7n/7aVv VYlPG+aDAhE+O+FrlIQP9zhK6xGgkOpLwmDpKWtgTtU5MrExOpUHIz2FYoxEijPh4Zpq lts5OsnuuggqGN4McXEgc/OVRDOrvrz+rXKsRcE8BJaiWhi6NuD9zt4RaRFKfx3mzupU +9pw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="QrtLL/hW"; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-113455-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-113455-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id b9-20020a05622a020900b0043128573ec1si4369096qtx.493.2024.03.24.17.41.17 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 24 Mar 2024 17:41:17 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-113455-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="QrtLL/hW"; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-113455-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-113455-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 634561C23D80 for ; Mon, 25 Mar 2024 00:41:17 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1E35F1B05E6; Sun, 24 Mar 2024 22:44:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="QrtLL/hW" 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 34F171AFCEE; Sun, 24 Mar 2024 22:44:16 +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=1711320257; cv=none; b=Vs78LUBTzwdX8JjLT4PGBSJZsW2avZ/Inz9xpno0RwoPpff/IYbvaK7KpNwzocBqwRxknI2n2nDt5khQEfYdcb/AVgWBd4nF6ycYtKcrFk9nYBMTCfb5nt9EABhet2n226tk+N/sKC7n7KpAXC+s+QS/4F932AMef8orl5baGDQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711320257; c=relaxed/simple; bh=WB7D8v23obP/TjwQh7iM+gl7QpnCg9eEFLWDW9/GHMM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=QdHQqf/u8ja83zklCQwrAXBgON2dwDv8Y8CK6cRYHKSy2trdcHplNz/ihr8iDhd9DhrZu0cVC1XCrwiiO6fJx9i4j/IYTKc8G/xqyJkdYpWZlfWXWsOnl1dwPQOF6N51pWc3R3gdvQngdgXMttBKGNSp6cT7zxipsHkFJGiRFpY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=QrtLL/hW; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0FD1FC43330; Sun, 24 Mar 2024 22:44:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1711320256; bh=WB7D8v23obP/TjwQh7iM+gl7QpnCg9eEFLWDW9/GHMM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=QrtLL/hW0LIxFVFHqAu6A3bW7xtX+OQmZbsUIV9etrXnXsqBpkUC77+NQ3u/VPcda jjBFPVcahbiHosYagc67fcGXJI6vXpzjkikDj4vY9azxUJjuwPdYYCV2iMvvu6JMxd kW04QkVon8ZorHyOq/FPkYyB496IEuvkchbPGfWm6GF6ZEnGeFnpdKc+mUXWHEWWK2 uGzg0B02VOTE5YKqONEWj1EoZRQPd0z7Up5Xvhp+d3MJxhbmsPKvNjzWSZxbepPQkk jc6Foj7wyOIKgYkzU5FswsWMhN5ftb6Qkotg/1AdjOXA20mvhd8UGPkUCs1DSX97jX lXAHVe3ry4FWQ== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Chao Yu , Daeho Jeong , Jaegeuk Kim , Sasha Levin Subject: [PATCH 6.8 564/715] f2fs: zone: fix to wait completion of last bio in zone correctly Date: Sun, 24 Mar 2024 18:32:23 -0400 Message-ID: <20240324223455.1342824-565-sashal@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240324223455.1342824-1-sashal@kernel.org> References: <20240324223455.1342824-1-sashal@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit From: Chao Yu [ Upstream commit 536af8211586af09c5bea1c15ad28ddec5f66a97 ] 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 Reviewed-by: Daeho Jeong Signed-off-by: Jaegeuk Kim Signed-off-by: Sasha Levin --- 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 65fe48bb17d16..ac82e69a9f5fd 100644 --- a/fs/f2fs/data.c +++ b/fs/f2fs/data.c @@ -1010,7 +1010,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); @@ -1020,7 +1020,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.43.0