Hi Greg,
We'll need to debug this further to understand what's going on.
Hi Salvatore,
Any chance that you'll be able to provide us the cifsFYI logs from the time of mount failure?
https://wiki.samba.org/index.php/LinuxCIFS_troubleshooting#Enabling_Debugging
Regards,
Shyam
-----Original Message-----
From: Greg Kroah-Hartman <[email protected]>
Sent: Tuesday, April 6, 2021 7:12 PM
To: Salvatore Bonaccorso <[email protected]>
Cc: [email protected]; [email protected]; Shyam Prasad <[email protected]>; Aurelien Aptel <[email protected]>; Steven French <[email protected]>; Sasha Levin <[email protected]>
Subject: [EXTERNAL] Re: [PATCH 4.19 013/247] cifs: Set CIFS_MOUNT_USE_PREFIX_PATH flag on setting cifs_sb->prepath.
On Tue, Apr 06, 2021 at 01:38:24PM +0200, Salvatore Bonaccorso wrote:
> Hi,
>
> On Mon, Mar 01, 2021 at 05:10:33PM +0100, Greg Kroah-Hartman wrote:
> > From: Shyam Prasad N <[email protected]>
> >
> > [ 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 <[email protected]>
> > Reviewed-by: Aurelien Aptel <[email protected]>
> > Signed-off-by: Steve French <[email protected]>
> > Signed-off-by: Sasha Levin <[email protected]>
> > ---
> > fs/cifs/connect.c | 1 +
> > 1 file changed, 1 insertion(+)
> >
> > diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c index
> > 6285085195c15..632249ce61eba 100644
> > --- a/fs/cifs/connect.c
> > +++ b/fs/cifs/connect.c
> > @@ -3882,6 +3882,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;
>
> A user in Debian reported an issue with mounts of DFS shares after an
> update in Debian from 4.19.177 to 4.181:
>
> https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Flist
> s.debian.org%2Fdebian-user%2F2021%2F04%2Fmsg00062.html&data=04%7C0
> 1%7CShyam.Prasad%40microsoft.com%7C0acbccd2643f4d55c6d008d8f901c180%7C
> 72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637533133251645484%7CUnknow
> n%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLC
> JXVCI6Mn0%3D%7C1000&sdata=9xz2q%2FC1ur%2F3y70L5CJ5YoL%2FLhSci5hJ3U
> pttjbZJas%3D&reserved=0
>
> In a test setup i was able to reproduce the issue with 4.19.184 itself
> (but interestingly not withing the 5.10.y series, checked 5.10.26)
> which both contain the above commit.
>
> 4.19.184 with a738c93fb1c1 ("cifs: Set CIFS_MOUNT_USE_PREFIX_PATH flag
> on setting cifs_sb->prepath.") reverted fixes the issue.
>
> Is there probably some missing prerequisites missing in the 4.19.y
> brach? I could not test othr versions, but maybe other versions are
> affected as well as before 4.19.y, as the commit was backported to
> 4.14.223 as well.
If there is a missing patch, we will be glad to take it, does 5.4 also have this problem?
thanks,
greg k-h
Hi,
On Tue, Apr 06, 2021 at 02:00:48PM +0000, Shyam Prasad wrote:
> Hi Greg,
> We'll need to debug this further to understand what's going on.
Greg asked it the same happens with 5.4 as well, I do not know I was
not able to test 5.4.y (yet) but only 5.10.y and 4.19.y.
>
> Hi Salvatore,
> Any chance that you'll be able to provide us the cifsFYI logs from the time of mount failure?
> https://wiki.samba.org/index.php/LinuxCIFS_troubleshooting#Enabling_Debugging
Please find it attached. Is this enough information?
The mentioned home DFS link 'home' is a DFS link to
msdfs:SECONDHOST\REDACTED on a Samba host.
The mount is triggered as
mount -t cifs //HOSTIP/REDACTED/home /mnt --verbose -o username='REDACTED,domain=DOMAIN'
Regards,
Salvatore
Hi Shyam,
On Tue, Apr 06, 2021 at 05:01:17PM +0200, Salvatore Bonaccorso wrote:
> Hi,
>
> On Tue, Apr 06, 2021 at 02:00:48PM +0000, Shyam Prasad wrote:
> > Hi Greg,
> > We'll need to debug this further to understand what's going on.
>
> Greg asked it the same happens with 5.4 as well, I do not know I was
> not able to test 5.4.y (yet) but only 5.10.y and 4.19.y.
> >
> > Hi Salvatore,
> > Any chance that you'll be able to provide us the cifsFYI logs from the time of mount failure?
> > https://wiki.samba.org/index.php/LinuxCIFS_troubleshooting#Enabling_Debugging
>
> Please find it attached. Is this enough information?
>
> The mentioned home DFS link 'home' is a DFS link to
> msdfs:SECONDHOST\REDACTED on a Samba host.
>
> The mount is triggered as
>
> mount -t cifs //HOSTIP/REDACTED/home /mnt --verbose -o username='REDACTED,domain=DOMAIN'
So I can confirm the issue is both present in 4.19.185 and 5.4.110
upstream (without any Debian patches applied, we do not anyway apply
any cifs related one on top of the respetive upstream version).
The issue is not present in 5.10.28.
So I think there are commits as dependency of a738c93fb1c1 ("cifs: Set
CIFS_MOUNT_USE_PREFIX_PATH flag on setting cifs_sb->prepath.") which
are required and not applied in the released before 5.10.y which make
introducing the regression.
Regards,
Salvatore
On Thu, Apr 08, 2021 at 01:41:05PM +0200, Salvatore Bonaccorso wrote:
> Hi Shyam,
>
> On Tue, Apr 06, 2021 at 05:01:17PM +0200, Salvatore Bonaccorso wrote:
> > Hi,
> >
> > On Tue, Apr 06, 2021 at 02:00:48PM +0000, Shyam Prasad wrote:
> > > Hi Greg,
> > > We'll need to debug this further to understand what's going on.
> >
> > Greg asked it the same happens with 5.4 as well, I do not know I was
> > not able to test 5.4.y (yet) but only 5.10.y and 4.19.y.
> > >
> > > Hi Salvatore,
> > > Any chance that you'll be able to provide us the cifsFYI logs from the time of mount failure?
> > > https://wiki.samba.org/index.php/LinuxCIFS_troubleshooting#Enabling_Debugging
> >
> > Please find it attached. Is this enough information?
> >
> > The mentioned home DFS link 'home' is a DFS link to
> > msdfs:SECONDHOST\REDACTED on a Samba host.
> >
> > The mount is triggered as
> >
> > mount -t cifs //HOSTIP/REDACTED/home /mnt --verbose -o username='REDACTED,domain=DOMAIN'
>
> So I can confirm the issue is both present in 4.19.185 and 5.4.110
> upstream (without any Debian patches applied, we do not anyway apply
> any cifs related one on top of the respetive upstream version).
>
> The issue is not present in 5.10.28.
>
> So I think there are commits as dependency of a738c93fb1c1 ("cifs: Set
> CIFS_MOUNT_USE_PREFIX_PATH flag on setting cifs_sb->prepath.") which
> are required and not applied in the released before 5.10.y which make
> introducing the regression.
Ok, I've dropped this from 5.4 and older kernel trees now, thanks for
the report.
greg k-h
Hi Greg,
On Mon, Apr 12, 2021 at 10:01:33AM +0200, Greg Kroah-Hartman wrote:
> On Thu, Apr 08, 2021 at 01:41:05PM +0200, Salvatore Bonaccorso wrote:
> > Hi Shyam,
> >
> > On Tue, Apr 06, 2021 at 05:01:17PM +0200, Salvatore Bonaccorso wrote:
> > > Hi,
> > >
> > > On Tue, Apr 06, 2021 at 02:00:48PM +0000, Shyam Prasad wrote:
> > > > Hi Greg,
> > > > We'll need to debug this further to understand what's going on.
> > >
> > > Greg asked it the same happens with 5.4 as well, I do not know I was
> > > not able to test 5.4.y (yet) but only 5.10.y and 4.19.y.
> > > >
> > > > Hi Salvatore,
> > > > Any chance that you'll be able to provide us the cifsFYI logs from the time of mount failure?
> > > > https://wiki.samba.org/index.php/LinuxCIFS_troubleshooting#Enabling_Debugging
> > >
> > > Please find it attached. Is this enough information?
> > >
> > > The mentioned home DFS link 'home' is a DFS link to
> > > msdfs:SECONDHOST\REDACTED on a Samba host.
> > >
> > > The mount is triggered as
> > >
> > > mount -t cifs //HOSTIP/REDACTED/home /mnt --verbose -o username='REDACTED,domain=DOMAIN'
> >
> > So I can confirm the issue is both present in 4.19.185 and 5.4.110
> > upstream (without any Debian patches applied, we do not anyway apply
> > any cifs related one on top of the respetive upstream version).
> >
> > The issue is not present in 5.10.28.
> >
> > So I think there are commits as dependency of a738c93fb1c1 ("cifs: Set
> > CIFS_MOUNT_USE_PREFIX_PATH flag on setting cifs_sb->prepath.") which
> > are required and not applied in the released before 5.10.y which make
> > introducing the regression.
>
> Ok, I've dropped this from 5.4 and older kernel trees now, thanks for
> the report.
Thanks Greg! Shyam, Steven, now the commit was reverted for the older
brnaches. But did you got a chance to find why it breaks for the older
series?
Regards,
Salvatore
<Including Paulo in this email thread>
Hi Salvatore,
Attached is a proposed fix from Paulo for older kernels.
Can you please confirm that this works for you too?
Regards,
Shyam
-----Original Message-----
From: Salvatore Bonaccorso <[email protected]> On Behalf Of Salvatore Bonaccorso
Sent: Sunday, April 18, 2021 6:11 PM
To: Greg Kroah-Hartman <[email protected]>
Cc: Shyam Prasad <[email protected]>; [email protected]; [email protected]; Aurelien Aptel <[email protected]>; Steven French <[email protected]>; Sasha Levin <[email protected]>
Subject: Re: [EXTERNAL] Re: [PATCH 4.19 013/247] cifs: Set CIFS_MOUNT_USE_PREFIX_PATH flag on setting cifs_sb->prepath.
Hi Greg,
On Mon, Apr 12, 2021 at 10:01:33AM +0200, Greg Kroah-Hartman wrote:
> On Thu, Apr 08, 2021 at 01:41:05PM +0200, Salvatore Bonaccorso wrote:
> > Hi Shyam,
> >
> > On Tue, Apr 06, 2021 at 05:01:17PM +0200, Salvatore Bonaccorso wrote:
> > > Hi,
> > >
> > > On Tue, Apr 06, 2021 at 02:00:48PM +0000, Shyam Prasad wrote:
> > > > Hi Greg,
> > > > We'll need to debug this further to understand what's going on.
> > >
> > > Greg asked it the same happens with 5.4 as well, I do not know I
> > > was not able to test 5.4.y (yet) but only 5.10.y and 4.19.y.
> > > >
> > > > Hi Salvatore,
> > > > Any chance that you'll be able to provide us the cifsFYI logs from the time of mount failure?
> > > > https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%
> > > > 2Fwiki.samba.org%2Findex.php%2FLinuxCIFS_troubleshooting%23Enabl
> > > > ing_Debugging&data=04%7C01%7CShyam.Prasad%40microsoft.com%7C
> > > > 3f7f5a39dd974cacf6aa08d902674040%7C72f988bf86f141af91ab2d7cd011d
> > > > b47%7C1%7C0%7C637543465194151840%7CUnknown%7CTWFpbGZsb3d8eyJWIjo
> > > > iMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C10
> > > > 00&sdata=nH2tcSzqFzzqLZ2RIARR008%2FuvBEdDHEnjKpVXhzIdk%3D&am
> > > > p;reserved=0
> > >
> > > Please find it attached. Is this enough information?
> > >
> > > The mentioned home DFS link 'home' is a DFS link to
> > > msdfs:SECONDHOST\REDACTED on a Samba host.
> > >
> > > The mount is triggered as
> > >
> > > mount -t cifs //HOSTIP/REDACTED/home /mnt --verbose -o username='REDACTED,domain=DOMAIN'
> >
> > So I can confirm the issue is both present in 4.19.185 and 5.4.110
> > upstream (without any Debian patches applied, we do not anyway apply
> > any cifs related one on top of the respetive upstream version).
> >
> > The issue is not present in 5.10.28.
> >
> > So I think there are commits as dependency of a738c93fb1c1 ("cifs:
> > Set CIFS_MOUNT_USE_PREFIX_PATH flag on setting cifs_sb->prepath.")
> > which are required and not applied in the released before 5.10.y
> > which make introducing the regression.
>
> Ok, I've dropped this from 5.4 and older kernel trees now, thanks for
> the report.
Thanks Greg! Shyam, Steven, now the commit was reverted for the older brnaches. But did you got a chance to find why it breaks for the older series?
Regards,
Salvatore
Salvatore Bonaccorso <[email protected]> writes:
> Thanks Greg! Shyam, Steven, now the commit was reverted for the older
> brnaches. But did you got a chance to find why it breaks for the older
> series?
That commit has revealed another bug in cifs_mount() where we failed to
update the super's prefix path after chasing DFS referrals.
Newer kernel versions do not have it because the code & logic in
cifs_mount() changed entirely.
Hi Shyam,
On Mon, Apr 19, 2021 at 05:48:24AM +0000, Shyam Prasad wrote:
> <Including Paulo in this email thread>
>
> Hi Salvatore,
>
> Attached is a proposed fix from Paulo for older kernels.
> Can you please confirm that this works for you too?
So just to be clear, first apply again a738c93fb1c1 and then your
additional patch on top?
Regards,
Salvatore
Salvatore Bonaccorso <[email protected]> writes:
> So just to be clear, first apply again a738c93fb1c1 and then your
> additional patch on top?
Yes.
Hi Shyam,
On Mon, Apr 19, 2021 at 05:48:24AM +0000, Shyam Prasad wrote:
> <Including Paulo in this email thread>
>
> Hi Salvatore,
>
> Attached is a proposed fix from Paulo for older kernels.
> Can you please confirm that this works for you too?
I re-applied commit a738c93fb1c1 ("cifs: Set
CIFS_MOUNT_USE_PREFIX_PATH flag on setting cifs_sb->prepath.") and on
top of that your provided patch, and this seems to resolve the issue
for the testcase I have at hand!
Regards,
Salvatore
Hi!
On Abr 19 2021, Shyam Prasad wrote:
> Hi Salvatore,
>
> Attached is a proposed fix from Paulo for older kernels.
> Can you please confirm that this works for you too?
Salvatore pinged me for some tests on this, I did apply this patch on top of
Debian's 4.19.181-1 which was failing and it now works as expected.
Regards.
--
Manty/BestiaTester -> http://manty.net
Hi Salvatore and Santiago,
Thanks for testing this out.
@Greg Kroah-Hartman: The reverted patch used in combination with Paulo's fix seems to fix both use cases.
Can we have both these taken in on stable kernels? Paulo's patch is needed only for kernels 5.10 and older.
Regards,
Shyam
-----Original Message-----
From: Salvatore Bonaccorso <[email protected]> On Behalf Of Salvatore Bonaccorso
Sent: Monday, April 19, 2021 10:39 PM
To: Shyam Prasad <[email protected]>
Cc: Greg Kroah-Hartman <[email protected]>; pc <[email protected]>; [email protected]; [email protected]; Aurelien Aptel <[email protected]>; Steven French <[email protected]>; Sasha Levin <[email protected]>
Subject: Re: [EXTERNAL] Re: [PATCH 4.19 013/247] cifs: Set CIFS_MOUNT_USE_PREFIX_PATH flag on setting cifs_sb->prepath.
Hi Shyam,
On Mon, Apr 19, 2021 at 05:48:24AM +0000, Shyam Prasad wrote:
> <Including Paulo in this email thread>
>
> Hi Salvatore,
>
> Attached is a proposed fix from Paulo for older kernels.
> Can you please confirm that this works for you too?
I re-applied commit a738c93fb1c1 ("cifs: Set CIFS_MOUNT_USE_PREFIX_PATH flag on setting cifs_sb->prepath.") and on top of that your provided patch, and this seems to resolve the issue for the testcase I have at hand!
Regards,
Salvatore
On Thu, Apr 22, 2021 at 03:36:07PM +0000, Shyam Prasad wrote:
> Hi Salvatore and Santiago,
>
> Thanks for testing this out.
>
> @Greg Kroah-Hartman: The reverted patch used in combination with Paulo's fix seems to fix both use cases.
> Can we have both these taken in on stable kernels? Paulo's patch is needed only for kernels 5.10 and older.
I do not know what "both" is here at all.
Please resubmit all of the needed commits in a format that I can apply
them in, and I will be glad to review them and queue them up.
Note, patches that are not in Linus's tree better be documented really
really really really well for why that is not so...
thanks,
greg k-h
Shyam, Paulo,
On Fri, Apr 23, 2021 at 09:42:35AM +0200, Greg Kroah-Hartman wrote:
> On Thu, Apr 22, 2021 at 03:36:07PM +0000, Shyam Prasad wrote:
> > Hi Salvatore and Santiago,
> >
> > Thanks for testing this out.
> >
> > @Greg Kroah-Hartman: The reverted patch used in combination with Paulo's fix seems to fix both use cases.
> > Can we have both these taken in on stable kernels? Paulo's patch is needed only for kernels 5.10 and older.
>
> I do not know what "both" is here at all.
>
> Please resubmit all of the needed commits in a format that I can apply
> them in, and I will be glad to review them and queue them up.
>
> Note, patches that are not in Linus's tree better be documented really
> really really really well for why that is not so...
Did you saw the ping from Greg? Otherwise I think the situation as it
is now for the older stable series is probably just as fine as it is
now with the repsective original commit reverted.
Regards,
Salvatore
Hi Salvatore,
Thanks for reminding me. I had to do some reading to reply to this one.
The situation right now is this:
The patch "cifs: Set CIFS_MOUNT_USE_PREFIX_PATH flag on setting cifs_sb->prepath." has been reverted. Which means that the DFS bug which you originally faced will not be seen.
Hi Greg,
Here are the two patches which I'm referring to:
1. cifs: Set CIFS_MOUNT_USE_PREFIX_PATH flag on setting cifs_sb->prepath.
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?h=v5.12&id=a738c93fb1c17e386a09304b517b1c6b2a6a5a8b
This fixed an issue when two cifs mount points shared a common prefix in the path which they mounted from the same server. The patch was marked for CC:stable considering that this fix can be important for some users.
However, there was a dependent change for DFS scenario, which is present in the Linus' mainline tree, but were not marked for CC:stable, so missing from the stable trees.
Due to the missing dependent changes, DFS users faced issues with pre-5.11 kernels, and this patch was reverted in the stable trees.
2. Due to a major change that went into the 5.11 kernel (the new mount API support), the code differs significantly, and the missing patch cannot be applied to pre-5.11 trees.
Hence, Paulo submitted the attached patch (cifs: fix prefix path in dfs mounts), which fixes this for pre-5.11 kernels.
I was referring to these two patches to be applied to all stable trees. Salvatore has verified that with both patches applied, the DFS scenario starts working again.
@Paulo Alcantara Please add if I missed something here.
Regards,
Shyam
-----Original Message-----
From: Salvatore Bonaccorso <[email protected]> On Behalf Of Salvatore Bonaccorso
Sent: Saturday, May 8, 2021 6:52 PM
To: Greg Kroah-Hartman <[email protected]>
Cc: Shyam Prasad <[email protected]>; pc <[email protected]>; [email protected]; [email protected]; Aurelien Aptel <[email protected]>; Steven French <[email protected]>; Sasha Levin <[email protected]>
Subject: Re: [EXTERNAL] Re: [PATCH 4.19 013/247] cifs: Set CIFS_MOUNT_USE_PREFIX_PATH flag on setting cifs_sb->prepath.
Shyam, Paulo,
On Fri, Apr 23, 2021 at 09:42:35AM +0200, Greg Kroah-Hartman wrote:
> On Thu, Apr 22, 2021 at 03:36:07PM +0000, Shyam Prasad wrote:
> > Hi Salvatore and Santiago,
> >
> > Thanks for testing this out.
> >
> > @Greg Kroah-Hartman: The reverted patch used in combination with Paulo's fix seems to fix both use cases.
> > Can we have both these taken in on stable kernels? Paulo's patch is needed only for kernels 5.10 and older.
>
> I do not know what "both" is here at all.
>
> Please resubmit all of the needed commits in a format that I can apply
> them in, and I will be glad to review them and queue them up.
>
> Note, patches that are not in Linus's tree better be documented really
> really really really well for why that is not so...
Did you saw the ping from Greg? Otherwise I think the situation as it is now for the older stable series is probably just as fine as it is now with the repsective original commit reverted.
Regards,
Salvatore
A: http://en.wikipedia.org/wiki/Top_post
Q: Were do I find info about this thing called top-posting?
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing in e-mail?
A: No.
Q: Should I include quotations after my reply?
http://daringfireball.net/2007/07/on_top
On Sun, May 09, 2021 at 10:16:06AM +0000, Shyam Prasad wrote:
> Hi Salvatore,
>
> Thanks for reminding me. I had to do some reading to reply to this one.
> The situation right now is this:
> The patch "cifs: Set CIFS_MOUNT_USE_PREFIX_PATH flag on setting cifs_sb->prepath." has been reverted. Which means that the DFS bug which you originally faced will not be seen.
>
> Hi Greg,
>
> Here are the two patches which I'm referring to:
> 1. cifs: Set CIFS_MOUNT_USE_PREFIX_PATH flag on setting cifs_sb->prepath.
> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?h=v5.12&id=a738c93fb1c17e386a09304b517b1c6b2a6a5a8b
> This fixed an issue when two cifs mount points shared a common prefix in the path which they mounted from the same server. The patch was marked for CC:stable considering that this fix can be important for some users.
> However, there was a dependent change for DFS scenario, which is present in the Linus' mainline tree, but were not marked for CC:stable, so missing from the stable trees.
> Due to the missing dependent changes, DFS users faced issues with pre-5.11 kernels, and this patch was reverted in the stable trees.
So, you need that a738c93fb1c1 ("cifs: Set CIFS_MOUNT_USE_PREFIX_PATH
flag on setting cifs_sb->prepath.") merged to where exactly?
> 2. Due to a major change that went into the 5.11 kernel (the new mount API support), the code differs significantly, and the missing patch cannot be applied to pre-5.11 trees.
> Hence, Paulo submitted the attached patch (cifs: fix prefix path in dfs mounts), which fixes this for pre-5.11 kernels.
Can you submit this in a proper format (i.e. not dos line ends, and good
changelog and most importantly, YOUR signed off by on it saying that the
patch came through you?
Make this a 2 patch series please, and be specific as to what tree(s)
this needs to be backported to, and I will be glad to review it.
thnaks,
greg k-h