Received: by 2002:ab2:6203:0:b0:1f5:f2ab:c469 with SMTP id o3csp872458lqt; Fri, 19 Apr 2024 13:04:39 -0700 (PDT) X-Forwarded-Encrypted: i=4; AJvYcCW9wSvBOWk8oikEG2vWE/OwQS8fDq9S495L2tZtmuy1xmZ/dTuKjI9wxMfLcKpaBc+NhC8aubmFlCu441woVb+L4WUvX7QOu7PsAZFPZg== X-Google-Smtp-Source: AGHT+IHz1HLUVO3oM7TTMYsOfekZ224xLoRwYKHejg+rGiVMgHpW/EIRZCMyG66dy+Ud9sw+/BVj X-Received: by 2002:a05:6808:2a89:b0:3c6:d15:c3d9 with SMTP id fc9-20020a0568082a8900b003c60d15c3d9mr3849866oib.34.1713557079513; Fri, 19 Apr 2024 13:04:39 -0700 (PDT) ARC-Seal: i=3; a=rsa-sha256; t=1713557079; cv=pass; d=google.com; s=arc-20160816; b=FFA8kAjM2nI2gvnwTt7+s+k1aC9g4DLAu5EMPrIY2tEI6vg0eFJFJhjfDQ/7SpBW1s jTbjCK3A0Ck+vbNKS5Ae4YYMwfoaH/ptmlgdgalbl/UJkCGvk3YXvYhGJLmi5UvOBy05 0d8zCyJELFjHEWw/Z+g0VU5sPFQXI2m1v3JA7hQ+y1/Qx99C/qae1ajIkJb5+QYpUN6s 6v9Labnq7YeO2TyKozTGBlyqj4+IAeninnZE+nl07hD9JemUNCxKav04sSAC8cRnIRmR CP7gtB5XqsG0dwLLg6cPUM1JLf+ByDHDJayvHdxHC/39wVlvkS1aNaGvMxZvOBGcS6Hf l1lA== ARC-Message-Signature: i=3; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:list-unsubscribe:list-subscribe:list-id:precedence :date:references:in-reply-to:subject:cc:to:from:dkim-signature :message-id; bh=xrV4npIoXrOukeNblskQI/a7RrbB6geAAv/9nYneVY8=; fh=r+/hSrrlFF5W4L/d5Z/eVn2EaB0EwS76ZSqxt8YJ2J8=; b=uAloJA7HO0cA1IOBBqIVHL9i3AIV6RTUFU4SOW6A/OdGRK9qj9zsyrE1fQS+2WROA9 quG+VVPt82Nno5zAKhtAXqKum0a4YO+W/heV+HlNhAJr10rfNkdIJzaGEMYVBoKjai00 qU2T+U5Qet9pdpWFUUVVZqFBprT7graz+he2AdwNMS8Y2f6z1MwoSOxQrmHSrQs7TVaS QzY2s6PfnsDeK11o2H2rElfqe7yeaL4lgfQv7LqQcCrHIzzCQtg+Wb4IdHwjroL4AIzF 8SLNX1v8XBNjZg/rFj1lqsqRyyqxrO2k5h9zaYbjAHTjULoipeG5ipjAPdhb3mpQzD0Q FT2w==; dara=google.com ARC-Authentication-Results: i=3; mx.google.com; dkim=pass header.i=@manguebit.com header.s=dkim header.b=MndrY2dl; arc=pass (i=2 spf=pass spfdomain=manguebit.com dkim=pass dkdomain=manguebit.com dmarc=pass fromdomain=manguebit.com); spf=pass (google.com: domain of linux-kernel+bounces-151926-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-151926-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=manguebit.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id v36-20020a05622a18a400b004345fefbd57si4949197qtc.256.2024.04.19.13.04.39 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 Apr 2024 13:04:39 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-151926-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=@manguebit.com header.s=dkim header.b=MndrY2dl; arc=pass (i=2 spf=pass spfdomain=manguebit.com dkim=pass dkdomain=manguebit.com dmarc=pass fromdomain=manguebit.com); spf=pass (google.com: domain of linux-kernel+bounces-151926-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-151926-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=manguebit.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 2DC3C1C20C09 for ; Fri, 19 Apr 2024 20:04:39 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 6188A13C91B; Fri, 19 Apr 2024 20:04:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=manguebit.com header.i=@manguebit.com header.b="MndrY2dl" Received: from mx.manguebit.com (mx.manguebit.com [167.235.159.17]) (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 E0CA764F; Fri, 19 Apr 2024 20:04:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=pass smtp.client-ip=167.235.159.17 ARC-Seal:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713557059; cv=pass; b=H+1gpRA7tiu0mc9Iw/j7CohxUEnDO4d0GnFFsgwzl3v1xI/oE13qWkkIMJMWk/eza1aVJb/4tDfsNSsjVTNywRCVCeukKi0iI5Tl18ymJUGrnc5mGNaSar3v87rPyEENVbUTdrnjg8aMhBcsFIG6Sa5T0ycA6rH6cJ9lVgSD6KQ= ARC-Message-Signature:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713557059; c=relaxed/simple; bh=nQRHbFf+whsAutgS8E/DEWI1hSQ98s6TxkcRXoiAsaw=; h=Message-ID:From:To:Cc:Subject:In-Reply-To:References:Date: MIME-Version:Content-Type; b=UjNILivOAPShxuG8onYczUWfn6vYXpaa95VonD61D+W4DWDEhEl3G2TrWAzevNsUwBFNRmq8N+7NG7CFMX1tyzzQK5j545TF7+tu5XzzPpYZeKQgyh5bSuljXNAnPt12hOXxn8U2aQZKqCfSgp329URvgeWJgJS8Sxz8KG7/M6Q= ARC-Authentication-Results:i=2; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=manguebit.com; spf=pass smtp.mailfrom=manguebit.com; dkim=pass (2048-bit key) header.d=manguebit.com header.i=@manguebit.com header.b=MndrY2dl; arc=pass smtp.client-ip=167.235.159.17 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=manguebit.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=manguebit.com Message-ID: <5d354377e2ba2f8f4ed249bf7633fd71@manguebit.com> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=manguebit.com; s=dkim; t=1713557054; 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=xrV4npIoXrOukeNblskQI/a7RrbB6geAAv/9nYneVY8=; b=MndrY2dlBclKUU00zjjlwYecdn6Yf3Gr+rCrQuMUENn95CjZ0EM5vxFh2VS/V0DK+hKwhJ CXHZKDcsfMRoPpkpDnjLLzTiIO8j9v7jzfBnByI1xFwACv62OMyWIV0RDK6OLzU0374lbc ntppXYiygNOd40PECVRFMliM/TXW8uhMBKOgDdSzHyTNXbv5Q8e6y0an4Te9V2/XR6b2X4 pUOooqkwZbJeqG0LF/sbFcxuyIfLVwBZkLhbA0UFFz3HzoWgX7tZ8NC6fQWh2Ao79gYrno n90xWTdv4sx5qFcsUkg8CeoBJVQiNmmsLHkOp4yOftarkE4m4dC02UtlUk5RAg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=manguebit.com; s=dkim; t=1713557054; 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-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=xrV4npIoXrOukeNblskQI/a7RrbB6geAAv/9nYneVY8=; b=eic3Li+gaORjGGNXtWjzNpGkcOinIzBZbkO+HFgDDxfbgk6OCNssWIIWKGl3sc03HxY8Zh fYvtm40swjUirgUKrN9Rk/LtzXmdjutMkD2BqkAAGgJMWKoJRVf07YmWsbG7/gw9La06pQ i2n0gFMq5IOaXLMgamtXGEJQcn2KTontt1ciJhj4hDW6RvcHFPfdJVpTXzPMmnjpoK2DxD axWyOT6PboT6j69YCpmRboDdeLEG89IvtsjdINfV2msGo5qxp/do1igC8yLbYfsKUZOo+C hvUMuXD/ufk+1Xb1kV9ROPp3cUCrQ/cUQacjHSnhVEtoMYT+uFtKQiuYbdYWPg== ARC-Authentication-Results: i=1; ORIGINATING; auth=pass smtp.mailfrom=pc@manguebit.com ARC-Seal: i=1; s=dkim; d=manguebit.com; t=1713557054; a=rsa-sha256; cv=none; b=EEOh5ZIo+qn/E/U+YuyEsSXtxoNM3/Ot32BrkhnY2l0t/54cywhXFucFm9s08I/OiC0Efm kBtd3thicAe/Mc4vy2N9zxjxxQXE6+LBd7DX4ZyCaRoFIu1Pxr1TX5QyQZYgPHhSwowTfo hvvXmIYaLvDDZ66ygJd04jy15cnPMRQjuddxBCcCjBYGwbsj1ap2N0sH49BeL/+bB0bl7d TmquLpz0lMLteLK1lj9qDOCB7PaecYmIhR03EJZ1k4/KwW5Ce3oiOGqcd0MEJ7Beto7be7 eoVtKfG2vJdmV2dLcejnzaSULAwxGqrP+y5vne46Twrx49IBEUgtpDKXjPbW/w== From: Paulo Alcantara To: David Howells 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 In-Reply-To: <564520.1713447839@warthog.procyon.org.uk> 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> <564520.1713447839@warthog.procyon.org.uk> Date: Fri, 19 Apr 2024 17:04:11 -0300 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain David Howells writes: > 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. Thanks alot Dave! Great explanation. We also need to remember that those prefix paths can also be changed over reconnect. That is, if you're currently mounted to a DFS link target '\srv1\share' and client failovers to next target '\srv2\share\foo\bar', cifs_sb_info::prepath will be set to '\foo\bar'. And if you mounted the DFS link as `mount.cifs //dfs/link/some/dir`, cifs_sb_info::prepath would be set to '\some\dir\foo\bar'. Yeah, a lot of corner cases to handle... Anyways, don't worry much about all of this as we can handle in follow-up patches. FWIW, patch looks good: Acked-by: Paulo Alcantara (Red Hat)