Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp55544ybz; Tue, 28 Apr 2020 18:04:57 -0700 (PDT) X-Google-Smtp-Source: APiQypLdCQ47eF5oPoWHoMm3k4PHh2N6GBLcza46iuHSVsKM5gafmKOw6pCPkh4yJ8wFZmjvRgXA X-Received: by 2002:aa7:d1cc:: with SMTP id g12mr395731edp.84.1588122297324; Tue, 28 Apr 2020 18:04:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588122297; cv=none; d=google.com; s=arc-20160816; b=gsj6t21OA7zSLNCWlHnw8SnpUTXU5JGGq83kUyRAnXr5f1R5x/22HbaAeEyN2UJEf4 KW+OQix+oZTC6w7BH8Fr6a+3HxsVnY0HwPAA3SJyp0vlQsVptPVebzpWc+M+Hcg20GmZ eZtTTtOrOQe0cpE9j6ySGeKF+npgCYbKxDfLe7sCJ9JYTWN9Ps0UM3l5Zv3rno4WRxpX xZAeb72uGsx0+Qyl8BRA2fm1MUFx6j+0X0jgwsxk1TMpDGzgIfk2i7kQu9Y9DD80LKfm VMYnklk4vpgu8tfjYU3wWjusm/06FFAK2S62jD7YUqCtwBclQ7ZqMEtbfJmldp5x92Sj dsvg== 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:in-reply-to :mime-version:user-agent:date:message-id:from:references:cc:to :subject; bh=DcmHUGj2OGlu5Hwoow9B/BlfapF4NI/jyil5rtQS580=; b=nqIdImlB/p+WNBw82OuFYmdvNUmrgoCdUfoVJCl76scHkorqFgibs96ZDsHL6SdO7u lncULNFtz/RC9YdqXdGvgQKs1Jcs2m6KizcopgNHcY+MUgmsVb51dewcM2m6FDpUOK5T 2DSOSFjvA/d1l1ZqnXIW48HNQlHBv3n59cYzvxG/zv03zhp41qQC75DL/0uvHy05VX9e Rta+mlLVgv/ukzOBgr2vS75zAUtOITAhTbxs2djpTF+QtjI16zhhh6VLKN1/p7SaTEPJ YxI1m6lWLPMmo+Vsv0ZcOSHIF6/XZ27XtXdZrUDK069EXlWjpBtUu/lcDECKYgqg9dzo 6QsA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a25si2820563ejr.32.2020.04.28.18.04.18; Tue, 28 Apr 2020 18:04:57 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726401AbgD2BEJ (ORCPT + 99 others); Tue, 28 Apr 2020 21:04:09 -0400 Received: from szxga07-in.huawei.com ([45.249.212.35]:41188 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726274AbgD2BEI (ORCPT ); Tue, 28 Apr 2020 21:04:08 -0400 Received: from DGGEMS401-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id 442119FE39C8A95023C8; Wed, 29 Apr 2020 09:04:06 +0800 (CST) Received: from [10.166.215.142] (10.166.215.142) by smtp.huawei.com (10.3.19.201) with Microsoft SMTP Server (TLS) id 14.3.487.0; Wed, 29 Apr 2020 09:04:03 +0800 Subject: Re: [PATCH -next] NFSv4: Use GFP_ATOMIC under spin lock in _pnfs_grab_empty_layout() To: Dan Carpenter CC: Trond Myklebust , Anna Schumaker , , References: <20200428071932.69976-1-weiyongjun1@huawei.com> <20200428180448.GJ2014@kadam> From: Wei Yongjun Message-ID: <8564645e-124c-ef53-3cd8-1d887dfe867e@huawei.com> Date: Wed, 29 Apr 2020 09:03:13 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.7.0 MIME-Version: 1.0 In-Reply-To: <20200428180448.GJ2014@kadam> Content-Type: text/plain; charset="gbk" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.166.215.142] X-CFilter-Loop: Reflected Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org On 2020/4/29 2:04, Dan Carpenter wrote: > On Tue, Apr 28, 2020 at 07:19:32AM +0000, Wei Yongjun wrote: >> A spin lock is taken here so we should use GFP_ATOMIC. >> >> Signed-off-by: Wei Yongjun >> --- >> fs/nfs/pnfs.c | 2 +- >> 1 file changed, 1 insertion(+), 1 deletion(-) >> >> diff --git a/fs/nfs/pnfs.c b/fs/nfs/pnfs.c >> index dd2e14f5875d..d84c1b7b71d2 100644 >> --- a/fs/nfs/pnfs.c >> +++ b/fs/nfs/pnfs.c >> @@ -2170,7 +2170,7 @@ _pnfs_grab_empty_layout(struct inode *ino, struct nfs_open_context *ctx) >> struct pnfs_layout_hdr *lo; >> >> spin_lock(&ino->i_lock); > ^^^ >> - lo = pnfs_find_alloc_layout(ino, ctx, GFP_KERNEL); >> + lo = pnfs_find_alloc_layout(ino, ctx, GFP_ATOMIC); > ^^^ > It releases the lock before allocating. It's annotated. > Got it, thanks. regards, Wei Yongjun