Received: by 2002:a05:6358:53a8:b0:117:f937:c515 with SMTP id z40csp1717804rwe; Sat, 15 Apr 2023 04:57:13 -0700 (PDT) X-Google-Smtp-Source: AKy350a+aePtiG7WCqn4NoCkEnjZUw/vBuosCIYCA30GOGKC4euko98ccPiPvYmEipqkdVrtwl0s X-Received: by 2002:a17:90a:c24b:b0:247:40f1:79d7 with SMTP id d11-20020a17090ac24b00b0024740f179d7mr5282462pjx.34.1681559833392; Sat, 15 Apr 2023 04:57:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681559833; cv=none; d=google.com; s=arc-20160816; b=0lI1kdpiBpKg+yXKY8hBHu9IWEry/2i6XxrEfIBavOE0LXTaaqDGy6RWISmloPcb+v Ibq0tNAc9Ew0vITwdyZIwZF0hc72R83A85y30qU9Kbyrsn7hQNbyBNAHaTbJuUuMC7Ca yfvLFxoDI/C4D5URLeVwdAgRzCORnEUjqyGskgsy3j71YdQ+qCZXr3oAFH6UXIYO3DDT X2wHf2Tn8d+3N8/vIF6abDi+e1iFG0Qbe9xWRji1PrRYbjwVQYJznYlpLF0lZRXzbtXZ emHU+30nbXM3sWcmjkt3dhBJmMKfGsHM7RM1CTuf/WZqQXzl+314yE2w8FqGt7TRgrNR B+Yw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent :content-transfer-encoding:references:in-reply-to:date:to:from :subject:message-id:dkim-signature; bh=U22WICk8m088iXniNXebb3whE3lLfNSfExeOSKmLnc0=; b=nbnZTbQVy7+RdGPhZKcvsJtWFV56+r6/r/JnGjikJz6Hjc+AM02Vj93EoA0vtJSZ6T uOBzqFurc51z4EVVgLsOvqHam+B6BHWiM836PQcIfdttizI/hUBnQpNowwhpZgRl/WMP OfgZCWg6JmmXUCpxdREM2hnfe3RRaxy60jbTGhRA3xll9HjL9I952mqR3lG5uGCIUQ4Y EMzDN2D5ANqOPWAuzR62P5gnvnsZrBx50hS35nmGRMY3cQufo6VJvulOIjDtsCDZow2A nDstp/dh2FFxNGeiVYWreJZSPLxC1Z0Sg7jpasBYm+MSKVSyRUEvjqO+IPT+b2GCsupo dLkg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=CC9Ta6MH; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id a62-20020a639041000000b0051b85ea8e17si2142505pge.3.2023.04.15.04.56.54; Sat, 15 Apr 2023 04:57:13 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=CC9Ta6MH; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229922AbjDOLmY (ORCPT + 99 others); Sat, 15 Apr 2023 07:42:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39636 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229468AbjDOLmX (ORCPT ); Sat, 15 Apr 2023 07:42:23 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A2D5249EE for ; Sat, 15 Apr 2023 04:42:22 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 3F9D960905 for ; Sat, 15 Apr 2023 11:42:22 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 37C2DC433EF; Sat, 15 Apr 2023 11:42:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1681558941; bh=wI4H4Kk/IigGpqVNCe8P24rp11GMgD5MDFPWNCg+lVM=; h=Subject:From:To:Date:In-Reply-To:References:From; b=CC9Ta6MHkxcnCLBvcF4sYLe+dYKtNSrd8pyUSSsuDlQNVvRq9ql5rRCzr6IJIF6rd gUgtSvLwY1Hsl/podk1DbMIDFQ22rHNPAF58M34qE8uRm9+CHEwG9O77iS0XkTNQv8 MEgkVqpX7rdtiAoHmyEa3j/xC4tc8gcYlRjb9XiFB6E4U0/tAB9lKWPNC7JhrDT+OP tQ1tCuNluJf+HV+juHQvOZ4DFG+TCXLQBtlJxmt3m+aHAp43+5SyNjgUeCpPWbr4/J uEkn/Drybu387V8OB/PAtjJ+uQWUCY2QZzDZPCrQyp017f9bw9IllrqXcvLQFcTk0P WlqiFduVxqQug== Message-ID: Subject: Re: [PATCH] nfsd: don't use GFP_KERNEL from nfsd_getxattr()/nfsd_listxattr() From: Jeff Layton To: Tetsuo Handa , Chuck Lever , Frank van der Linden , "open list:NFS, SUNRPC, AND..." Date: Sat, 15 Apr 2023 07:42:19 -0400 In-Reply-To: <72bf692e-bb6b-c1f2-d1ba-3205ab649b43@I-love.SAKURA.ne.jp> References: <72bf692e-bb6b-c1f2-d1ba-3205ab649b43@I-love.SAKURA.ne.jp> Content-Type: text/plain; charset="ISO-8859-15" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.46.4 (3.46.4-1.fc37) MIME-Version: 1.0 X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org On Sat, 2023-04-15 at 20:07 +0900, Tetsuo Handa wrote: > Since GFP_KERNEL is GFP_NOFS | __GFP_FS, usage like GFP_KERNEL | GFP_NOFS > does not make sense. Drop __GFP_FS flag in order to avoid deadlock. >=20 > Fixes: 32119446bb65 ("nfsd: define xattr functions to call into their vfs= counterparts") > Signed-off-by: Tetsuo Handa > --- > fs/nfsd/vfs.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) >=20 > diff --git a/fs/nfsd/vfs.c b/fs/nfsd/vfs.c > index 5783209f17fc..109b31246666 100644 > --- a/fs/nfsd/vfs.c > +++ b/fs/nfsd/vfs.c > @@ -2164,7 +2164,7 @@ nfsd_getxattr(struct svc_rqst *rqstp, struct svc_fh= *fhp, char *name, > goto out; > } > =20 > - buf =3D kvmalloc(len, GFP_KERNEL | GFP_NOFS); > + buf =3D kvmalloc(len, GFP_NOFS); > if (buf =3D=3D NULL) { > err =3D nfserr_jukebox; > goto out; > @@ -2230,7 +2230,7 @@ nfsd_listxattr(struct svc_rqst *rqstp, struct svc_f= h *fhp, char **bufp, > /* > * We're holding i_rwsem - use GFP_NOFS. > */ > - buf =3D kvmalloc(len, GFP_KERNEL | GFP_NOFS); > + buf =3D kvmalloc(len, GFP_NOFS); > if (buf =3D=3D NULL) { > err =3D nfserr_jukebox; > goto out; I don't get it. These are the NFS server handlers for the GETXATTR and LISTXATTR operations. Basically the client is making a call to the server to fetch or list xattrs. I don't really see a huge issue with them recursing into reclaim. It's not like this code is in the writeback path. --=20 Jeff Layton