Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp3058329pxj; Mon, 17 May 2021 16:41:32 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzZwA9RMIYloqWuydb6FJRDoFzN4+6PEJ6sRSXW+4QVHL+swwn+H5m9NhuWs4TfWeCpeHgV X-Received: by 2002:aa7:cd46:: with SMTP id v6mr3175301edw.16.1621294892323; Mon, 17 May 2021 16:41:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621294892; cv=none; d=google.com; s=arc-20160816; b=jPDEeNNIL+t9015YPoof3m1+DH3WH7V3yweOE6TCWoliliFLDRcolRLUYwCiyyyY7n 7NW3QhB2xHchj/eWEJZCL9pPLJN1vZ7NPgwLlMDYknx/olqKZv8rx9Br0kg6i3gesp8R OgUqQaSqVSUdnHIHwKBNoXbLl+VEwFwlkGJ4rKnDjMeQy/aVYGA3HsjFw9BQ82hGr/TU 5rbfbw4JuxhsFKiP+DGbOZCbtOLNPs1Szr7XfHtsvf+E3gaa/T8qDZk6GEp32tlQMM9J MF2gmIyV0nUvYc6EqXiZhuk23kxyNlRBOuRXfI49EiOQ/H4f1YmY0x4TjcwfENggX5xu CKcA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=tIInihh91S0eoASyDbuvXb4J2nKhAC335IaoQb5iL6U=; b=OiR4gdV9J9uQ/2P539ThsL5rR4GumFPkH3jnv0VNItKUJtkHKkl/SpGjq43XTHZ5/8 USSYOmXGPg1vtLVbNrIagtN2F9kOWGOCk+qpe9tB5w69+Kw8Pbt3H6mmB2+AVq0GiRnn ss1GMnBVMjGml5qfrvdosoAtPh8XcvIutUCDRxoAZ6XROkoopXREa6+orm3NOPCRR91O k0bbzB6Nn9Axu5BJiFKV0QO0Cb195lWcETn0JJVfHcxegyZjIb+J6yAB76ZDB7FjyL6g NGdagxojvu0A+HQ3Q1NBqweWNjp4GBcUz3XV6mDnyqiq4CzDpA9MRHrz0FQjNAKviK7C nqQw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=XeicZ8Co; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id k11si7905669edi.5.2021.05.17.16.41.07; Mon, 17 May 2021 16:41:32 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-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=@linuxfoundation.org header.s=korg header.b=XeicZ8Co; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239002AbhEQOWt (ORCPT + 99 others); Mon, 17 May 2021 10:22:49 -0400 Received: from mail.kernel.org ([198.145.29.99]:37626 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239244AbhEQOTQ (ORCPT ); Mon, 17 May 2021 10:19:16 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 5443961437; Mon, 17 May 2021 14:10:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1621260655; bh=9ASF4gVcBJXPb7XfbQrYiGoXvfdqXNUbPnqz4o2aze8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=XeicZ8CohZmbLMwdgH2QMsGBJkUUnsD7IcAODSk9AGG5VneNlhNaDl551B/NjtW9j VwtHHTfenuLoXKfeAkPS431oWfP9fu4NQFpyeAarfRtDhODgCuM4bBz/3kPbc7UB34 dGHp7dZfz/rOOVZb/0ThXWvpmItU3tWeUOrZe0yY= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Nagendra S Tomar , Trond Myklebust , Sasha Levin Subject: [PATCH 5.12 145/363] nfs: Subsequent READDIR calls should carry non-zero cookieverifier Date: Mon, 17 May 2021 16:00:11 +0200 Message-Id: <20210517140307.521535544@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210517140302.508966430@linuxfoundation.org> References: <20210517140302.508966430@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Nagendra S Tomar [ Upstream commit ee3707ae2c1f1327ad5188836b7ab62ed2c93b28 ] If the loop in nfs_readdir_xdr_to_array() runs more than once, subsequent READDIR RPCs may wrongly carry a zero cookie verifier and non-zero cookie. Make sure subsequent calls to READDIR carry the cookie verifier returned by the first call. Signed-off-by: Nagendra S Tomar Fixes: b593c09f83a2 ("NFS: Improve handling of directory verifiers") Signed-off-by: Trond Myklebust Signed-off-by: Sasha Levin --- fs/nfs/dir.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/fs/nfs/dir.c b/fs/nfs/dir.c index fc4f490f2d78..08a1e2e31d0b 100644 --- a/fs/nfs/dir.c +++ b/fs/nfs/dir.c @@ -866,6 +866,8 @@ static int nfs_readdir_xdr_to_array(struct nfs_readdir_descriptor *desc, break; } + verf_arg = verf_res; + status = nfs_readdir_page_filler(desc, entry, pages, pglen, arrays, narrays); } while (!status && nfs_readdir_page_needs_filling(page)); -- 2.30.2