Received: by 2002:ab2:6857:0:b0:1ef:ffd0:ce49 with SMTP id l23csp2476182lqp; Sun, 24 Mar 2024 22:29:54 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWUEJGohe7uhQVOgvY8/5AIw8WEAshUKKiunJUWjCwynyPSb28r4/7xm+DRo7aQfM67uBclikkZkGzn35RWo2Mr9MiU8RBC1ABMpQbcdQ== X-Google-Smtp-Source: AGHT+IH1J6GjTPmLT+/ZqoAMFezA/S/gSj0nY5eRZP65Pa2549emd9xXpL2kHPfUsBvAwj78aqyc X-Received: by 2002:ad4:5ce3:0:b0:691:6003:b835 with SMTP id iv3-20020ad45ce3000000b006916003b835mr10073303qvb.18.1711344594622; Sun, 24 Mar 2024 22:29:54 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711344594; cv=pass; d=google.com; s=arc-20160816; b=YqOFRB8otONnwB2OMPRG6bS5QvUKJBATAjLnePg2zm0nc7ZF/E4uo2K+EC3Is+JBF7 anzB8ZUhf6MDJCGt7kzJyQdCwMB+pFZYwjAdRyxQU5gKhlc3Pv8JHVt1mdMpTJFXzslB v0CVyRbu4jHu4f3h0zdcBo83JuK4/FIeH32NMGC7MUrgN3lNSWiiBywMe53k+RTi64iH oyVNjJZVjzAjEH7BT3s/v0pVzeXb0OMad1WadEBwL1zy0okhMFzNk6/WqPU2wn3Fcqi4 RIIWXGdMa6aICdrPcYpgu/TdekBAAeTz2Kl9yIiH5ddQgyjVFMuyGj+t+rrALItaciuc HRbA== 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=mFO4DRed3EBcnEcF1cdNHYCr2HC1MuPbig6sHV23rYE=; fh=j/x7sSRnXo0LaHT7QL10tuC6FCXce9x5R+7s6GpGj34=; b=jdq1YTfzsvgERKTE2/+xPUlacYBOrbFjM2xQPvbif+LtURbUWHv8rhf80vOti4LJDw 3u6hurCHrOAYFI69o+Gg6bmRhtw3W51b9JOvkr9LM+8YW5YlUX8ZltG1qW/bpDQDsB5b 50zdmz3ysi/KeNxhdtUkz+t4VvQSh4t8XKyWP/zHFAtvggt9Yf49BJgZMPEpBpq278Zr 1rvpCj98EOI8/oKwHwIckmPMhABvmJjgiUawxTRmo8QEgh5qqb/c+GWyIxnAOyql2Iuk 0+5ypC+o0PpoHYqu6QsMg7TZx5cTSana9bwf1xRn0VuVi2vycKg3HlY7KpcGroyTiZpO MI8w==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=o6JxXBvt; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-113920-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-113920-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 jm14-20020ad45ece000000b0068cd9703420si7163731qvb.332.2024.03.24.22.29.54 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 24 Mar 2024 22:29:54 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-113920-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=o6JxXBvt; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-113920-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-113920-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 456AD1C2AE2B for ; Mon, 25 Mar 2024 05:29:54 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D2314214113; Sun, 24 Mar 2024 23:08:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="o6JxXBvt" 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 801A01EE687; Sun, 24 Mar 2024 22:56:53 +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=1711321013; cv=none; b=eKCcZsIfNsM8+Nre0ve/zrZe6QLefq9R4FixVclloprAy93EznmRFGE5oYHn1374wS+Mlp5f6BWhXFavk9Gzq464/ToRwcA/V1wozHYm9X9gLQLaKEZ6YlnwyygEDx0YfpEMfqGGf6t4aHBOoRiWn7HeEBM2L0e5ZqTBLRx0xQU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711321013; c=relaxed/simple; bh=sc48ERtTTU0b8gYTul/PEN+dkQ0Jo7sKqaYgyeRyucg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=gKpTnV52BflJLcdyzGmtQ5mWzBvZPCN8pe/ZwW24OThAK0UHKLIpHkWepmWPaAcxwjjxHO3J3Vk5xWGtX+uQUz3amOFrEb37Tojo8hwtZ3pw97i7oLc0DIyEJNxe3tTLLuR434OyxXbv9sxY+jUUhDmYp+4iw5FzupFnQut2zJE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=o6JxXBvt; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id A64E6C433C7; Sun, 24 Mar 2024 22:56:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1711321013; bh=sc48ERtTTU0b8gYTul/PEN+dkQ0Jo7sKqaYgyeRyucg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=o6JxXBvtxQX+Y/H7UzNDmejEhPuS/g48I8LIZGkKAKcbLEFtG1orPs86Yp8rjCHRk 7y84BpIJQySTyyP2+UpCu2rE6Sjy5aDx5aDdNfAG4/UKmttnlTA1Q6Q6R5ppAHoc7w 2TcNQwPdvav7JiSTwWOPKZHAUH9PMpEPT4H66QUwRW8/0ao5r8H3EU6AF33BHhB5BY CvSY1F7pGQ7E2/6M5E3j8N3ZQDjqaQzz5jNVNYd+qGWR2l5h8yu7p/NVhyJC4VhECM tQzlUXhA1JpkeuR2VKZ6gu9Q4zFyt+yuzbWKw8Ap29thDuecYM4SdYLYVYqk7zt4Gt x3VHg1IfvieIA== 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.7 576/713] f2fs: zone: fix to wait completion of last bio in zone correctly Date: Sun, 24 Mar 2024 18:45:02 -0400 Message-ID: <20240324224720.1345309-577-sashal@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240324224720.1345309-1-sashal@kernel.org> References: <20240324224720.1345309-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 41091287f5439..cd9f1c6039c49 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