Linux kernel regression: Links on CIFS shares

Bug #1222442 reported by Peter Wienemann
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
linux (Ubuntu)
Fix Released
Medium
Luis Henriques

Bug Description

After upgrading from (Ubuntu) kernel version 3.2.0-45-generic to 3.2.0-48-generic on Ubuntu Precise (x86_64), links on CIFS shares are broken. The used setup is the following:

Clients running Ubuntu Precise mount a CIFS share with

    mount -t cifs -o sec=krb5,multiuser,cifsacl,serverino,nobrl,nounix,cruid=xyz,mfsymlinks //srv.example.com /mnt/cifs

Issuing the following commands

    touch hello
    ln -s hello hello2
    ls -l

on the mounted CIFS share results in the output

    ls: cannot read symbolic link hello2: Invalid argument
    total 1024
    -rwxr-xr-x 0 user group 0 Sep 8 16:36 hello
    lrwxrwxrwx 1 user group 5 Sep 8 16:36 hello2

for kernel versions >= 3.2.0-48-generic. Running "less hello2" yields:

    hello2 is not a regular file (use -f to see it)

Using "less -f hello2" changes the error message to

    hello2: Too many levels of symbolic links

Some of our users only see this problem if there is at least one reboot of the client between link creation and link access.

The problem can be traced back to the following kernel code change:
-------------------------------------------------------------------------------------------------------
diff --git a/fs/cifs/inode.c b/fs/cifs/inode.c
index e851d5b..20431b4 100644
--- a/fs/cifs/inode.c
+++ b/fs/cifs/inode.c
@@ -173,7 +173,8 @@ cifs_fattr_to_inode(struct inode *inode, struct cifs_fattr *fattr)

        if (fattr->cf_flags & CIFS_FATTR_DFS_REFERRAL)
                inode->i_flags |= S_AUTOMOUNT;
- cifs_set_ops(inode);
+ if (inode->i_state & I_NEW)
+ cifs_set_ops(inode);
 }

 void
-------------------------------------------------------------------------------------------------------
Reverting this change fixes the problem.

Another way to get rid of the error is to remove the "nounix" and "mksymlinks" mount options but this slows down the setup such that it becomes practically useless.

Revision history for this message
Brad Figg (brad-figg) wrote : Missing required logs.

This bug is missing log files that will aid in diagnosing the problem. From a terminal window please run:

apport-collect 1222442

and then change the status of the bug to 'Confirmed'.

If, due to the nature of the issue you have encountered, you are unable to run this command, please add a comment stating that fact and change the bug status to 'Confirmed'.

This change has been made by an automated script, maintained by the Ubuntu Kernel Team.

Changed in linux (Ubuntu):
status: New → Incomplete
tags: added: precise
Luis Henriques (henrix)
Changed in linux (Ubuntu):
assignee: nobody → Luis Henriques (henrix)
Revision history for this message
Luis Henriques (henrix) wrote :

Peter, thank you for your report and analysis. This issue has been introduced upstream by commit c2b93e06 (cifs: only set ops for inodes in I_NEW state) and the fix is already queued for most of the stable kernels. It should hit Precise (and all the other series) in the next SRU update cycle, which starts this week.

Revision history for this message
Peter Wienemann (wienemann) wrote :

Hi Luis, thanks for this information. It seems that the log files which Brad requested are not needed anymore, right?

Revision history for this message
Luis Henriques (henrix) wrote :

No, there's no need to provide the logs as this is a know issue and we have already the fix. I'll change the bug status to 'triagged'. Also, for completeness, the fix is upstream commit

757c4f6 "cifs: don't instantiate new dentries in readdir for inodes that need to be revalidated immediately"

Changed in linux (Ubuntu):
status: Incomplete → Triaged
Changed in linux (Ubuntu):
importance: Undecided → Medium
Luis Henriques (henrix)
Changed in linux (Ubuntu):
status: Triaged → Fix Committed
Revision history for this message
Brad Figg (brad-figg) wrote :

This bug is awaiting verification that the kernel in -proposed solves the problem. Please test the kernel and update this bug with the results. If the problem is solved, change the tag 'verification-precise-needed' to 'verification-precise-done'.

If verification is not done by one week from today, this fix will be dropped from the source code, and this bug will be closed.

See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Thank you!

tags: added: verification-needed-precise
tags: added: verification-needed-quantal
Revision history for this message
Brad Figg (brad-figg) wrote :

This bug is awaiting verification that the kernel in -proposed solves the problem. Please test the kernel and update this bug with the results. If the problem is solved, change the tag 'verification-quantal-needed' to 'verification-quantal-done'.

If verification is not done by one week from today, this fix will be dropped from the source code, and this bug will be closed.

See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Thank you!

Revision history for this message
Peter Wienemann (wienemann) wrote :

I just tried the kernel in -proposed on precise and it solves the problem. Changed tag from verification-needed-precise to verification-done-precise.

tags: added: verification-done-precise
removed: verification-needed-precise
Revision history for this message
Peter Wienemann (wienemann) wrote :

I repeated the test for quantal. I have problems with the kernel in quantal-propose (3.5.0-41-generic). Neither mouse nor NIC work with this kernel. Both work with 3.5.0-40-generic. Whether the CIFS problem is solved in 3.5.0-41-generic I cannot test without working NIC.

Brad Figg (brad-figg)
tags: added: verification-done-quantal
removed: verification-needed-quantal
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package linux - 3.2.0-54.82

---------------
linux (3.2.0-54.82) precise; urgency=low

  [Steve Conklin]

  * Release Tracking Bug
    - LP: #1223490

  [ Upstream Kernel Changes ]

  * Revert "zram: use zram->lock to protect zram_free_page() in swap free
    notify path"
    - LP: #1215513
  * x86 thermal: Delete power-limit-notification console messages
    - LP: #1215748
  * x86 thermal: Disable power limit notification interrupt by default
    - LP: #1215748
  * ARM: 7810/1: perf: Fix array out of bounds access in
    armpmu_map_hw_event()
    - LP: #1216442
    - CVE-2013-4254
  * ARM: 7809/1: perf: fix event validation for software group leaders
    - LP: #1216442
    - CVE-2013-4254
  * xfs: fix _xfs_buf_find oops on blocks beyond the filesystem end
    - LP: #1151527
    - CVE-2013-1819
  * cifs: don't instantiate new dentries in readdir for inodes that need to
    be revalidated immediately
    - LP: #1222442
 -- Steve Conklin <email address hidden> Tue, 10 Sep 2013 12:54:53 -0500

Changed in linux (Ubuntu):
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.