Received: by 2002:ab2:3141:0:b0:1ed:23cc:44d1 with SMTP id i1csp293lqg; Thu, 29 Feb 2024 17:15:40 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXACA5gw7p21PTaUsk3lwsoJlbXAV7/29u1o7WKEHTfMxWzkB9IoVzEqjBjOxmXZS/c6x8bsJCj5oWL1RTlcy/g0bqOGcjypwcaL2LwqQ== X-Google-Smtp-Source: AGHT+IGvfWRAv1xOftWQ948sap8I7VVlVBcxmGxKEu5VKnQidnLnt+Xi1HO1hXHnAmriXXscIaqS X-Received: by 2002:a17:902:d58a:b0:1db:de64:97ac with SMTP id k10-20020a170902d58a00b001dbde6497acmr314079plh.15.1709255740293; Thu, 29 Feb 2024 17:15:40 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709255740; cv=pass; d=google.com; s=arc-20160816; b=fSkY/HkmxyHrRpIrv4ao1+84Aelq6d+4qLkvjtdSp0gJ96xLdsvfmMnJypQJ5NZf6K 4s+D1ZGMIdb4FVMmIPzGIlgKecdUCP0z10NneDR7tm4XAU0BQg/uTwp/pM6eknAtRKmz xon84h84L82XqbzGITvkffSnoen61M7VNNcg/xeJ/412DJOvXnHRt7PQJn1n0bG5MJFB zl+OBgtsskI7ZYfIkVye2zx42S+DBamKsne1DQsLV6u24DYDxpCMairPMM7f5JN849mB SF+uD+YPYV+MNQ782tzYbHv37e4G9qqnYCNEqAZHAMLu+cKx2BspvASFp0+Nnul0qoM5 7RoA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=Os2ZvJodebo3c52WwXjV1O0ecLUEXayLgMCnTR13i/0=; fh=W6COFBd4BX4Q4YpnsinfP4Lifuq45kIfChsHXFM1YEQ=; b=Bf/emUg83BgWv2x+oPiu7lRE/QoXzOjnkL5QwN90/FcgI9CzOMWK0UvoxDqzHm1xLH VWpmTf0nmCVmnwm01PiBtobFTgOgRRDfTAj2CY7JEd96a2hT+lnl3ntVL9Wg3oiZ4JZG PHyChCBvUgqhNI5VXcBXGl4MnJiB3my8YRuZiqiXjSAhGc54DjdbdJp4mAJC/0F8S+lB +Xcvoz8mdf5nKIhdn9LhmBZYUsQuPa+X6f7c34t9VLwZ9NBQt8CjaMwzJSAP1s5r5OCw /sjPrs/wQQlnTeksOedak9T6MeKGghxByNkh5HEjDHSy9esbh8+3qo2C3y20UozNT8Tb zqfQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=MaRpmYTF; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-87756-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-87756-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. [139.178.88.99]) by mx.google.com with ESMTPS id c9-20020a170903234900b001dbc739f470si2495398plh.480.2024.02.29.17.15.39 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Feb 2024 17:15:40 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-87756-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=MaRpmYTF; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-87756-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-87756-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 D8451284F28 for ; Fri, 1 Mar 2024 01:15:39 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 47FBE2B9CF; Fri, 1 Mar 2024 01:15:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="MaRpmYTF" 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 7106D1FAB for ; Fri, 1 Mar 2024 01:15:36 +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=1709255736; cv=none; b=N0z9/MlTs9l7W1fDQMgeZY2YNd0ce/MshafD67/N6Bsgup2zgM1f5cpLeIjUkjJmCAT7HBKsOb/kOPcngBLIl+KEnhNClrChDF1+yR0VrKA5V6QESk/QnIkaIr7Uo5SAZHQdirF7oFmxtMyLXuz2x3c3wHOmQT0fYXjpBo7tOOU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709255736; c=relaxed/simple; bh=C93BUuyWefWIHd961kpiGpVzFvnTiGjz9VvWBdFszQk=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=aXT0LO+TLQg2vBqdJ21cmltx6ePB+375m2PtqlC1LxzEz/VeqW214ZwmcCTOL3rem+Iv0k4wo5FFeumWH/52R1AoFk/C3eXfIb2FkX6njrFOfySQMBpXIZ3XbaMI2VdouL4Qfr3ovGrlTZrJzWklgbMqo43XeO5p83vXn9Hgxu8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=MaRpmYTF; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1C109C433F1; Fri, 1 Mar 2024 01:15:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1709255736; bh=C93BUuyWefWIHd961kpiGpVzFvnTiGjz9VvWBdFszQk=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=MaRpmYTFVIE6Vs0hf2Kj+mp1qbjMPivsvKxvSqSUTptitSMJcCbTI0czh+6c1bGTV 1RZ4kQdDOOPIEpsjZsC7O9clv1XikchBQofj3NCc1ikXqh7AiUNAsTEhXhhRqmSS9X 06waoeyn/L3jJoL5NCYmUgI8X3LgDmN5gU2qfMxlHZOmuhIFR0lDCeYGNZeh6NfGVq LSe6QE+hODlXtat+nocTvJKar3VXA9k/5IooxyZ3b4y6aFy248xvi64U1hGL+FE+eW zPsCxCGaujHoGoMxesj+rZp3N0X4yVZk7aoYuiHCu/UQx3hzc1t+mZJbtD9s9Hbcxi P69kJkQHj6VcQ== Message-ID: <356f3dfc-1dff-45d1-862c-4784af763b14@kernel.org> Date: Fri, 1 Mar 2024 09:15:31 +0800 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] f2fs: fix to do sanity check in update_sit_entry Content-Language: en-US To: Zhiguo Niu , jaegeuk@kernel.org Cc: linux-f2fs-devel@lists.sourceforge.net, linux-kernel@vger.kernel.org, niuzhiguo84@gmail.com, ke.wang@unisoc.com, hongyu.jin@unisoc.com References: <1709121594-22314-1-git-send-email-zhiguo.niu@unisoc.com> From: Chao Yu In-Reply-To: <1709121594-22314-1-git-send-email-zhiguo.niu@unisoc.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 2024/2/28 19:59, Zhiguo Niu wrote: > If GET_SEGNO return NULL_SEGNO for some unecpected case, > update_sit_entry will access invalid memory address, > cause system crash. It is better to do sanity check about > GET_SEGNO just like update_segment_mtime & locate_dirty_segment. > > Also remove some redundant judgment code. > > Signed-off-by: Zhiguo Niu Reviewed-by: Chao Yu Thanks,