Received: by 2002:a05:6500:1b45:b0:1f5:f2ab:c469 with SMTP id cz5csp1320621lqb; Thu, 18 Apr 2024 06:44:16 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVWp8b+DU5QAoocFkqBb1TOp0iKcuv7Enr+mWN5YEEb6yxNg5JnIlCIarE8ufESAUTpwMX3ycuwqr0NfwUMbLEATmWsVtU2+jMRQTihiw== X-Google-Smtp-Source: AGHT+IF2lEXOnOLqjYZeKNCoziAE/o5RUvagK/eNGLkoKuWwuQpniFWvcDvTANN0aFrWY/2WCzSo X-Received: by 2002:a0c:ecc2:0:b0:6a0:5334:947 with SMTP id o2-20020a0cecc2000000b006a053340947mr2542745qvq.63.1713447856092; Thu, 18 Apr 2024 06:44:16 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713447856; cv=pass; d=google.com; s=arc-20160816; b=jxndmcONw7HeVtgFNBVBo/UGz6ohpBZqeatO5pExtzDcM28c37SNOPX+XljCqs4X9F sngifLdePQA4d6PYhz+CNk/W6FyFF4CpX9XXqzEGk5vHH6zrM8+c3RyTOfLdrY4HvSLu nV4Hh1RNArbt1JsfXVYwtuSMbKPg7V5lUlPgfZqvT6d7HlxsO1Qx6fISwK0khnEyEHf7 6akZUVeChpAvaj3ujHqUCoQeKbS9g59XKNGjMsVhPlN4W4P4GyAh/T6PjaLfb4SaE4C4 ObGt47b0wTT71zjGLmjNKfqcT5KdmxHz21sjWwxzElMSW8JQ0g1Sq4jiXYtxa5Cp+1Lh im0A== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=message-id:date:content-id:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:subject:cc:to:references :in-reply-to:from:organization:dkim-signature; bh=S0S8YregP25P1OBV5UbC9sms8BvW3U0pJ4XCK6GLxag=; fh=RmrgwBvlBsoHJiC3CToLMKynJ+P6a81botJaW0tIHgg=; b=rZmeDiWtFbsRj+FX09NNscoAJifmAHuUK6BDH7I+VTZPF1DrsOCe8wZBm13iy4fuzG iKe9xnv+56u4Q3G1Ki/P/bmBRnWZMybZwAUQan5rs8JIGx8tNwYVCvrHPR/rl04fBywe ovT7TamCfcNs+tmrYQ0AjY7FWKT6OV1Mj4KJwqEg9FWTGmyXk0yY0Bjf1zptou2I+tzb 9BSbsTjpPRiQTy6yGGGbIh57KrhpzW34gGQTADJ0pbM28C+BCC1srT0pY1lVDbjR2yfd QA6ziw0lkJyY1trmLvz1s2o/+55gOF+KCdQQzrMbkCiLaGgYK9cYqVWr0fi8SIeY8Y0r HT0g==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=YnIPayUH; 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-150190-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-150190-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id iw12-20020a0562140f2c00b006992fb629adsi1526260qvb.135.2024.04.18.06.44.15 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 18 Apr 2024 06:44:16 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-150190-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=YnIPayUH; 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-150190-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-150190-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id CEF1E1C204F5 for ; Thu, 18 Apr 2024 13:44:15 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 42229161331; Thu, 18 Apr 2024 13:44:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="YnIPayUH" 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 1910C156F54 for ; Thu, 18 Apr 2024 13:44:05 +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=1713447847; cv=none; b=NtFBG/YGnTa96wyWJo1TQrwn4j3dpt0pmQNsVGtWdgh/Q9ckG636qrewkgBZXvm69RjAE7oRA/ZMKL6SPA00FXiOsLXbPUQV86mcD017yOJHpP4eqRymf42pPbxeL6UyO2kPzuicXzlkf/1ZL5cg2gvMA8uEtIpRUp7wUZg8pfc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713447847; c=relaxed/simple; bh=Iwmm4vK6K8VJ12C1Oel8qG6yhGbv1FUmWa6BqBjk/1c=; h=From:In-Reply-To:References:To:Cc:Subject:MIME-Version: Content-Type:Date:Message-ID; b=d8fXykmpb0ZlXLPtlm3ob7sPwAISdgcrRl1fYaK+8gKLXZqS1/pQ5bgqsjiQqJA3y0+eTE3ep8JHIG1y+Y0QFsog6VSW5OD6IktXf3CjkH6MO3Ck5d4snCkPr62lW7NsicRVl8CHiyERF2NbkHWerkBnu/o2C6idBzYHyDZxeXw= 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=YnIPayUH; 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=1713447845; 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=S0S8YregP25P1OBV5UbC9sms8BvW3U0pJ4XCK6GLxag=; b=YnIPayUHqITU2m24NhRVv8T0JbGS7sslBRsgGnFzsNrT56TP5nq1tmO7KZDC42JLeHdOts Atejm/YgidaUzZJLJnPATVlabTCb8uHEb45mIvBXJeyNQKiarTCJbw/d2R/nEf+P+V4/Yp IPp1eJZelnVYJ7IcxWviNtQu3XOfIeA= 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-257-0B34hqk0Pq6zo_RaertJrg-1; Thu, 18 Apr 2024 09:44:01 -0400 X-MC-Unique: 0B34hqk0Pq6zo_RaertJrg-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (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 56B1B18B1847; Thu, 18 Apr 2024 13:44:01 +0000 (UTC) Received: from warthog.procyon.org.uk (unknown [10.42.28.200]) by smtp.corp.redhat.com (Postfix) with ESMTP id 36B4E2166B32; Thu, 18 Apr 2024 13:44:00 +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: <59c322dc49c3cc76a4b6a2de35106c61@manguebit.com> References: <59c322dc49c3cc76a4b6a2de35106c61@manguebit.com> <1a94a15e6863d3844f0bcb58b7b1e17a@manguebit.com> <14e66691a65e3d05d3d8d50e74dfb366@manguebit.com> <3756406.1712244064@warthog.procyon.org.uk> <2713340.1713286722@warthog.procyon.org.uk> <277920.1713364693@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: <564519.1713447839.1@warthog.procyon.org.uk> Date: Thu, 18 Apr 2024 14:43:59 +0100 Message-ID: <564520.1713447839@warthog.procyon.org.uk> X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.6 Paulo Alcantara wrote: > I don't know why it was designed that way, but the reason we have two > different superblocks with ${opts} being the same is because cifs.ko > relies on the value of cifs_sb_info::prepath to build paths out of > dentries. See build_path_from_dentry(). So, when you access > /mnt/2/foo, cifs.ko will build a path like '[optional tree name prefix] > + cifs_sb_info::prepath + \foo' and then reuse connections > (server+session+tcon) from first superblock to perform I/O on that file. Yep. You don't *need* prepath. You could always build from the sb->s_root without a prepath and have mnt->mnt_root offset the place the VFS thinks you are: [rootdir]/ <--- s_root points here | v foo/ | v bar/ <--- mnt_root points here | v a Without prepath, you build back up the tree { a, bar/, foo/, [rootdir] } with prepath you insert the prepath at the end. Bind mounts just make the VFS think it's starting midway down, but you build up back to s_root. Think of a mount as just referring to a subtree of the tree inside the superblock. The prepath is just an optimisation - but possibly one that makes sense for cifs if you're having to do pathname fabrication a lot. David