Received: by 2002:a05:7208:9594:b0:7e:5202:c8b4 with SMTP id gs20csp1083305rbb; Sun, 25 Feb 2024 19:26:02 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCU9cHBYv1zqRyoX8vumaV3CkP2h/R8bw4GiFVwVXm8B67HK3jWnlWaK8Deu6WhKqOksnS4HE9M/xjkPu3+DaamPURftGZzl+OUNApB8/g== X-Google-Smtp-Source: AGHT+IHdb9S4lDv2oLmgzwsI+7Af7jrzOWIZtDel8kLxX7pb17nXHIOAajlAEUTXB/ARcFVd7bCd X-Received: by 2002:a17:906:f2cf:b0:a3e:4576:b25a with SMTP id gz15-20020a170906f2cf00b00a3e4576b25amr3299800ejb.18.1708917962471; Sun, 25 Feb 2024 19:26:02 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708917962; cv=pass; d=google.com; s=arc-20160816; b=vVmDlscECfhVEvW5nsKt8VW/YZPiDpRpcRkTnNZ0Jz5Vn+02RChrW0rv2sk5d0bFvR 3Lutt/iwpzlCm6M6H812ebaspyG82aLG/kq5S+UK5MBiJv+4ESeajduSb1CYqgpIWWdr E7eGI0TgoVDnTtbfzzWAxD8G7aoLL3YyCHt8GqqQOUGbk4Z+GIjCHuQhzIgDE9i+DKuN D6KFXzCBtNQuCcVKsdkjRt+EaQQelyrEIZtsaXrfbM7Hpaa2IKZz7VYSyWS+M6Zy2V9H UEqyDHc+sdgqZ/sY8EZmIqFbkTp5DRgXrqmuJ52X2K1Zd0bH2hNfFSYsnjOn7XoF2k5c 7kBA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:dkim-signature; bh=jv+mmadT0JQ+7Y3ValYOoMlPEhfNnmPZVmHayZdTOLM=; fh=G9Ja/VoXv3WJotLzwrvu1YI19xnky/6cciFEMW6+++k=; b=uduoZsr2U8wbmt7tkfmpBgW0sNhgYe7PveHO4EmsvRJ7TLQokfqFP5Ad7PSsfGLwCt AvjLf2GRP34Q5A1MjnrhR72xzAvqTfzOocXkbXUEQlRePhv1AR/vjdcy52HadXp2S+Rv xS7eMpgcfyfztZVJcvCIoqJs6lqyPInAOdotKdp1i65EcbyHVtiKK9oOj4TUwJVPcaJ4 hrC0xPPokMMYvFrbloincTMFVSrvnoaF9aXNvvlrInLxP+yI3kvfDnd2VHGkaD4BzbJc GQnZ7Vg/9GUeL776JfgLEoN1b6BZqJaeNJgoB7HqUX216tx5KVrZyU+fTgz2skt0lFZi XGzQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=XmKKdgaO; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-80467-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-80467-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id jo23-20020a170906f6d700b00a3f119048fasi1698366ejb.104.2024.02.25.19.26.02 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 25 Feb 2024 19:26:02 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-80467-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=XmKKdgaO; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-80467-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-80467-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com 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 am.mirrors.kernel.org (Postfix) with ESMTPS id EDAD41F21366 for ; Mon, 26 Feb 2024 03:26:01 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id CF3961401B; Mon, 26 Feb 2024 03:25:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="XmKKdgaO" Received: from mail-ed1-f44.google.com (mail-ed1-f44.google.com [209.85.208.44]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 59C9C817 for ; Mon, 26 Feb 2024 03:25:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.44 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708917955; cv=none; b=BLDjT0bGNDWv6EqXpBY9NjhrXcnngsjCZHIgJeioc8g54HsQMZ3QchMg9pknnMG/RqWoBGoylrC3Zlh/4gqjVFcg3mMZ4aoL4r1Nwwrk4FwtUUnEhgH1DGqjPSxfqpQCiuHOZGahYElJKOgefQ9FTU0Kwd8W8luIkt7j9PqFawE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708917955; c=relaxed/simple; bh=duT572XOOEkkBhzaW7HcX6gYMtYqbYqQiUV3SLf49tY=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=YL9FDEwtwohrIButeRaVj2rFSvlcTIu8HNMQaI1THmGBchu1vVLNwNMLVHi36aX7DOGs7t/B69mA6LwODUtF46NeFprYvhNC4BLkwmAEOa6t2OskdvUOKu+dZijt+51j1otnp5EsEoYGGcjslPq3QnCF8w3EZh+TaAXzvftqiWo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=XmKKdgaO; arc=none smtp.client-ip=209.85.208.44 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-ed1-f44.google.com with SMTP id 4fb4d7f45d1cf-564647bcdbfso2443569a12.2 for ; Sun, 25 Feb 2024 19:25:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1708917952; x=1709522752; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=jv+mmadT0JQ+7Y3ValYOoMlPEhfNnmPZVmHayZdTOLM=; b=XmKKdgaOnWGloUpkG/jg8kIqJTF3YeYydSeiMBw4UwlLNebPF+BAO7KcoUcY3evR/9 Uu4siqcIVGp2HsfZ9fFkXTUdv8DHcVWpP477YFBySeOsllo3hsRQ1L930M1kBlg9V8bD +GjlEJQQe3nkH66hqzkNI/NGGuAnt/hrlYy171zCnxggwhuh0Wsd16p9VOvLYeGabgzZ AyVsloydlLXPE/T6VgXcW68wI5qqAMI9urCbivlQrFhtBH1vRJb/EJrC4spWtUo08cJn Y3a5c8v+0RjP29nBwys70XROmrWkEJvGCwhI9p/xxt/2KD1BiyqtGeCalZhf6hKGJv07 gnqQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708917952; x=1709522752; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=jv+mmadT0JQ+7Y3ValYOoMlPEhfNnmPZVmHayZdTOLM=; b=hUfxka+vmpa1jFK1j8zDwzgzAkpWuzmn8n3b5FOWDWa4/UQLvlbaz/pT6feXaOB7YX lMsjwK4Q+ArgIJuzPZSAG5oY8Xp82/gPB57nvvFL/1r+EVGvFi66we2S8/XzA6pZmyGm qabg2ekUPhMHR0LJG6DjHsWjEsZy7cHeA8FCSTKWlE8dlO7yek2w4XiwKlZjaysZiSt1 aMYK6AbwZuLHN01/gOcBhSkO0t7I2yxtTIith4l5OahhjvYFtaWcO4BGsbz7zQ3Gdetq Yddv0lZH6XnmEvk6rGOYy7jqApMmK8j4Co9ZPx2DZk6a3t4Q3SqDi8fkuG6hFB5ZYC5q IeuA== X-Forwarded-Encrypted: i=1; AJvYcCW4zA4y/rA5xHdloasDMVS5pHby4aGJR1BTf7k+ieVkOznuCEVDOSVRMsb9/3r/2VmMHW42UxYaR0K5Os0uQZgUVbyGO8g5TcpGkdY5 X-Gm-Message-State: AOJu0YyE+/VtjpQ1cI3Y7QLOvsnAZLDxMD/LrhRQX5Ju3Jj3D6yavOES mWtshQKz9Wpa6ZDLuaTVeNyKRghklvlGrRjOR+IgYM/X9XIT/t8tF0ZrqS+JuI+GE5L5QNzUWNf xSjoYgywY2zs8L8rNqnP+VQtDrYY= X-Received: by 2002:aa7:d5d5:0:b0:564:3392:e9db with SMTP id d21-20020aa7d5d5000000b005643392e9dbmr3387824eds.33.1708917951542; Sun, 25 Feb 2024 19:25:51 -0800 (PST) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <1707271264-5551-1-git-send-email-zhiguo.niu@unisoc.com> <88459a22-a21c-4c3d-8371-31d7d713b536@kernel.org> In-Reply-To: From: Zhiguo Niu Date: Mon, 26 Feb 2024 11:25:40 +0800 Message-ID: Subject: Re: [PATCH v2 0/4] f2fs: fix panic issue in small capacity device To: Chao Yu Cc: Zhiguo Niu , jaegeuk@kernel.org, linux-f2fs-devel@lists.sourceforge.net, linux-kernel@vger.kernel.org, ke.wang@unisoc.com, hongyu.jin@unisoc.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Dear Chao, On Fri, Feb 23, 2024 at 10:38=E2=80=AFAM Chao Yu wrote: > > On 2024/2/23 10:01, Zhiguo Niu wrote: > > > > > > On Thu, Feb 22, 2024 at 8:30=E2=80=AFPM Chao Yu > wrote: > > > > On 2024/2/7 10:01, Zhiguo Niu wrote: > > > A panic issue happened in a reboot test in small capacity device > > > as following: > > > 1.The device size is 64MB, and main area has 24 segments, and > > > CONFIG_F2FS_CHECK_FS is not enabled. > > > 2.There is no any free segments left shown in free_segmap_info, > > > then another write request cause get_new_segment get a out-of-bo= und > > > segment with segno 24. > > > 3.panic happen in update_sit_entry because access invalid bitmap > > > pointer. > > > > Zhiguo, > > > > Can you please try below patch to see whether it can fix your probl= em? > > > > https://lore.kernel.org/linux-f2fs-devel/20240222121851.883141-3-ch= ao@kernel.org > > > > Thanks, > > > > > > Dear Chao, > > I need to coordinate the testing resources. The previous testing has be= en stopped because it was fixed with the current patch. In addition, this r= equires stability testing to reproduce, so it will take a certain amount of= time. If there is any situation, I will tell you in time. > > Zhiguo, thank you! We tested this patch this weekend on the previous version with problem, and it can not reproduce panic issues, so this patch should fix the original issue. thanks=EF=BC=81 > > BTW, I've tested this patch for a while, and it looks there is no issue w= / > FAULT_NO_SEGMENT fault injection is on. > > > btw, Why can=E2=80=99t I see this patch on your branch^^? > > https://git.kernel.org/pub/scm/linux/kernel/git/chao/linux.git/log/?h= =3Ddev-test > > Too lazy to push patches in time, will do it in this weekend. :P > > > thanks=EF=BC=81 > > > > > > > > > > More detail shown in following patch sets. > > > The three patches are splited here because the modifications are > > > relatively independent and more readable. > > > > > > --- > > > Changes of v2: stop checkpoint when get a out-of-bound segment > > > --- > > > > > > Zhiguo Niu (4): > > > f2fs: correct counting methods of free_segments in __set_inus= e > > > f2fs: fix panic issue in update_sit_entry > > > f2fs: enhance judgment conditions of GET_SEGNO > > > f2fs: stop checkpoint when get a out-of-bounds segment > > > > > > fs/f2fs/file.c | 7 ++++++- > > > fs/f2fs/segment.c | 21 ++++++++++++++++----- > > > fs/f2fs/segment.h | 7 ++++--- > > > include/linux/f2fs_fs.h | 1 + > > > 4 files changed, 27 insertions(+), 9 deletions(-) > > > > >