Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3692875imu; Tue, 18 Dec 2018 02:35:07 -0800 (PST) X-Google-Smtp-Source: AFSGD/XZqSHDeAGA4SunPWcdgidIkF6OqMit09moU3ZgOikfgtgp74MX3Wt7nrTrZgM7QpFkdgdc X-Received: by 2002:a62:5003:: with SMTP id e3mr16625488pfb.23.1545129307735; Tue, 18 Dec 2018 02:35:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1545129307; cv=none; d=google.com; s=arc-20160816; b=pLIZykHuCJ66nrfS14ZFQRLMggkA1/mTSe41zTCsF9i0H2L/VZLSilTp+9RVlItqXg OZUbfJkasj+uPkTZBAnlhFLiZhUCuD5WnzFL3eLQKNVhNKlIsRIwbtMIaqj8qH3dGOyu CFXb+4nmVE7lvg9UOXzNjWj16wSJFUcYaCiaSeiySVP1NZIvgalXC7kHmvzAwZERcEw6 Zd3cQ/w2KEmYu5t9ozFTEpoW5ghYJWNmyEeXXx3TTSWZrwTHho02O2HYWqicZevqzuNU 4jK2S5uR84xK1XeGSS6JsER7qFae0YZc/u8cxGDNcmSH3uB8FHqyiq68grw75XsOs3zK 1FMA== 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 :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=gZFa1garwwKa1kzXHsEh1fFL7P2u6Urv010sONyVrAw=; b=Cf/AUTQ/lSr46GM5chFANw4a63T/rNMosq/f2VsuysWSADa+IjtT+Z8cT8DUDlD7g+ ZgNhvWBl3ImC1dfOMtYCy8CI/lFSGOO/N8AWPCkcBOf+AlAh5kX9Xm/2MtMPnpg6PfPw sR/kJT3gFM40EY2WWL1KS7Jb+ZvcPNUyFgR0T2b31h479su/2mA93vp1/buQ2JnWPQtl NsAxXNQQW87GlWIFyBxDf/wbKMAZES+AFd5EXDuwtja1Ge09f9P6sdAncor0Nak18h5m wIX52boeL30z2xeh2SXiSHddsjlBJw6BoFLVqlrdUoPLR1pO4QZ3MGW2P5R7N751pG/o q2BQ== 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 y5si12968456pgk.49.2018.12.18.02.34.52; Tue, 18 Dec 2018 02:35:07 -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; 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 S1726592AbeLRKdo (ORCPT + 99 others); Tue, 18 Dec 2018 05:33:44 -0500 Received: from szxga06-in.huawei.com ([45.249.212.32]:56766 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726574AbeLRKdn (ORCPT ); Tue, 18 Dec 2018 05:33:43 -0500 Received: from DGGEMS404-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id 2BDD96712B359; Tue, 18 Dec 2018 18:33:40 +0800 (CST) Received: from [127.0.0.1] (10.134.22.195) by DGGEMS404-HUB.china.huawei.com (10.3.19.204) with Microsoft SMTP Server id 14.3.408.0; Tue, 18 Dec 2018 18:33:37 +0800 Subject: Re: [f2fs-dev] [PATCH] f2fs: fix missing unlock(sbi->gc_mutex) To: Jaegeuk Kim , , CC: References: <20181218021530.78323-1-jaegeuk@kernel.org> From: Chao Yu Message-ID: <8a552929-17cc-eb0b-f4e6-5a94a1735d83@huawei.com> Date: Tue, 18 Dec 2018 18:33:36 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <20181218021530.78323-1-jaegeuk@kernel.org> Content-Type: text/plain; charset="windows-1252" Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [10.134.22.195] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2018/12/18 10:15, Jaegeuk Kim wrote: > This fixes missing unlock call. > > Cc: > Signed-off-by: Jaegeuk Kim > --- > fs/f2fs/super.c | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c > index b79677639108..2689a2cb56cc 100644 > --- a/fs/f2fs/super.c > +++ b/fs/f2fs/super.c > @@ -1462,6 +1462,9 @@ static int f2fs_disable_checkpoint(struct f2fs_sb_info *sbi) > > while (!f2fs_time_over(sbi, DISABLE_TIME)) { > err = f2fs_gc(sbi, true, false, NULL_SEGNO); > + > + /* f2fs_gc guarantees unlock gc_mutex */ How about: while () { mutex_lock(&sbi->gc_mutex); err = f2fs_gc(); if (err) { handle error cases.. } } Thanks, > + mutex_lock(&sbi->gc_mutex); > if (err == -ENODATA) > break; > if (err && err != -EAGAIN) { >