RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 786149 - CIFS DFS doesn't work in kernel versions 2.6.32-220.x.x.el6.x86_64
Summary: CIFS DFS doesn't work in kernel versions 2.6.32-220.x.x.el6.x86_64
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: kernel
Version: 6.1
Hardware: x86_64
OS: Linux
high
high
Target Milestone: rc
: 6.3
Assignee: Ian Kent
QA Contact: Jian Li
URL:
Whiteboard:
Depends On:
Blocks: 1020715 1069097
TreeView+ depends on / blocked
 
Reported: 2012-01-31 15:36 UTC by chris.petty
Modified: 2018-11-27 20:09 UTC (History)
11 users (show)

Fixed In Version: kernel-2.6.32-270.el6
Doc Type: Bug Fix
Doc Text:
Clone Of:
: 1020715 1069097 (view as bug list)
Environment:
Last Closed: 2012-06-20 08:20:49 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
Patch vfs - fix LOOKUP_DIRECTORY not propagated to managed_dentry() (1.01 KB, patch)
2012-03-06 13:28 UTC, Ian Kent
no flags Details | Diff
successful DFS access via a 131.12 kernel (3.99 MB, application/octet-stream)
2012-03-06 14:18 UTC, chris.petty
no flags Details
unsuccessful DFS access via a newer 220.4 kernel (124.10 KB, application/octet-stream)
2012-03-06 14:18 UTC, chris.petty
no flags Details
strace /mnt/users/petty/munin/data (7.62 KB, text/plain)
2012-03-08 15:25 UTC, chris.petty
no flags Details
strace /mnt/users/petty/munin/data/Daemon/ (8.40 KB, text/plain)
2012-03-08 15:26 UTC, chris.petty
no flags Details
dmesg with cifsFYI = 7 (139.09 KB, text/plain)
2012-04-16 18:38 UTC, chris.petty
no flags Details
Patch - check S_AUTOMOUNT in revalidate (1.72 KB, patch)
2012-04-26 02:19 UTC, Ian Kent
no flags Details | Diff
Patch - check S_AUTOMOUNT in revalidate (against current source) (1.80 KB, patch)
2012-04-26 02:22 UTC, Ian Kent
no flags Details | Diff
Patch vfs - fix LOOKUP_DIRECTORY not propagated to managed_dentry() (updated) (1.79 KB, patch)
2012-04-30 03:59 UTC, Ian Kent
no flags Details | Diff


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2012:0862 0 normal SHIPPED_LIVE Moderate: Red Hat Enterprise Linux 6 kernel security, bug fix and enhancement update 2012-06-20 12:55:00 UTC

Description chris.petty 2012-01-31 15:36:44 UTC
Description of problem:

After upgrading from kernel 2.6.32.131.21.1.el6.x86_64 to 2.6.32-220.x.x.el6.x86_64 i can no longer access my DFS shares when mounted through cifs.

Directory is mounted correctly:
//munin/data on /mnt/users/petty/munin/data type cifs (rw,mand,nosuid,nodev,user=petty)

[petty@dirac ~]$ ls ~/net/munin/data/
Adcock BIAC Daemon DeBellis

However, i am unable to view anything within the sub folders:
[petty@dirac ~]$ ls ~/net/munin/data/Daemon/
ls: cannot access /home/petty/net/munin/data/Daemon/: Not a directory

If i mount the sub-share directly, i can access the data:
[petty@dirac ~]$ ls ~/net/munin/daemon/
ALIVE Backup Archive Salvage.01

I have keyutils.x86_64 installed, with the appropriate edits to request-key.conf:
create      cifs.spnego    * * /usr/sbin/cifs.upcall -c %k
create      dns_resolver   * * /usr/sbin/cifs.upcall %k

If i boot back into 2.6.32.131.21.1.el6.x86_64, everything works as expected.


Version-Release number of selected component (if applicable):
2.6.32-220.2.1.el6.x86_64
2.6.32-220.4.1.el6.x86_64

How reproducible:
Everytime.

Steps to Reproduce:
1. Boot into a 2.6.32-220 kernel
2. mount a server with mount.cifs
3. try to access one of the dfs shares
  
Actual results:
ls: cannot access /home/petty/net/munin/data/Daemon/: Not a directory

Expected results:
a listing of the contents

Additional info:

