Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp446556yba; Fri, 26 Apr 2019 02:59:23 -0700 (PDT) X-Google-Smtp-Source: APXvYqzatK680iLioiqp4p+J6NoWJ8zIR+WDEa3jsNWcSTwRRckcj9SmWkTh0D7gm7RcWlcF84OP X-Received: by 2002:a17:902:f81:: with SMTP id 1mr45028287plz.216.1556272763533; Fri, 26 Apr 2019 02:59:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556272763; cv=none; d=google.com; s=arc-20160816; b=N6jfO16plCXBlcJWQzo/aqY65E7GDvnU2BIVzSgCbOrnlB3Hs04HWh4/yxTnvUhrCw yttt1LQmZdvnhudOBmwfpkBzwsm1835QHVVxSY5Wn2B9qPgsGLiajMiU3kLLrOO/RsRK 6E7iJPs1rx7k1subeZZKiv3br6XemFwI8vuZbcDgaicr/DqAuPb5Y01XhNtRph8xp+bf ctODTydbB0xkt+8XQybvdqfdDvE7S4xdq5EDgrW/WJss+5u2Ki7USGc/0nY2WMytucjj V7PqyAeBh5XT/I+1jKd6EeJL6XoIsUds/VQy/nFe/s2qYFGX7mHOeq1PZF8CacWWyHQF spkQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from; bh=IDOLGdHce+reDz0kXw0AqXM6ffVf1h/LptG1WpZtVKE=; b=zMzm81UddOriegctInjefbERe+d8XjGa7Cv7ryQ9dkex7Ha7RD8zrN6nmpeY52FFSl 5wE4/A3dWYz9fhPxqRuzZhzCxYMZEI0Vbw4P+EB8/yRCbGbSjbqKTt4X6Fv5CdRPwi79 xj7BvLPVk16lNrGGqkT/q7iP/p0f6gIGxFM5qVX2yLxzMhaZD/ropMnBU9Ke3t+Wblur oHzQx4eBnnncqJDeZOfsqctGqTAslgSqfoYME5caERLgMvmggnoyr9IQ2DiFqyUkFi7C 4ORM3ab2QYErI/+vif+49LaOaSk5ktizGPDBpKCEWqFUwKS9AEJ8KDOL/8zCSH26l0qK xt6g== ARC-Authentication-Results: i=1; mx.google.com; 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 q184si16837466pga.374.2019.04.26.02.59.08; Fri, 26 Apr 2019 02:59:23 -0700 (PDT) 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; 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 S1726519AbfDZJ6M (ORCPT + 99 others); Fri, 26 Apr 2019 05:58:12 -0400 Received: from szxga08-in.huawei.com ([45.249.212.255]:32914 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726263AbfDZJ6H (ORCPT ); Fri, 26 Apr 2019 05:58:07 -0400 Received: from DGGEMM403-HUB.china.huawei.com (unknown [172.30.72.53]) by Forcepoint Email with ESMTP id 318BED9BDCD132DB3861; Fri, 26 Apr 2019 17:58:03 +0800 (CST) Received: from dggeme763-chm.china.huawei.com (10.3.19.109) by DGGEMM403-HUB.china.huawei.com (10.3.20.211) with Microsoft SMTP Server (TLS) id 14.3.408.0; Fri, 26 Apr 2019 17:58:02 +0800 Received: from szvp000201624.huawei.com (10.120.216.130) by dggeme763-chm.china.huawei.com (10.3.19.109) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1591.10; Fri, 26 Apr 2019 17:58:01 +0800 From: Chao Yu To: CC: , , , , Chao Yu Subject: [PATCH 2/2] f2fs: fix to handle error in f2fs_disable_checkpoint() Date: Fri, 26 Apr 2019 17:57:54 +0800 Message-ID: <20190426095754.85784-2-yuchao0@huawei.com> X-Mailer: git-send-email 2.18.0.rc1 In-Reply-To: <20190426095754.85784-1-yuchao0@huawei.com> References: <20190426095754.85784-1-yuchao0@huawei.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.120.216.130] X-ClientProxiedBy: dggeme711-chm.china.huawei.com (10.1.199.107) To dggeme763-chm.china.huawei.com (10.3.19.109) X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org In f2fs_disable_checkpoint(), it needs to detect and propagate error number returned from f2fs_write_checkpoint(). Signed-off-by: Chao Yu --- fs/f2fs/super.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c index fcc9793dbc2c..ad0faa19cb69 100644 --- a/fs/f2fs/super.c +++ b/fs/f2fs/super.c @@ -1507,9 +1507,12 @@ static int f2fs_disable_checkpoint(struct f2fs_sb_info *sbi) mutex_lock(&sbi->gc_mutex); cpc.reason = CP_PAUSE; set_sbi_flag(sbi, SBI_CP_DISABLED); - f2fs_write_checkpoint(sbi, &cpc); + err = f2fs_write_checkpoint(sbi, &cpc); + if (err) + goto out_unlock; sbi->unusable_block_count = 0; +out_unlock: mutex_unlock(&sbi->gc_mutex); restore_flag: sbi->sb->s_flags = s_flags; /* Restore MS_RDONLY status */ -- 2.18.0.rc1