From patchwork Mon Sep 23 15:07:50 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Howells X-Patchwork-Id: 13809705 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id C6165CF9C6F for ; Mon, 23 Sep 2024 15:09:02 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 592626B009A; Mon, 23 Sep 2024 11:09:02 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 54E996B009C; Mon, 23 Sep 2024 11:09:02 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 3BAA56B009B; Mon, 23 Sep 2024 11:09:02 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id 1BB856B0099 for ; Mon, 23 Sep 2024 11:09:02 -0400 (EDT) Received: from smtpin15.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id AC89F813CB for ; Mon, 23 Sep 2024 15:09:01 +0000 (UTC) X-FDA: 82596335682.15.448020E Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by imf16.hostedemail.com (Postfix) with ESMTP id DC13B180017 for ; Mon, 23 Sep 2024 15:08:59 +0000 (UTC) Authentication-Results: imf16.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=Tc6i0D6f; spf=pass (imf16.hostedemail.com: domain of dhowells@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=dhowells@redhat.com; dmarc=pass (policy=none) header.from=redhat.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1727103983; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=Z8v23aDW/AqUoLZapyyeRQboTKixFXScSQEzJQ0mhVc=; b=6SDMvDgUGZstBYqc03Sjw2eTKqXuDETorYa2RHbMhJ8/J1M/TCZ4jfXd8bpmYfDYLDkfzL YUEVCRQwVkZ/kAbmzU4c0Qbuy9AYGKvJS6YGtzT4nKA+5GO6+Ib2mCqVAYbYLFCLCwIAc2 czYI4diq5gA2wgjMSriRaCzs/n23lnw= ARC-Authentication-Results: i=1; imf16.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=Tc6i0D6f; spf=pass (imf16.hostedemail.com: domain of dhowells@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=dhowells@redhat.com; dmarc=pass (policy=none) header.from=redhat.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1727103983; a=rsa-sha256; cv=none; b=vdWcc/+rCwaRbzx0qTKCF50iCEojOUvZNGn8y9LT6tNCAap5R09hQnxJeReoLmdUrKkNAN +N52YimdOYlrAekDeBW247QRxF5xraA/6M4OgNzmYlYH1gSUxRb96N6nSyEffPIFM5XCu/ Z7+NMefSsP0T9+g02ybB72wgx4FiW/s= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1727104139; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Z8v23aDW/AqUoLZapyyeRQboTKixFXScSQEzJQ0mhVc=; b=Tc6i0D6fmvustL66frg53LvbW7Z4gky+jOGR55GwhxYFhAF9hjX1hrsAfxyjRe/6F0v7Ki k5FKgz3Fgtm5H3DZrUnCmmXpyLCfK9C3zbJXP8hJvSdu2MBu4atXP2rRd14NOXWf9Bo8nA UwxsUXwmIrzaHL9L7KhL0g6y/s0stTs= Received: from mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-551-DYyLGeXsPkSx-Jt_v0ORCQ-1; Mon, 23 Sep 2024 11:08:53 -0400 X-MC-Unique: DYyLGeXsPkSx-Jt_v0ORCQ-1 Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (unknown [10.30.177.17]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id AAD5618B63DB; Mon, 23 Sep 2024 15:08:49 +0000 (UTC) Received: from warthog.procyon.org.com (unknown [10.42.28.145]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id C923A1934989; Mon, 23 Sep 2024 15:08:36 +0000 (UTC) From: David Howells To: Christian Brauner , Steve French , Marc Dionne Cc: David Howells , Paulo Alcantara , Jeff Layton , Matthew Wilcox , netfs@lists.linux.dev, linux-afs@lists.infradead.org, linux-cifs@vger.kernel.org, linux-nfs@vger.kernel.org, ceph-devel@vger.kernel.org, v9fs@lists.linux.dev, linux-erofs@lists.ozlabs.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: [PATCH 6/8] afs: Fix the setting of the server responding flag Date: Mon, 23 Sep 2024 16:07:50 +0100 Message-ID: <20240923150756.902363-7-dhowells@redhat.com> In-Reply-To: <20240923150756.902363-1-dhowells@redhat.com> References: <20240923150756.902363-1-dhowells@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.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uVG7NyqLv5M/fBB9zImTs+ +bI5fw3A a2IkPvQrjEO+bT6Uu0+h4mJmZpMTNSSpzYVlYhXZ0jGqCMQp1cPqSNZInXFk07A7XqeasN/awzfG0e9ryNusimB7HMqQyZBp40oi90AgQ+S5B1bBaKqkN8GEzqc5vKLVNIfdrx6i98j6DzKJlUAup9S4XrIy0NYIb+7o00MrYFylMQcFxfNofbq39T/7QCV0pqYQl0h2PiVCQfhgOJp9geeXnIwhp9PoD4fK7n/vgGPnyv9fCLZTP4ihUltxKxmPWqJapL4EdDQkcNt9xjmWrN4YX7bPmUx0347G3RVxHThdANlkA4YbiDY8dEfKnVu5wQUhIac49XnwRzNJJQlmgaWLTcC+eZLuPoIZmvM7Cnt4pGGBGWxivs0x/WbnPG6+1PAuDdC6aXK9ehBqneMTA37igCt/d/kO4gJ4v4oGsNt/toAdiNpzUAs0ssx9ktV2w2mrg X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: In afs_wait_for_operation(), we set transcribe the call responded flag to the server record that we used after doing the fileserver iteration loop - but it's possible to exit the loop having had a response from the server that we've discarded (e.g. it returned an abort or we started receiving data, but the call didn't complete). This means that op->server might be NULL, but we don't check that before attempting to set the server flag. Fixes: 98f9fda2057b ("afs: Fold the afs_addr_cursor struct in") Signed-off-by: David Howells cc: Marc Dionne cc: linux-afs@lists.infradead.org --- fs/afs/fs_operation.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/afs/fs_operation.c b/fs/afs/fs_operation.c index 3546b087e791..428721bbe4f6 100644 --- a/fs/afs/fs_operation.c +++ b/fs/afs/fs_operation.c @@ -201,7 +201,7 @@ void afs_wait_for_operation(struct afs_operation *op) } } - if (op->call_responded) + if (op->call_responded && op->server) set_bit(AFS_SERVER_FL_RESPONDING, &op->server->flags); if (!afs_op_error(op)) {