Comment 5 Ian Kent 2012-03-06 13:28:15 UTC
Created attachment 567951 [details]
Patch vfs - fix LOOKUP_DIRECTORY not propagated to managed_dentry()

We can try this patch if someone wants to build a kernel with
it now, I'll do that tomorrow anyway if not.

Comment 6 chris.petty 2012-03-06 14:18:03 UTC
Created attachment 567961 [details]
successful DFS access via a 131.12 kernel

Comment 7 chris.petty 2012-03-06 14:18:45 UTC
Created attachment 567962 [details]
unsuccessful DFS access via a newer 220.4 kernel

Comment 8 chris.petty 2012-03-06 14:22:21 UTC
unfortunately my first comment disappeared when i added the attachments, but the mount was made with:


sudo /sbin/mount.cifs //munin/data /mnt/users/petty -o uid=2022,gid=0,user=petty,domain=BIAC,rw,file_mode=0600,dir_mode=0700

131.21 shows the successful access, 220.4 was unsuccessful.

I accessed the same directory in the DFS both times.

command: ls /mnt/users/petty/Daemon/Salvage.01
220.4 result: ls: cannot access /mnt/users/petty/Daemon/Salvage.01: Not a directory

131.21 result was a listing of contents.

Comment 9 Sachin Prabhu 2012-03-06 14:39:16 UTC
Chris, 

Thanks for that info. We did find a regression caused by the patch for an issue reported in kernel 2.6.32-191.el6
- [fs] CIFS: Use d_automount() rather than abusing follow_link() [ver #2] (Ian
Kent) [704941]
which prevents the submounts from from being mounted automatically by the client. This also affect NFS mounts in a similar manner.

Ian has provided a patch which in c#5 which can fix this particular problem. Can you please test that fix and let us know the results.

Sachin Prabhu

Comment 11 Sachin Prabhu 2012-03-07 10:03:11 UTC
Chris,

Can you please open a case with the support group and point them to this bz so that we can provide you with a test kernel with the fix for the problem. The test kernel contains a fix for a regression introduced in -191 kernel which fixes the problem you see.

Sachin Prabhu

Comment 12 chris.petty 2012-03-07 20:17:20 UTC
We had a crack at compiling the kernel with the patch, everything compiled and booted correctly, however after mounting the relevant server through CIFS we still had the same result:

ls: cannot access /mnt/users/petty/Daemon/Salvage.01: Not a directory


We're unsure if the patch was implemented correctly within the compiled kernel, so i'll open a case to be sure.

Comment 13 Syam Gadde 2012-03-07 20:30:30 UTC
I was the one that compiled the kernel that Chris tested.  I used kernel sources 2.6.32-220.7.1.el6 and the patch (modified slightly to change the line numbers) applied successfully during the build, and the extracted source reflects the patch to fs/namei.c .  If we should be patching a different source version, we'd be happy to test with that.

