Received: by 2002:a05:6358:7058:b0:131:369:b2a3 with SMTP id 24csp1648074rwp; Thu, 13 Jul 2023 14:19:53 -0700 (PDT) X-Google-Smtp-Source: APBJJlExcUP2e8/FEmSTK0L1F1JqvpPwp2xbVy5Xun7Hqz63TC24qaYvisdYgq+cvgUVgga6ebyd X-Received: by 2002:a05:6a20:8e14:b0:132:2f7d:29ca with SMTP id y20-20020a056a208e1400b001322f7d29camr3449803pzj.24.1689283193327; Thu, 13 Jul 2023 14:19:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689283193; cv=none; d=google.com; s=arc-20160816; b=kEAcsq5tMGZbp5nZVg5LBfc8yH5kDz2y90jxdvQijVMS/SqiZcoO2RLa4DkopsRyL4 CX6bo4jlpK2e+f8LOtYaT7dpRMK3H5q4uxq/TyuxFrxd2KtIT+l9A7JHF2kwt2haN7vq exEpd1CFUHFuQbM9Eq2UBChLwh8bvcn+pTYCkoInDh2UppJsNcSMFLBMihtPkNvmGeBz 9W8ZryHyJNaE9Pk6+RcrREPWjbimHNucLYlcLLgSwBrj4D/tNJLb0k4WT2xbikxVObF2 GhR0UzPeF+aMF5Nnx/53VUIh1ksL51Dxa96Dnc1WtdxOt3Z20mx3ojTfg5z4iixdh166 DwQQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=U711Z1uQz6tTIE8o//Y3xXXHuKVpTZrPHY+cKVNc4gM=; fh=v+qhCvrt4w9QQ2cETHMA15mP2uMsMeuqkma4G8omVv4=; b=stp1hWVv32gdV66fsZXmQya/CXIvLeeQAcW4Z8iqs4b6S8e1oYMZ4ITHfV+rZeU6kc 8kcmJbHjvnQiTpzMuYCzttSvcqWbafxeUBEGKBNthdNJFEhcbjOPsGS6/2vViha6YnUH Z6XOjyaGWXNHeIU3PvBzjWYs/uzQJnT/gobYJvmwIZKhT3/cykRJUHzlNle6CFzcQ1+t QmM6f8DFoZXYz2FtRq+Gj8RRWaESnXvvn0XFG7Q69qvhtn+rtEn5ZoClp/SpY2QAThLM udSaxFU/u1VWCgU+sWMejeZKctljtAVTuwr783NDHiS9LzOiI8+RGyb5lHTH23QjVQ1k tiRw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=B3HMayDf; 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=redhat.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y18-20020a63fa12000000b005347d35b573si5634802pgh.580.2023.07.13.14.19.28; Thu, 13 Jul 2023 14:19:53 -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=@redhat.com header.s=mimecast20190719 header.b=B3HMayDf; 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=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232007AbjGMVKA (ORCPT + 99 others); Thu, 13 Jul 2023 17:10:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35824 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229516AbjGMVJ7 (ORCPT ); Thu, 13 Jul 2023 17:09:59 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2E9862D43 for ; Thu, 13 Jul 2023 14:09:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1689282551; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=U711Z1uQz6tTIE8o//Y3xXXHuKVpTZrPHY+cKVNc4gM=; b=B3HMayDfGRhqX4a/1YtF8DhsDtJ2q2eJRLsAf1SASCqPXocpCKQJ8I9a4kNADQtEYBVHJH rTtO1lPyQeB0tC5xcTncNGHgLwoLHmDPQBH8Lu8HaQPIQIpygrHJEf1e4AK/1MDu0PBPR/ RGRBerKxGHej+UVrW8zCyOqprTSJU6A= Received: from mimecast-mx02.redhat.com (66.187.233.73 [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-475-l-ey2Na3NoGsksJwGsLojw-1; Thu, 13 Jul 2023 17:09:02 -0400 X-MC-Unique: l-ey2Na3NoGsksJwGsLojw-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id F1EA92808E60; Thu, 13 Jul 2023 21:09:01 +0000 (UTC) Received: from [192.168.37.1] (unknown [10.22.50.6]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 32C24207B348; Thu, 13 Jul 2023 21:09:01 +0000 (UTC) From: Benjamin Coddington To: Olga Kornievskaia Cc: trond.myklebust@hammerspace.com, anna.schumaker@netapp.com, linux-nfs@vger.kernel.org Subject: Re: [PATCH 1/1] NFSv4.1: fix zero value filehandle in post open getattr Date: Thu, 13 Jul 2023 17:08:59 -0400 Message-ID: In-Reply-To: <20230713195416.30414-1-olga.kornievskaia@gmail.com> References: <20230713195416.30414-1-olga.kornievskaia@gmail.com> MIME-Version: 1.0 Content-Type: text/plain X-Scanned-By: MIMEDefang 3.1 on 10.11.54.4 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE, T_SCC_BODY_TEXT_LINE 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 13 Jul 2023, at 15:54, Olga Kornievskaia wrote: > From: Olga Kornievskaia > > Currently, if the OPEN compound experiencing an error and needs to > get the file attributes separately, it will send a stand alone > GETATTR but it would use the filehandle from the results of > the OPEN compound. In case of the CLAIM_FH OPEN, nfs_openres's fh > is zero value. That generate a GETATTR that's sent with a zero > value filehandle, and results in the server returning an error. > > Instead, for the CLAIM_FH OPEN, take the filehandle that was used > in the PUTFH of the OPEN compound. > > Signed-off-by: Olga Kornievskaia > --- > fs/nfs/nfs4proc.c | 6 +++++- > 1 file changed, 5 insertions(+), 1 deletion(-) > > diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c > index 8edc610dc1d3..0b1b49f01c5b 100644 > --- a/fs/nfs/nfs4proc.c > +++ b/fs/nfs/nfs4proc.c > @@ -2703,8 +2703,12 @@ static int _nfs4_proc_open(struct nfs4_opendata *data, > return status; > } > if (!(o_res->f_attr->valid & NFS_ATTR_FATTR)) { > + struct nfs_fh *fh = &o_res->fh; > + > nfs4_sequence_free_slot(&o_res->seq_res); > - nfs4_proc_getattr(server, &o_res->fh, o_res->f_attr, NULL); > + if (o_arg->claim == NFS4_OPEN_CLAIM_FH) > + fh = NFS_FH(d_inode(data->dentry)); > + nfs4_proc_getattr(server, fh, o_res->f_attr, NULL); > } > return 0; > } Looks good, but why not just use o_arg->fh? Maybe also an opportunity to fix the whitespace damage a few lines before this hunk too. Reviewed-by: Benjamin Coddington Ben