Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp10790805imu; Thu, 6 Dec 2018 06:53:14 -0800 (PST) X-Google-Smtp-Source: AFSGD/XZwR9yZ2Bxhr4EGIDXswT9i07WqVgmFJZy5so/RJm+DenfVuBF+a1AzaVqC+Iv/DF11F79 X-Received: by 2002:a63:5153:: with SMTP id r19mr24159776pgl.281.1544107994266; Thu, 06 Dec 2018 06:53:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544107994; cv=none; d=google.com; s=arc-20160816; b=xGKhQlRC5MISeg4Fgy3VfkRN7bI0DCHImcC/zJuJv1IhIyT2YixGbye7IXJpmOg5+E bzUNVX+p1N98quke5m6BAE8gxeTde0H19k/sE5piVktyjh9Df/pOkEkHefFZbmndwYzr 5AJo3fFC1T54CcrXy+D1LK6s0p1iwLaeJ4ryAOCEEzf074ehudKBflQdylackoIDKSY8 QYVHEBbd9+ZlpE6dCECSawnUrnRi5rVwlFwW8l8HPtxG0u+TbMH2OOJdJePcc70EonaS m9dgJeVYTckFJ2OZZ/OU4BNtdDmAaq03wo0eW018I9A94GEoeWz/FLBpHKPosd/bpUFJ duGQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=dZDfpmks4xWn/czpuMpzZ2YZnIWkCQ5lTlb+oA9HClE=; b=o0GVC6X+11KbL5ZpRillxf8KCc2c7gePjMRalbGMpHN6O5KdnKa+fkgOKoTQ/NVaQj 5PzqD4deF3kKAis+JjUpeusCXRuooLwcFLUUf47xMgS4+n7OUyO3ho2JUM+Tqs8aeIML bNymorirM3GvgQ+Rdy6olqKLfe5HVjtEyH7rxBcgPfG9mvSnZ6T2ubi6BPNk50en7aao I4/r406g2tgrGmi+RQw1p36Fr3OYk2UoUkR6MDd/JOrFOHNgpjDbGRkcSQ6xFDHscNey bf0TgUpzscX43aAdKS7WqTw6D3y+UEnrPSV20hCXy5qa7wvKNqWDomfHRTnvMO57CidU oMUA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=nFpeLk2X; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 191si406438pgd.228.2018.12.06.06.52.58; Thu, 06 Dec 2018 06:53:14 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=nFpeLk2X; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730974AbeLFOrd (ORCPT + 99 others); Thu, 6 Dec 2018 09:47:33 -0500 Received: from mail.kernel.org ([198.145.29.99]:52202 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730026AbeLFOrU (ORCPT ); Thu, 6 Dec 2018 09:47:20 -0500 Received: from localhost (5356596B.cm-6-7b.dynamic.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id E87042146D; Thu, 6 Dec 2018 14:47:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1544107639; bh=ahM0vENcfmYccr7KmWt3oK8rj3AjRk/YqYLt1KZjAcY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=nFpeLk2XZLO6I3jagnFQnkPomleV+Np9hMcjSz8P0s1xOaS6nnNEofAPhO+ORVia1 TeqXmIUm4aG2t4d70qOOOMs9xbgGwaOGXN40nxfIYEXSr3596miku0Ww9ZbjsJ5pdc p2wN8zG54wrYp509Dg9dKDEOk1CdlvjLk6bup78c= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Yunlei He , Jaegeuk Kim , Ben Hutchings Subject: [PATCH 4.9 083/101] f2fs: fix a panic caused by NULL flush_cmd_control Date: Thu, 6 Dec 2018 15:39:22 +0100 Message-Id: <20181206143017.450236496@linuxfoundation.org> X-Mailer: git-send-email 2.19.2 In-Reply-To: <20181206143011.174892052@linuxfoundation.org> References: <20181206143011.174892052@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review X-Patchwork-Hint: ignore MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.9-stable review patch. If anyone has any objections, please let me know. ------------------ From: Yunlei He commit d4fdf8ba0e5808ba9ad6b44337783bd9935e0982 upstream. Mount fs with option noflush_merge, boot failed for illegal address fcc in function f2fs_issue_flush: if (!test_opt(sbi, FLUSH_MERGE)) { ret = submit_flush_wait(sbi); atomic_inc(&fcc->issued_flush); -> Here, fcc illegal return ret; } Signed-off-by: Yunlei He Signed-off-by: Jaegeuk Kim [bwh: Backported to 4.9: adjust context] Signed-off-by: Ben Hutchings Signed-off-by: Greg Kroah-Hartman --- fs/f2fs/segment.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) --- a/fs/f2fs/segment.c +++ b/fs/f2fs/segment.c @@ -493,6 +493,9 @@ int create_flush_cmd_control(struct f2fs init_waitqueue_head(&fcc->flush_wait_queue); init_llist_head(&fcc->issue_list); SM_I(sbi)->cmd_control_info = fcc; + if (!test_opt(sbi, FLUSH_MERGE)) + return err; + fcc->f2fs_issue_flush = kthread_run(issue_flush_thread, sbi, "f2fs_flush-%u:%u", MAJOR(dev), MINOR(dev)); if (IS_ERR(fcc->f2fs_issue_flush)) { @@ -2539,7 +2542,7 @@ int build_segment_manager(struct f2fs_sb INIT_LIST_HEAD(&sm_info->sit_entry_set); - if (test_opt(sbi, FLUSH_MERGE) && !f2fs_readonly(sbi->sb)) { + if (!f2fs_readonly(sbi->sb)) { err = create_flush_cmd_control(sbi); if (err) return err;