Received: by 2002:ab2:6816:0:b0:1f9:5764:f03e with SMTP id t22csp874023lqo; Fri, 17 May 2024 04:28:20 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWynGJDpZCbAUXutcN9s5qhDb0HPzu909kMljsGmtLHP+Di5xgXjDulKzFQgf71NM/jQdtnb1xAn7kghgGol22z9zZBEGu9VHClhe82BQ== X-Google-Smtp-Source: AGHT+IGk5PPB7zPMy/9TMDYZ6BHoDgwmECTSdPlc3JukuhBZD56TfS6zh5PaIgFIKlD2+PHs0UXx X-Received: by 2002:a92:c26b:0:b0:36c:d3a:36ce with SMTP id e9e14a558f8ab-36cc14f7c80mr270415875ab.28.1715945299821; Fri, 17 May 2024 04:28:19 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715945299; cv=pass; d=google.com; s=arc-20160816; b=Mum9lTWvsLNZT0nIowlT2CFkJanwa+pMdY62FDBrnIcTZJopMOh1q2YQowruS9+VDe O1Crv4WZiavkqCOXjSuFfrrjQrtfLW1+dtR7xlAItxI0DdpRB3tE3F1OWXuL4fFUE5Ge e93mLkrwh93ACSz4PYFYaI0FJfxtlwj9fcA9M3NcEJeGkJAzD2lbLBwEjF6g9AdhhPS7 6D4JJKNP6mwBN4TDH40MPWAUtPrJ6Y24IdIfV3FmSn5wIyqquJFSM2nnH6R5Ril47thZ EyJ6S0szV6RejPbS2pdZ28Olu8rzRJmLABTLGqbqC4oVSfPMXinYRT+YSl9CsTJJj5lC SYlw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:list-unsubscribe:list-subscribe:list-id:precedence :message-id:date:subject:cc:to:from; bh=jv8cVr1368WUcWefUzbz/93iDXCRiDPYaAXGOZHgLZA=; fh=FjGUeRKuY5Vkps/iCklb/wXg4EmcfkRK+rw0nvXgsb0=; b=s8xUO6J2pvxZh341xFNWEMz/gOiZn+ys+aP+ZqU0oCrnz50XY5lwk9/VaQ+yKkznHx dy9323lUDlW0oXsy6tDxIMnHbjCCp8UT4g9Z6S+eTHC/5cBZ1tE5554Kc9km7BI82VqX GaBEIxrkMY3unluGNs2Ir98xCZQf/SZ9VWjE85xDnrMvLilfaAWmxEPHmdDUODdyXPq+ PsTNwdrZ0RCntIz+p1a/9s7c4YzZ+fJq0hviw59It3znP/H8ZV4WT70aBJV+JuPStNLJ QmK4lIROQbFvcxHwSvLnzox1EbiwjBqnldmWLmPwymvJkmgjbdFbyL5oRmcB+AehdqF2 BQsg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=unisoc.com); spf=pass (google.com: domain of linux-kernel+bounces-182055-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-182055-linux.lists.archive=gmail.com@vger.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 41be03b00d2f7-63413d72dbfsi17009236a12.880.2024.05.17.04.28.19 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 May 2024 04:28:19 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-182055-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; arc=pass (i=1 spf=pass spfdomain=unisoc.com); spf=pass (google.com: domain of linux-kernel+bounces-182055-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-182055-linux.lists.archive=gmail.com@vger.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 68A7128745D for ; Fri, 17 May 2024 11:28:19 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D392D3E47F; Fri, 17 May 2024 11:28:11 +0000 (UTC) Received: from SHSQR01.spreadtrum.com (mx1.unisoc.com [222.66.158.135]) (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 E74A72BCFD for ; Fri, 17 May 2024 11:28:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=222.66.158.135 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715945291; cv=none; b=jTyXkTBL1a+qUrahjxmIcThund3mlblm5H8oRvK3qIdbUGMcaVTfLKHu7jbB2tz0XK5CSQRA7ZR8z4dL7ovSLKg04BK1AKPh5btnI4JJ+JxmkXPvP0rBEHwRfyvD5o7FS3o2rQ/wWqA7WjtW9uxHx/+JJRv18BVji2s4yxEy1iU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715945291; c=relaxed/simple; bh=cXA+wMh0DoUH+aNA0HoHewqoDE2nsQtINGtHwe1mWUM=; h=From:To:CC:Subject:Date:Message-ID:MIME-Version:Content-Type; b=PwBsrh1uXEsZnpSCPJbAkn9qhBnRLB/4Y/tIzI61sEEyWcehBGdUwiGX33RRHQK+k4wlcV1mwfSXaAWbuAxAN+mzYyY2/TygkKHyT8fcCwuTA8ygUrvUhMNMhXLhUwqzKuVkaOS6NU7J4E26WXhLY7WD4I4a6PGOhWprK8ILg6s= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=unisoc.com; spf=pass smtp.mailfrom=unisoc.com; arc=none smtp.client-ip=222.66.158.135 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=unisoc.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=unisoc.com Received: from dlp.unisoc.com ([10.29.3.86]) by SHSQR01.spreadtrum.com with ESMTP id 44HBRIr9071358; Fri, 17 May 2024 19:27:18 +0800 (+08) (envelope-from Zhiguo.Niu@unisoc.com) Received: from SHDLP.spreadtrum.com (bjmbx02.spreadtrum.com [10.0.64.8]) by dlp.unisoc.com (SkyGuard) with ESMTPS id 4Vgl300WpXz2PdW2s; Fri, 17 May 2024 19:23:56 +0800 (CST) Received: from bj08434pcu.spreadtrum.com (10.0.73.87) by BJMBX02.spreadtrum.com (10.0.64.8) with Microsoft SMTP Server (TLS) id 15.0.1497.23; Fri, 17 May 2024 19:27:10 +0800 From: Zhiguo Niu To: , CC: , , , , , Subject: [PATCH] f2fs: fix to check return value of f2fs_allocate_new_section Date: Fri, 17 May 2024 19:26:42 +0800 Message-ID: <1715945202-30045-1-git-send-email-zhiguo.niu@unisoc.com> X-Mailer: git-send-email 1.9.1 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain X-ClientProxiedBy: SHCAS01.spreadtrum.com (10.0.1.201) To BJMBX02.spreadtrum.com (10.0.64.8) X-MAIL:SHSQR01.spreadtrum.com 44HBRIr9071358 commit 245930617c9b ("f2fs: fix to handle error paths of {new,change}_curseg()") missed this allocated path, fix it. Signed-off-by: Zhiguo Niu --- fs/f2fs/segment.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c index a0ce3d0..71dc8042 100644 --- a/fs/f2fs/segment.c +++ b/fs/f2fs/segment.c @@ -5190,7 +5190,9 @@ static int fix_curseg_write_pointer(struct f2fs_sb_info *sbi, int type) if (cs->next_blkoff) { unsigned int old_segno = cs->segno, old_blkoff = cs->next_blkoff; - f2fs_allocate_new_section(sbi, type, true); + err = f2fs_allocate_new_section(sbi, type, true); + if (err) + return err; f2fs_notice(sbi, "Assign new section to curseg[%d]: " "[0x%x,0x%x] -> [0x%x,0x%x]", type, old_segno, old_blkoff, -- 1.9.1