Bug 852526 - CIFS cache coherency issue
Summary: CIFS cache coherency issue
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: kernel
Version: 5.8
Hardware: x86_64
OS: Linux
urgent
high
Target Milestone: rc
: ---
Assignee: Sachin Prabhu
QA Contact: Jian Li
URL:
Whiteboard:
Depends On:
Blocks: 857964
TreeView+ depends on / blocked
 
Reported: 2012-08-28 19:52 UTC by Neal Kim
Modified: 2018-11-30 21:32 UTC (History)
8 users (show)

Fixed In Version: kernel-2.6.18-340.el5
Doc Type: Bug Fix
Doc Text:
Prior to this update, a process of continuously opening and closing a file within a second could prevent the data cache of a file from ever expiring. This resulted in stale data being presented on the client. With this update, the modify time and size stored in cache for an existing inode are compared with the modify time and size returned by the open() call; the cache is invalidated if the values differ.
Clone Of:
Environment:
Last Closed: 2013-01-08 04:42:31 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Knowledge Base (Solution) 265363 0 None None None Never
Red Hat Product Errata RHBA-2013:0006 0 normal SHIPPED_LIVE Red Hat Enterprise Linux 5.9 kernel update 2013-01-08 08:48:56 UTC

Description Neal Kim 2012-08-28 19:52:58 UTC
Description of problem:

Customer's production application is failing due to not properly picking up changes made on a central Samba file server. The customer has a RHEL 4 Samba file-server and numerous RHEL 5.8 clients mounting the shares using CIFS. They have found that updates made to files within the share are not always seen on all of the clients.

RHEL 6.3 CIFS clients work just fine. RHEL 5.x should behave the same way.


Version-Release number of selected component (if applicable):

kernel-2.6.18-164.el5 ~ kernel-2.6.18-308.el5


How reproducible:

Very.


Steps to Reproduce:

1.  Export a Samba share.
2.  On a RHEL 5.8 machine running the 2.6.18-308.4.1.el5 kernel, map the share to a local directory.
3.  On the Samba server, create a file in the shared directory called tenths.out.
4.  Run:

while true
do
date +%s.%N > tenths.out
sleep 0.1
done

To constantly put the latest date in the file.

5.  On the CIFS client in the mounted share, run:

while true
do
sleep 0.1
stat tenths.out
cat tenths.out
done


Actual results:

Contents of the file reported never change even though they are changing on the server side.


Expected results:

No cache coherency issue.


Additional info:

Issue does *not* occur when using RHEL 6.3 CIFS clients. In addition, using the "directio" mount option is *not an acceptable workaround* due to performance reasons.

Further details are recorded here:

https://access.redhat.com/knowledge/solutions/154653

Comment 13 Jian Li 2012-09-16 06:05:25 UTC
qa_ack is set, reproducor refer to comment 0.

Comment 17 Phillip Lougher 2012-09-24 18:15:32 UTC
Patch(es) available in kernel-2.6.18-340.el5
You can download this test kernel (or newer) from http://people.redhat.com/plougher/el5/
Detailed testing feedback is always welcomed.
If you require guidance regarding testing, please ask the bug assignee.

Comment 19 Jian Li 2012-10-15 09:15:26 UTC
This bug is reprodued on 2.6.18-308.4.1.el5, and verified on 2.6.18-340.el5.

reproducer:
[root@hp-xw4600-01 test]# uname -a
Linux hp-xw4600-01.rhts.eng.nay.redhat.com 2.6.18-308.4.1.el5 #1 SMP Wed Mar 28 01:54:56 EDT 2012 x86_64 x86_64 x86_64 GNU/Linux
[root@hp-xw4600-01 test]# while true ; do sleep 0.1; stat tenths.out; cat tenths.out; done
  File: `tenths.out'
  Size: 21              Blocks: 8          IO Block: 16384  regular file
Device: 18h/24d Inode: 55336       Links: 1
Access: (0644/-rw-r--r--)  Uid: (    0/    root)   Gid: (    0/    root)
Access: 2012-10-15 03:42:47.172587900 -0400
Modify: 2012-10-15 03:43:10.420473800 -0400
Change: 2012-10-15 03:43:10.420473800 -0400
1350286990.420848002
  File: `tenths.out'
  Size: 21              Blocks: 8          IO Block: 16384  regular file
