Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp281589pxb; Thu, 25 Feb 2021 02:18:22 -0800 (PST) X-Google-Smtp-Source: ABdhPJyt6L9vWTwxjt1gmPrpIkCCSYUi75Hs4zw/QMYBM+yJmQKDE5ofi6vzH8pMv6TnpkV/choL X-Received: by 2002:a17:906:1956:: with SMTP id b22mr2056324eje.114.1614248302672; Thu, 25 Feb 2021 02:18:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614248302; cv=none; d=google.com; s=arc-20160816; b=PKZxCBfoKf6QTzw+PmkXjWtBmBcHIruZxxRi1GJF6Cg+X4HXwjFozDs0tAhwgyj5ep Uo3ZpkF1sg3C//1efuux12tDEZHjEWM7mLZcOairt6nO32taTe/6G+VdDgkv27uqYkWN jrm6/jpjDRk2WDubatedI86l3JxsLjVhzeai5e4c0spmsgx79QUC4WPfHvlhDXBai0V0 6qfk7YQLGuJxOdVLwVPoh3LdmSWbQ276ko+B5MudLSRjA8vni8e59IhlhYYmEe0gdbGD HTKBen8qTUQcjFD6anHaTGJyTw9LRK2D9RpF1l4Q66TCjLuujsbrPDYkaanMWSv4M+jA l7pw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=r6PRFUgS0AIsvbObmbyzUvHfjbeQxzDWqpW/Olj8gEM=; b=WTUt5DNl/00GOI7e7EeEyDvUQC0Zw0QskwGHbSSdO27JpkNa/Advx3nNcPB5iSPj1J ySOmb18jpWnl/1BwnWjco4xKGwUyRAbjENt8K+Kqh3HAEqtDjzDsR6SwoBPDN8DGgh6R TOPpRxFDRIsWmXAe2UUl+0nWyd9m4OxoQOW2TYFVdP5iWOFzKorojfB2piEMB1G9t8EY FRtJnxq0akyV+9APQiLOp/c1ZyAoY6j8UJHb/3F4BN462gJE1pGa+SP0IKfEeyjBaKcp VnuXpZ4XOXQ4x/i6OKOk82JbjGm7jxxciGlVqV8NLc90yrLbV6pb2EPHPa4ZIjEYMmmv Gi5A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=zj3qsV8E; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id ec1si3230603ejb.598.2021.02.25.02.17.59; Thu, 25 Feb 2021 02:18:22 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=zj3qsV8E; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234545AbhBYKRI (ORCPT + 99 others); Thu, 25 Feb 2021 05:17:08 -0500 Received: from mail.kernel.org ([198.145.29.99]:33484 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234896AbhBYKAV (ORCPT ); Thu, 25 Feb 2021 05:00:21 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 295AE64F22; Thu, 25 Feb 2021 09:55:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1614246934; bh=QCU3pzLQ0hRpTMsZSfrMYcsdc4VS2H5Y1JGXc2aBxTs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=zj3qsV8E+GcXVvnz6wCB3gpT0GFDe766VIhmfjmb4AodGlR1pfSCkpD61tlI5nNWN SOHrw6dEkK7bZgQh91WqS9fVSl/Cjv5l+Bu5drVori+mi65SWQWaxear7APLtxo16s ruuSuxJVnmFc0JZnPiVBfLHcTHJsBUhrhYcTilc0= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Shyam Prasad N , Aurelien Aptel , Steve French , Sasha Levin Subject: [PATCH 5.10 21/23] cifs: Set CIFS_MOUNT_USE_PREFIX_PATH flag on setting cifs_sb->prepath. Date: Thu, 25 Feb 2021 10:53:52 +0100 Message-Id: <20210225092517.539987047@linuxfoundation.org> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210225092516.531932232@linuxfoundation.org> References: <20210225092516.531932232@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Shyam Prasad N [ Upstream commit a738c93fb1c17e386a09304b517b1c6b2a6a5a8b ] While debugging another issue today, Steve and I noticed that if a subdir for a file share is already mounted on the client, any new mount of any other subdir (or the file share root) of the same share results in sharing the cifs superblock, which e.g. can result in incorrect device name. While setting prefix path for the root of a cifs_sb, CIFS_MOUNT_USE_PREFIX_PATH flag should also be set. Without it, prepath is not even considered in some places, and output of "mount" and various /proc/<>/*mount* related options can be missing part of the device name. Signed-off-by: Shyam Prasad N Reviewed-by: Aurelien Aptel Signed-off-by: Steve French Signed-off-by: Sasha Levin --- fs/cifs/connect.c | 1 + 1 file changed, 1 insertion(+) diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c index 44f9cce570995..ad3ecda1314d9 100644 --- a/fs/cifs/connect.c +++ b/fs/cifs/connect.c @@ -4007,6 +4007,7 @@ int cifs_setup_cifs_sb(struct smb_vol *pvolume_info, cifs_sb->prepath = kstrdup(pvolume_info->prepath, GFP_KERNEL); if (cifs_sb->prepath == NULL) return -ENOMEM; + cifs_sb->mnt_cifs_flags |= CIFS_MOUNT_USE_PREFIX_PATH; } return 0; -- 2.27.0