Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp4428639ybz; Tue, 28 Apr 2020 11:08:47 -0700 (PDT) X-Google-Smtp-Source: APiQypI0Oy5FvZebV/ZtgezdZgxez7ByvdV3wlXltA7RKE+Tv64BU4hqHWLWOWs/echTd1arKNQS X-Received: by 2002:aa7:c38a:: with SMTP id k10mr24145175edq.74.1588097326946; Tue, 28 Apr 2020 11:08:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588097326; cv=none; d=google.com; s=arc-20160816; b=zkQbhjUulo9fVEsAp6Hpv2EMnwdihvZU6rmco4CoPXdFlPrEd/CUktRHagzlcKnrl2 EchaRjsiLcgaKVMmolCyfNie44getRevY9K5v8Igr0v8+a8BejcnS+dX/JgaxTlijTpM LCIiNUyAeo+WmvCOVSK9RyMgo/lGTd+gbgc/uOgpyprk8XeHRahax8PwC2kVqZvVTBpD CKWgbGdGgtO+PnH5uv26HRk5QirvERm89+Yj7lifxiY8H1057iZpuHdu6TkAwJFBvugG tGtEuVTOg6yJOFO+1pJapb9sTQiWzxxAqx5rFlV7WvvAYS32Pm95w4hmT+yzGtRwLmaH KxCA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=vi5JgPZeW6IgAfDz5vpQSaEFGipy5i87NXmAvFjyxYM=; b=wBAa4zlkPATa9G8ac7Q8XfSEg4e0R//QEUUAv3Kp2ZgtBOlZEcB7wIh2Q4dH4tjv/O QUMRLGbmzfWeAUMpb33okS/a7/DHRyOXDZOh1gKL/pRXASlVPQa9vAteyhjE/yVjZzlX bDuOCBTk1a7p4eqRy9j+NJFIcc1FyMQIEu5gSmdY/OCRSa6QEIH5/bLoV2ETL3ckVnR2 NfP8OYbYFDYJa33RHCc17kQ+yPno1cL+mGCpVh9Zo75vg3FV0wA+ZcyZSYNz/heQxl6V DftUkax358mXnmQ1iRBMZuf7kgQ4yU1mO0OoDZnxHLtHdDcbNCy+d0EI21flsaoR7aKt xi5Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2020-01-29 header.b=l6p7BpTh; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id s3si1914992edq.467.2020.04.28.11.08.14; Tue, 28 Apr 2020 11:08:46 -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; dkim=pass header.i=@oracle.com header.s=corp-2020-01-29 header.b=l6p7BpTh; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728333AbgD1SFI (ORCPT + 99 others); Tue, 28 Apr 2020 14:05:08 -0400 Received: from userp2120.oracle.com ([156.151.31.85]:53006 "EHLO userp2120.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728313AbgD1SFI (ORCPT ); Tue, 28 Apr 2020 14:05:08 -0400 Received: from pps.filterd (userp2120.oracle.com [127.0.0.1]) by userp2120.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 03SI3JGe179561; Tue, 28 Apr 2020 18:04:57 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=date : from : to : cc : subject : message-id : references : mime-version : content-type : in-reply-to; s=corp-2020-01-29; bh=vi5JgPZeW6IgAfDz5vpQSaEFGipy5i87NXmAvFjyxYM=; b=l6p7BpTh3GdWoTwa8iOKOTdorj4x+S6s34Adi1GKLT/RR1TIEMmoaMa91ttNtlIDbjTW FZd08OThR2Aak+I80m3pqQeIWSqMB5WEbMLmof4K/ZkLFFDZx6sF5kUCWk+D+YMH5SXf dABwrPspnsAzFi6Rq3M4dqSMVyyOV4jl+XkihMe9YlQmV2FiJcmwfh1Z/H69HYKdtB74 bKsppaWCiceLmPDPcEoGEWJAFqjmf5w6PY53McedqvvgCYOIqw9leJWRT8eQiG9fc0jA vbixjdtyLhARx+uOVeoWiwW2hcwtsaLScNFc1NCKmb5U36p1yxRNE7thJztwG1DgBGu6 Ng== Received: from aserp3030.oracle.com (aserp3030.oracle.com [141.146.126.71]) by userp2120.oracle.com with ESMTP id 30p2p06y4r-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 28 Apr 2020 18:04:57 +0000 Received: from pps.filterd (aserp3030.oracle.com [127.0.0.1]) by aserp3030.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 03SHw2g2154966; Tue, 28 Apr 2020 18:04:57 GMT Received: from userv0122.oracle.com (userv0122.oracle.com [156.151.31.75]) by aserp3030.oracle.com with ESMTP id 30mxrt41vb-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 28 Apr 2020 18:04:56 +0000 Received: from abhmp0001.oracle.com (abhmp0001.oracle.com [141.146.116.7]) by userv0122.oracle.com (8.14.4/8.14.4) with ESMTP id 03SI4sbo028292; Tue, 28 Apr 2020 18:04:54 GMT Received: from kadam (/41.57.98.10) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Tue, 28 Apr 2020 11:04:54 -0700 Date: Tue, 28 Apr 2020 21:04:48 +0300 From: Dan Carpenter To: Wei Yongjun Cc: Trond Myklebust , Anna Schumaker , linux-nfs@vger.kernel.org, kernel-janitors@vger.kernel.org Subject: Re: [PATCH -next] NFSv4: Use GFP_ATOMIC under spin lock in _pnfs_grab_empty_layout() Message-ID: <20200428180448.GJ2014@kadam> References: <20200428071932.69976-1-weiyongjun1@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200428071932.69976-1-weiyongjun1@huawei.com> User-Agent: Mutt/1.9.4 (2018-02-28) X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9605 signatures=668686 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxscore=0 phishscore=0 suspectscore=0 mlxlogscore=999 malwarescore=0 bulkscore=0 spamscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2003020000 definitions=main-2004280143 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9605 signatures=668686 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 phishscore=0 clxscore=1011 bulkscore=0 adultscore=0 lowpriorityscore=0 impostorscore=0 malwarescore=0 mlxscore=0 suspectscore=0 mlxlogscore=999 priorityscore=1501 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2003020000 definitions=main-2004280143 Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org 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. regards, dan carpenter