Comment 14 Ian Kent 2012-03-08 00:35:04 UTC
(In reply to comment #8)
> unfortunately my first comment disappeared when i added the attachments, but
> the mount was made with:
> 
> 
> sudo /sbin/mount.cifs //munin/data /mnt/users/petty -o
> uid=2022,gid=0,user=petty,domain=BIAC,rw,file_mode=0600,dir_mode=0700
> 
> 131.21 shows the successful access, 220.4 was unsuccessful.
> 
> I accessed the same directory in the DFS both times.
> 
> command: ls /mnt/users/petty/Daemon/Salvage.01
> 220.4 result: ls: cannot access /mnt/users/petty/Daemon/Salvage.01: Not a
> directory

This isn't the same use case as that in comment #0 and is not
what the attached patch was meant to address.

What are the DFS mount points in the path above, Daemon, also
Salvage.01?

Comment 15 chris.petty 2012-03-08 00:46:26 UTC
Daemon would be the DFS point, Salvage is subdirectory within that point.

Also, that is the same as comment #0, however this time i had mounted //munin/data directly to /mnt/users/petty, sorry for the confusion.

Comment 16 Ian Kent 2012-03-08 01:02:44 UTC
(In reply to comment #12)
> We had a crack at compiling the kernel with the patch, everything compiled and
> booted correctly, however after mounting the relevant server through CIFS we
> still had the same result:
> 
> ls: cannot access /mnt/users/petty/Daemon/Salvage.01: Not a directory

Lets have a look at an strace of running this command.

Comment 17 Ian Kent 2012-03-08 01:07:14 UTC
(In reply to comment #15)
> Daemon would be the DFS point, Salvage is subdirectory within that point.
> 
> Also, that is the same as comment #0, however this time i had mounted
> //munin/data directly to /mnt/users/petty, sorry for the confusion.

Sure, from your point of view, yes, but the issue that the
patch seeks to address is specifically the case where the
DFS path has a trailing "/".

Comment 18 Ian Kent 2012-03-08 01:38:49 UTC
(In reply to comment #15)
> Daemon would be the DFS point, Salvage is subdirectory within that point.

Does the DFS mount Daemon actually end up mounted after the
error return?

Comment 19 chris.petty 2012-03-08 01:46:34 UTC
(In reply to comment #18)
> (In reply to comment #15)
> > Daemon would be the DFS point, Salvage is subdirectory within that point.
> 
> Does the DFS mount Daemon actually end up mounted after the
> error return?


I'm never able to access anything inside Daemon though the new kernel, it returns an error on every access. 

I'll provide the trace tomorrow, the newer kernel is only running on a virtual machine that i can't get to reliably from home.

Comment 21 Ian Kent 2012-03-08 02:03:27 UTC
(In reply to comment #19)
> (In reply to comment #18)
> > (In reply to comment #15)
> > > Daemon would be the DFS point, Salvage is subdirectory within that point.
> > 
> > Does the DFS mount Daemon actually end up mounted after the
> > error return?
> 
> 
> I'm never able to access anything inside Daemon though the new kernel, it
> returns an error on every access. 

That's actually good, it's what I wanted to hear.

> 
> I'll provide the trace tomorrow, the newer kernel is only running on a virtual
> machine that i can't get to reliably from home.

No problem.

Probably still worth doing although I might have spotted the
problem. But before producing a patch I need to consult Jeff.

Comment 23 RHEL Program Management 2012-03-08 02:29:33 UTC
This request was evaluated by Red Hat Product Management for inclusion
in a Red Hat Enterprise Linux maintenance release. Product Management has 
requested further review of this request by Red Hat Engineering, for potential
inclusion in a Red Hat Enterprise Linux Update release for currently deployed 
products. This request is not yet committed for inclusion in an Update release.

Comment 25 chris.petty 2012-03-08 15:25:41 UTC
Created attachment 568665 [details]
strace /mnt/users/petty/munin/data

Strace of listing data, which was mounted as the equivalent of comment #0.

Comment 26 chris.petty 2012-03-08 15:26:30 UTC
Created attachment 568666 [details]
strace /mnt/users/petty/munin/data/Daemon/

Strace of listing a DFS share

Comment 28 RHEL Program Management 2012-03-08 23:49:21 UTC
This request was evaluated by Red Hat Product Management for inclusion
in a Red Hat Enterprise Linux maintenance release. Product Management has 
requested further review of this request by Red Hat Engineering, for potential
inclusion in a Red Hat Enterprise Linux Update release for currently deployed 
products. This request is not yet committed for inclusion in an Update release.

Comment 32 Ian Kent 2012-04-10 04:03:58 UTC
Can we get a trace of the CIFS activity when attempting a
mount which fails please. I must know if the vfs automounting
code is being called or not.

I believe this should get what we want (after the cifs
module has been loaded):

echo 7 > /proc/fs/cifs/cifsFYI

Comment 34 Ian Kent 2012-04-10 04:14:23 UTC
(In reply to comment #32)
> Can we get a trace of the CIFS activity when attempting a
> mount which fails please. I must know if the vfs automounting
> code is being called or not.
> 
> I believe this should get what we want (after the cifs
> module has been loaded):
> 
> echo 7 > /proc/fs/cifs/cifsFYI

When doing this test ensure that a kernel with the patch from
comment #5 is used and that a trailing "/" is included in the
path used for the directory listing.

It might also be useful to include a trace of a mount attempt
without a trailing "/" also.

Comment 35 Syam Gadde 2012-04-13 14:18:53 UTC
Thanks.  The virtual machine we were testing on is inaccessible at the moment, but should be available early next week.  We'll make sure to get the trace from the patched kernel (we have it built already and tested it, but never got a trace).  We'll do the test with and without the trailing "/".

Comment 36 chris.petty 2012-04-16 18:38:10 UTC
Created attachment 577804 [details]
dmesg with cifsFYI = 7

dmesg from the patched kernel with cifsFYI = 7

There are several cases of listing DFS shares as well as the base
 mount point which shows all the various DFS shares.

Some were listed with and without the trailing "/"

ls /mnt/users/petty/Daemon/
ls: cannot access /mnt/users/petty/Daemon/: Not a directory

ls /mnt/users/petty/Daemon
ls: cannot open directory /mnt/users/petty/Daemon: Not a directory

Comment 39 Ian Kent 2012-04-19 12:13:35 UTC
Chris, thanks for the cifs trace.

Looking at it confirmed that in fact the VFS was not calling
the automounting functions.

Using the trace as a guide I found what appears to be a problem
where a prior directory read prevents the correct flags being
set and consequently automount for dfs mounts in that directory
don't trigger. At least that is what I see looking at the trace
and the cifs code. Hopefully this is the problem you are seeing.

I've built a test kernel with the changes I hope will fix the
problem so please test it and report back.

It can be found at:
http://people.redhat.com/~ikent/kernel-2.6.32-220.9.1.el6.bz786149.3

It turns out that the patch I'm using, but not the patch in
comment #5, is part of of the resolution for another bug and
is already included in RHEL-6.3.

Comment 43 chris.petty 2012-04-23 15:49:13 UTC
Thanks Ian ... do you happen to have the kernel-firmware package associated with this patched kernel?

I rebuild the srpm from source hoping it would produce the firmware as well, but i just got these:

kernel-2.6.32-220.9.1.el6.bz786149.3.x86_64.rpm
kernel-debuginfo-2.6.32-220.9.1.el6.bz786149.3.x86_64.rpm
kernel-debug-2.6.32-220.9.1.el6.bz786149.3.x86_64.rpm
kernel-debuginfo-common-x86_64-2.6.32-220.9.1.el6.bz786149.3.x86_64.rpm
kernel-debug-debuginfo-2.6.32-220.9.1.el6.bz786149.3.x86_64.rpm  
kernel-devel-2.6.32-220.9.1.el6.bz786149.3.x86_64.rpm
kernel-debug-devel-2.6.32-220.9.1.el6.bz786149.3.x86_64.rpm
kernel-headers-2.6.32-220.9.1.el6.bz786149.3.x86_64.rpm

Comment 44 chris.petty 2012-04-23 15:56:27 UTC
sorry, dis-regard that .. i'm building the noarch stuff now, will try the kernel when finished.

Comment 45 chris.petty 2012-04-23 16:59:37 UTC
installed the new kernel/header/firmware and the DFS mounts work as expected again.

Thanks.

Comment 46 Ian Kent 2012-04-26 02:03:29 UTC
We need to go through the test process once again since
I believe there is a race with the patch used in the the
recent test kernel.

Please test the kernel found here:
http://people.redhat.com/~ikent/kernel-2.6.32-220.9.1.el6.bz786149.4

Comment 47 Ian Kent 2012-04-26 02:19:06 UTC
Created attachment 580327 [details]
Patch - check S_AUTOMOUNT in revalidate

Patch used in kernel-2.6.32-220.9.1.el6.bz786149.4.

Comment 48 Ian Kent 2012-04-26 02:22:18 UTC
Created attachment 580329 [details]
Patch - check S_AUTOMOUNT in revalidate (against current source)

This is a patch against the current RHEL-6 repository
for the recommended correction.

Comment 49 chris.petty 2012-04-26 15:20:13 UTC
Mounts continue to work in this newer kernel as well.

-chris

Comment 50 Ian Kent 2012-04-30 03:59:58 UTC
Created attachment 581138 [details]
Patch vfs - fix LOOKUP_DIRECTORY not propagated to managed_dentry() (updated)

Comment 51 Jarod Wilson 2012-05-09 16:33:08 UTC
Patch(es) available on kernel-2.6.32-270.el6

Comment 54 Jian Li 2012-05-22 08:20:28 UTC
This bug is reproduced on 2.6.32-220.el6, verified on 2.6.32-270.el6.

Comment 56 errata-xmlrpc 2012-06-20 08:20:49 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

http://rhn.redhat.com/errata/RHSA-2012-0862.html


Note You need to log in before you can comment on or make changes to this bug.