Device: 18h/24d Inode: 55336       Links: 1
Access: (0644/-rw-r--r--)  Uid: (    0/    root)   Gid: (    0/    root)
Access: 2012-10-15 03:42:47.172587900 -0400
Modify: 2012-10-15 03:43:10.420473800 -0400
Change: 2012-10-15 03:43:10.420473800 -0400
1350286990.420848002
  File: `tenths.out'
  Size: 21              Blocks: 8          IO Block: 16384  regular file
Device: 18h/24d Inode: 55336       Links: 1
Access: (0644/-rw-r--r--)  Uid: (    0/    root)   Gid: (    0/    root)
Access: 2012-10-15 03:43:10.426473100 -0400
Modify: 2012-10-15 03:43:10.522530500 -0400
Change: 2012-10-15 03:43:10.522530500 -0400
1350286990.420848002
** snip **
  File: `tenths.out'
  Size: 21              Blocks: 8          IO Block: 16384  regular file
Device: 18h/24d Inode: 55336       Links: 1
Access: (0644/-rw-r--r--)  Uid: (    0/    root)   Gid: (    0/    root)
Access: 2012-10-15 03:43:10.426473100 -0400
Modify: 2012-10-15 03:43:49.300411600 -0400
Change: 2012-10-15 03:43:49.300411600 -0400
1350286990.420848002
  File: `tenths.out'
  Size: 21              Blocks: 8          IO Block: 16384  regular file
Device: 18h/24d Inode: 55336       Links: 1
Access: (0644/-rw-r--r--)  Uid: (    0/    root)   Gid: (    0/    root)
Access: 2012-10-15 03:43:10.426473100 -0400
Modify: 2012-10-15 03:43:49.402410800 -0400
Change: 2012-10-15 03:43:49.402410800 -0400
1350286990.420848002

verifier: 
[root@nec-em16 test]# while true ; do sleep 0.1; stat tenths.out; cat tenths.out; done
  File: `tenths.out'
  Size: 21              Blocks: 16         IO Block: 16384  regular file
Device: 18h/24d Inode: 13212       Links: 1
Access: (0644/-rw-r--r--)  Uid: (    0/    root)   Gid: (    0/    root)
Access: 2012-10-15 05:06:56.000000000 -0400
Modify: 2012-10-15 05:07:33.000000000 -0400
Change: 2012-10-15 05:07:33.000000000 -0400
1350292053.509999431
  File: `tenths.out'
  Size: 21              Blocks: 16         IO Block: 16384  regular file
Device: 18h/24d Inode: 13212       Links: 1
Access: (0644/-rw-r--r--)  Uid: (    0/    root)   Gid: (    0/    root)
Access: 2012-10-15 05:06:56.000000000 -0400
Modify: 2012-10-15 05:07:33.000000000 -0400
Change: 2012-10-15 05:07:33.000000000 -0400
1350292053.509999431
** snip **
  File: `tenths.out'  
  Size: 21              Blocks: 16         IO Block: 16384  regular file
Device: 18h/24d Inode: 13212       Links: 1
Access: (0644/-rw-r--r--)  Uid: (    0/    root)   Gid: (    0/    root)
Access: 2012-10-15 05:08:38.000000000 -0400
Modify: 2012-10-15 05:08:38.000000000 -0400
Change: 2012-10-15 05:08:38.000000000 -0400
1350292118.079576576  
  File: `tenths.out'  
  Size: 21              Blocks: 16         IO Block: 16384  regular file
Device: 18h/24d Inode: 13212       Links: 1
Access: (0644/-rw-r--r--)  Uid: (    0/    root)   Gid: (    0/    root)
Access: 2012-10-15 05:08:38.000000000 -0400
Modify: 2012-10-15 05:08:38.000000000 -0400
Change: 2012-10-15 05:08:38.000000000 -0400
1350292118.079576576  
  File: `tenths.out'
  Size: 21              Blocks: 16         IO Block: 16384  regular file
Device: 18h/24d Inode: 13212       Links: 1
Access: (0644/-rw-r--r--)  Uid: (    0/    root)   Gid: (    0/    root)
Access: 2012-10-15 05:08:38.000000000 -0400
Modify: 2012-10-15 05:08:38.000000000 -0400
Change: 2012-10-15 05:08:38.000000000 -0400
1350292119.004581906
  File: `tenths.out'
  Size: 21              Blocks: 16         IO Block: 16384  regular file
Device: 18h/24d Inode: 13212       Links: 1
Access: (0644/-rw-r--r--)  Uid: (    0/    root)   Gid: (    0/    root)
Access: 2012-10-15 05:08:38.000000000 -0400
Modify: 2012-10-15 05:08:39.000000000 -0400
Change: 2012-10-15 05:08:39.000000000 -0400
1350292119.004581906

Comment 21 errata-xmlrpc 2013-01-08 04:42:31 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/RHBA-2013-0006.html


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