Received: by 10.223.185.116 with SMTP id b49csp2184878wrg; Thu, 15 Feb 2018 07:47:30 -0800 (PST) X-Google-Smtp-Source: AH8x226NeonBHcvKMh0+QsQExrmERX06Xwdj7IWvFh5qVDBHbbESbDvrx6OctlD77pGteFWdbq8i X-Received: by 10.101.76.13 with SMTP id u13mr2475488pgq.287.1518709650843; Thu, 15 Feb 2018 07:47:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518709650; cv=none; d=google.com; s=arc-20160816; b=f4u6NzphWMDi9zFfb7A/ADSsIhLMVwcE5BfjOtfWXNCAaYTpK9CX8scQRV5DERk+CG 90TmtqYjMDbu0qFMwyq9VUWcdvoKLItFZJeRuGDkD5+gLkNCh/Tse4BCWCG1sffiI8ik Dfb7W2k8qVLqC22tMsScCePb0dXTqEJJEVN626kIGgkp9P+YAefCx0fehozi0g9HIrui 57KXHNsCjSUKXKoPF2JnigRfXN0KrCLSiICBJawRecL7exAAVw7mjSKywaPG/XBuE46Q QU6H913mX1gUwcusPCz1Sb/+Sszscvv/434F4uZxjQUKc7OIjNFgpMMEcY4OG+Y9i4g4 CWaA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=UxgYJ7ijw+W7w3Lk101JG6eHEfIibiRhdLL5C/g5BGw=; b=Qm0wwsMqYPn6qqYKkEWgv+S8QZYVJzdlLn82+doIUruZaqB9tcqHkuLDVpgFFLpdvM VKRUrcZkDrIW3ps/n9S6Vz9g3PwWD+ckes//BWDRxd+uHN6TSEIP6Xe/pBLxvAudZGjI o/OkHH5RX8Qld8bR/+J8JewXtsrHbn9pY5ekbAAlFH7HcLKKoc0qJQ7xBLy3AZ6TRiCd tzfJcyGba6cnYGsm65zcBDFgY8CIznCKePmpmrRQ4Zsc+FboZ9n3Fx21OA5R7QpX4QRQ p4jNdmxxxHMaXjBE2zjaVT9Qp5QRFmAh5n/nSDsPd2bDiI/CZCNlJI/+1qQcCQ1ac+kI bZjA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z5si673894pfz.253.2018.02.15.07.47.16; Thu, 15 Feb 2018 07:47:30 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1424419AbeBOPpM (ORCPT + 99 others); Thu, 15 Feb 2018 10:45:12 -0500 Received: from mail.linuxfoundation.org ([140.211.169.12]:34830 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1424390AbeBOPpH (ORCPT ); Thu, 15 Feb 2018 10:45:07 -0500 Received: from localhost (LFbn-1-12258-90.w90-92.abo.wanadoo.fr [90.92.71.90]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id CFE2411AE; Thu, 15 Feb 2018 15:45:06 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, David Howells Subject: [PATCH 4.15 143/202] afs: Need to clear responded flag in addr cursor Date: Thu, 15 Feb 2018 16:17:23 +0100 Message-Id: <20180215151720.540681038@linuxfoundation.org> X-Mailer: git-send-email 2.16.1 In-Reply-To: <20180215151712.768794354@linuxfoundation.org> References: <20180215151712.768794354@linuxfoundation.org> User-Agent: quilt/0.65 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.15-stable review patch. If anyone has any objections, please let me know. ------------------ From: David Howells commit 8305e579c653b127b292fcdce551e930f9560260 upstream. In afs_select_fileserver(), we need to clear the ->responded flag in the address list when reusing it. We should also clear it in afs_select_current_fileserver(). To this end, just memset() the object before initialising it. Fixes: d2ddc776a458 ("afs: Overhaul volume and server record caching and fileserver rotation") Signed-off-by: David Howells Signed-off-by: Greg Kroah-Hartman --- fs/afs/rotate.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) --- a/fs/afs/rotate.c +++ b/fs/afs/rotate.c @@ -383,6 +383,7 @@ use_server: afs_get_addrlist(alist); read_unlock(&server->fs_lock); + memset(&fc->ac, 0, sizeof(fc->ac)); /* Probe the current fileserver if we haven't done so yet. */ if (!test_bit(AFS_SERVER_FL_PROBED, &server->flags)) { @@ -397,11 +398,8 @@ use_server: else afs_put_addrlist(alist); - fc->ac.addr = NULL; fc->ac.start = READ_ONCE(alist->index); fc->ac.index = fc->ac.start; - fc->ac.error = 0; - fc->ac.begun = false; goto iterate_address; iterate_address: @@ -458,12 +456,10 @@ bool afs_select_current_fileserver(struc return false; } + memset(&fc->ac, 0, sizeof(fc->ac)); fc->ac.alist = alist; - fc->ac.addr = NULL; fc->ac.start = READ_ONCE(alist->index); fc->ac.index = fc->ac.start; - fc->ac.error = 0; - fc->ac.begun = false; goto iterate_address; case 0: