Received: by 2002:a05:6500:1b45:b0:1f5:f2ab:c469 with SMTP id cz5csp626725lqb; Wed, 17 Apr 2024 06:42:14 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWR4HUQw4MDCEkdnZ5xivOSoDsoaOhvZ7VFWKp9DebcZ5OFVq50NW/k3tNJFeWPMttK7prBGLTOn134CfPpGqs9vQeDZKvcrlXo1zfpgA== X-Google-Smtp-Source: AGHT+IGzWPcSdl6nnG7pg2C0FHDz4yblVlNbRVpratnZFx+2TYTEjwgMTRSJPf5H7xHNOHRxTRTn X-Received: by 2002:a19:3806:0:b0:513:30fb:d64 with SMTP id f6-20020a193806000000b0051330fb0d64mr10543247lfa.44.1713361334563; Wed, 17 Apr 2024 06:42:14 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713361334; cv=pass; d=google.com; s=arc-20160816; b=XjgAif8MMbCN4oKDWYOwZXwzRK+RdIfC0CaqmpILPANv1cpRDA55jgM6aJLuccQVYp oO3xcot4zpHugctLegH01wD5+4ThwwMV4C3wnY3IMnor3kBgMS0H2Kf58azNOBbUL6hc eyFdFoqb6z9IvJZHGL6Z3LLi/5VMTbJdl0e72RsBxl6JhoFccxjvnK1N2pOYId6SeygJ 8KizrNA2Sd22gRShD7RS04LJFyjh9FlsT1B0CrgbVVYcRQZG//qs+HuxISoB8MHQMNlL YbBez1XYM8Rgc5GGJSTyWGBEHHPbp7obhPpriQwVVGoAo6Alb44H4i61G3jtTLHjFxbf /qdw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=message-id:date:content-transfer-encoding:content-id:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:subject:cc:to :references:in-reply-to:from:organization:dkim-signature; bh=ngr4Dloj5AAsga8HGwFtYZk0llTT/AWVSmDZpIb9UnY=; fh=RmrgwBvlBsoHJiC3CToLMKynJ+P6a81botJaW0tIHgg=; b=CUTySR7SgYapV1yT+2nuI+S6SDxToMHSBOCl8ULMceZokizADbTaoBpGHPIpCjDdJj oA5KnSwzWDNH+UxR46qbZ/PkjaQq0qcVf6Ov4DqaDh6RzqhjUyaXhWuHrOM8Bv+FyjPV gGdeYlgmGbPB+ZdRHtLh8nL7WGrEUYrm+fGUjJOtOMcElqZ9Gnif/BsgT9cWDejkFgU8 ik8LvtSSRlKSKTjSlIzaH6VSjnTRP6Pd0VQ6CWTeUpZxnjadsG+Oo7WDjJaq3Xukrfv4 UudntAcC47PBxYvpM6ZUyXfsQCGopTNohVR/5xVH7q1lekLAbbd7kOBx0sprsN4YZp0p CR7Q==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=R4Jdsoqi; arc=pass (i=1 spf=pass spfdomain=redhat.com dkim=pass dkdomain=redhat.com dmarc=pass fromdomain=redhat.com); spf=pass (google.com: domain of linux-kernel+bounces-148608-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-148608-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id ji18-20020a170907981200b00a48f55ad57esi7118994ejc.392.2024.04.17.06.42.14 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Apr 2024 06:42:14 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-148608-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=R4Jdsoqi; arc=pass (i=1 spf=pass spfdomain=redhat.com dkim=pass dkdomain=redhat.com dmarc=pass fromdomain=redhat.com); spf=pass (google.com: domain of linux-kernel+bounces-148608-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-148608-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id A811D1F21363 for ; Wed, 17 Apr 2024 13:42:11 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id BEB1F13E411; Wed, 17 Apr 2024 13:42:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="R4Jdsoqi" Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 55F0813F43A for ; Wed, 17 Apr 2024 13:42:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713361323; cv=none; b=g8E6iBzeBONjF24uDaNh3vpVWPYWwaKvAD8u32rRyErXEly+yiYFiRSuEwEnptvyy3quelrBMV3FpdJDnplzKrnNKltcTaxEtoT8iszt4ew6+r3gQrBsAGnM+0e55yMdSbrHGZM75Au23FywvygEK5yL0S/EqShLCLwywEo0f+8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713361323; c=relaxed/simple; bh=HLLrrxZ3arOPYNguUU/bPL7+NzL4etri3swaPdLmmJk=; h=From:In-Reply-To:References:To:Cc:Subject:MIME-Version: Content-Type:Date:Message-ID; b=Vg1wHbbS36swaQbCseq4KRm/V5sHF1lChzHW5waRHVnz48FdMXdY2U9z7D3eJaqLtR7iCLMUHpRFAtsYks7EovXWb7iVE/OSJA3fT/zv3WOu7tcvtTctOIg2LuHj1D+uBn9Cv2n2P2nA8WNvUqSkBUO0TQnDvz8d3fLAM3GmY/c= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=R4Jdsoqi; arc=none smtp.client-ip=170.10.129.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1713361320; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ngr4Dloj5AAsga8HGwFtYZk0llTT/AWVSmDZpIb9UnY=; b=R4JdsoqiUVob4uS5SzNZfEonXddOA/vz1qoQe5Btd+FBKZ2TOwVBVG45SV76lFJng+hc+N yVknhKxDsYqzWRqknhKitLTzSNWnqNTE9tP7sMYDHzZPL3RFzcqp26Mmo12T+bhMHqbxMe 8nTiG2J7arHn8yHo1/WUn+oydc+3lZU= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-411-YrR0vHqyPQOHTneSpW2ncA-1; Wed, 17 Apr 2024 09:41:56 -0400 X-MC-Unique: YrR0vHqyPQOHTneSpW2ncA-1 Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) (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 mimecast-mx02.redhat.com (Postfix) with ESMTPS id 3CA2B8011AF; Wed, 17 Apr 2024 13:41:56 +0000 (UTC) Received: from warthog.procyon.org.uk (unknown [10.42.28.200]) by smtp.corp.redhat.com (Postfix) with ESMTP id 7059D492BC7; Wed, 17 Apr 2024 13:41:55 +0000 (UTC) Organization: Red Hat UK Ltd. Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod Street, Windsor, Berkshire, SI4 1TE, United Kingdom. Registered in England and Wales under Company Registration No. 3798903 From: David Howells In-Reply-To: <14e66691a65e3d05d3d8d50e74dfb366@manguebit.com> References: <14e66691a65e3d05d3d8d50e74dfb366@manguebit.com> <3756406.1712244064@warthog.procyon.org.uk> To: Paulo Alcantara Cc: dhowells@redhat.com, Steve French , Shyam Prasad N , linux-cifs@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] cifs: Fix reacquisition of volume cookie on still-live connection Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <188148.1713361310.1@warthog.procyon.org.uk> Content-Transfer-Encoding: quoted-printable Date: Wed, 17 Apr 2024 14:41:50 +0100 Message-ID: <188149.1713361310@warthog.procyon.org.uk> X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.9 Paulo Alcantara wrote: > > [!] Note: Looking at cifs_mount_get_tcon(), a more general solution ma= y > > actually be required. Reacquiring the volume cookie isn't the only th= ing > > that function does: it also partially reinitialises the tcon record wi= thout > > any locking - which may cause live filesystem ops already using the tc= on > > through a previous mount to malfunction. > = > Agreed. Looking over the code again, I'm not sure whether is actually necessary - = or whether it is necessary and will be a bit nasty to implement as it will require read locking also. Firstly, reset_cifs_unix_caps() seems to re-set tcon->fsUnixInfo.Capabilit= y and tcon->unix_ext, which it would presumably set to the same things - whi= ch is probably fine. However, cifs_qfs_tcon() makes RPC operations that reloads tcon->fsDevInfo= and tcon->fsAttrInfo - both of which may be being accessed without locks. smb2_qfs_tcon() and smb3_qfs_tcon() alters everything cifs_qfs_tcon() does= , plus a bunch of extra tcon members. Can this locally cached information change over time on the server whilst we have a connection to it? David