Bug 187183 - cifs directory listings wrong
cifs directory listings wrong
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 4
Classification: Red Hat
Component: kernel (Show other bugs)
4.0
All Linux
medium Severity medium
: ---
: ---
Assigned To: Steve Dickson
Brian Brock
:
Depends On:
Blocks: 176344 205629
  Show dependency treegraph
 
Reported: 2006-03-28 19:43 EST by John Newbigin
Modified: 2007-11-30 17:07 EST (History)
1 user (show)

See Also:
Fixed In Version: RHBA-2007-0304
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2007-05-07 21:03:13 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description John Newbigin 2006-03-28 19:43:23 EST
Description of problem:
When a subdirectory is listed, the directory is shown as a child of it's self. 
None of the correct entries are show.

Version-Release number of selected component (if applicable):
2.6.9-34.EL

How reproducible:
Every time

Steps to Reproduce:
1. Mount a cifs share
mount -t cifs \\\\linuxserver\\testuser -o username=testuser
2. Change into a directory
cd testing
3. Do a directory listing
ls
  
Actual results:
[root@testbox testuser]# cd testing
[root@testbox testing]# ls -la
ls: testing: No such file or directory
total 1024
drwxr-xr-x  2 testuser testuser 0 Mar 22 18:01 testing
[root@testbox testing]# ls
testing


Expected results:
[testuser@linuxserver testuser]$ cd testing
[testuser@linuxserver testing]# ls -la
total 8
drwxr-xr-x    2 testuser testuser     4096 Mar 29 11:42 .
drwx------   43 testuser testuser     4096 Mar 29 11:42 ..
-rw-r--r--    1 testuser testuser        0 Mar 29 11:42 testfile


Additional info:
If you access a file directly it works.
Directory listings work in cifs 1.34a.  I have built that version manually as a
workaround.
Comment 1 John Newbigin 2006-03-28 19:53:52 EST
The mount command also needs a target directory:
mount -t cifs \\\\linuxserver\\testuser -o username=testuser /mnt/cifstest
Comment 2 Jason Baron 2006-03-29 10:38:35 EST
hmmm. i'm a little confused b/c 2.6.9-34 include cifs version 1.34a
Comment 3 John Newbigin 2006-03-29 18:56:25 EST
I am getting confused with version numbers.  It is cifs version 1.40a(RHEL) that
I am using (though I think I have used 1.34 in the past).
Comment 4 John Newbigin 2006-06-25 21:24:01 EDT
I have confirmed this problem is still present in kernel 2.6.9-34.0.1.EL

The red hat version of cifs (1.34) does not list directories correctly, a self
compiled version of cifs
(http://pserver.samba.org/samba/ftp/cifs-cvs/cifs-1.40a-forFC3orRHEL4orSuSEWrk9.tar.gz)
does.

The problem is that ls shows the wrong file names.  The real files do exist and
stat works on the real files, but ls is told the wrong names so the user sees
the wrong names, and ls can not stat the files (because they don't exist, and
hence the error 'No such file or directory')

Example of problem:
[test@el4 ~]$ cd testing/
[test@el4 testing]$ ls
testing
[test@el4 testing]$ stat testing
stat: cannot stat `testing': No such file or directory
[test@el4 testing]$ stat testfile
  File: `testfile'
  Size: 15              Blocks: 2048       IO Block: 16384  regular file
Device: 10h/16d Inode: 228890      Links: 1
Access: (0644/-rw-r--r--)  Uid: ( 6860/  test)   Gid: ( 1000/     test)
Access: 2006-03-29 12:42:08.000000000 +1100
Modify: 2006-06-26 11:24:29.000000000 +1000
Change: 2006-06-26 11:24:29.000000000 +1000

Example of correct results, using 1.40a:
[test@el4 ~]$ cd testing/
[test@el4 testing]$ ls
a  A  lower  testfile  UPPER
[test@el4 testing]$ stat testfile
  File: `testfile'
  Size: 15              Blocks: 2048       IO Block: 16384  regular file
Device: 10h/16d Inode: 8492        Links: 1
Access: (0644/-rw-r--r--)  Uid: ( 6860/  test)   Gid: ( 1000/     test)
Access: 2006-03-29 12:42:08.000000000 +1100
Modify: 2006-06-26 11:24:29.000000000 +1000
Change: 2006-06-26 11:24:29.000000000 +1000
[test@el4 testing]$
Comment 5 Jason Baron 2006-09-14 12:07:02 EDT
committed in stream U5 build 42.10. A test kernel with this patch is available
from http://people.redhat.com/~jbaron/rhel4/
Comment 6 John Newbigin 2006-09-17 23:10:33 EDT
I am testing 42.11 which so far is working well.
Comment 7 RHEL Product and Program Management 2006-09-27 18:42:13 EDT
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 8 Jay Turner 2006-10-03 09:19:31 EDT
QE ack for 4.5.
Comment 12 Red Hat Bugzilla 2007-05-07 21:03:13 EDT
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on the solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHBA-2007-0304.html

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