Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
For bugs related to Red Hat Enterprise Linux 5 product line. The current stable release is 5.10. For Red Hat Enterprise Linux 6 and above, please visit Red Hat JIRA https://issues.redhat.com/secure/CreateIssue!default.jspa?pid=12332745 to report new issues.

Bug 626974

Summary: nfs: too many GETATTR and ACCESS calls after direct i/o
Product: Red Hat Enterprise Linux 5 Reporter: Herbert van den Bergh <herbert.van.den.bergh>
Component: kernelAssignee: Jeff Layton <jlayton>
Status: CLOSED ERRATA QA Contact: Jian Li <jiali>
Severity: high Docs Contact:
Priority: low    
Version: 5.5CC: bfields, chuck.lever, dhowells, herbert.van.den.bergh, jiali, jlayton, nmurray, qcai, rwheeler, sardella, sprabhu, steved, yanwang, zzhou
Target Milestone: rc   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-07-21 09:47:30 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
[PATCH] NFS: Too many GETATTR and ACCESS calls after direct I/O none

Description Herbert van den Bergh 2010-08-24 19:07:05 UTC
Created attachment 440733 [details]
[PATCH] NFS: Too many GETATTR and ACCESS calls after direct I/O

[PATCH] NFS: Too many GETATTR and ACCESS calls after direct I/O

    The cached read and write paths initialize fattr->time_start in their
    setup procedures.  The value of fattr->time_start is propagated to
    read_cache_jiffies by nfs_update_inode().  Subsequent calls to
    nfs_attribute_timeout() will then use a good time stamp when
    computing the attribute cache timeout, and squelch unneeded GETATTR
    calls.

    Since the direct I/O paths erroneously leave the inode's
    fattr->time_start field set to zero, read_cache_jiffies for that inode
    is set to zero after any direct read or write operation.  This
    triggers an otw GETATTR or ACCESS call to update the file's attribute
    and access caches properly, even when the NFS READ or WRITE replies
    have usable post-op attributes.

    Make sure the direct read and write setup code performs the same fattr
    initialization as the cached I/O paths to prevent unnecessary GETATTR
    calls.

    This was likely introduced by commit 0e574af1 in 2.6.15, which appears
    to add new nfs_fattr_init() call sites in the cached read and write
    paths, but not in the equivalent places in fs/nfs/direct.c.  A
    subsequent commit in the same series, 33801147, introduces the
    fattr->time_start field.

    Interestingly, the direct write reschedule path already has a call to
    nfs_fattr_init() in the right place.

    Reported-by: Quentin Barnes <qbarnes>
    Signed-off-by: Chuck Lever <chuck.lever>
    Cc: stable

    Applied without changes to kernel-2.6.18-194.0.0.0.4.el5.

    Signed-off-by: Chuck Lever <chuck.lever>

Comment 1 Jeff Layton 2010-10-05 11:42:36 UTC
Looks like an obvious fix.

Comment 2 Jeff Layton 2010-10-05 11:47:34 UTC
I've put this patch in my test kernels here:

    http://people.redhat.com/jlayton/

...if you have a non-critical place to test them, can you let me know if they fix the issue?

Comment 4 RHEL Program Management 2011-02-01 16:52:55 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 8 yanfu,wang 2011-02-18 02:53:50 UTC
hi Jeff,
Could you provide test steps for the bug?

Comment 12 Jarod Wilson 2011-03-03 20:33:41 UTC
in kernel-2.6.18-246.el5
You can download this test kernel (or newer) from http://people.redhat.com/jwilson/el5

Detailed testing feedback is always welcomed.

Comment 14 yanfu,wang 2011-05-25 08:41:52 UTC
do code review and verify patch is applied in kernel-2.6.18-262.el5 as per comment #9, and do some nfs regression test using O_DIRECT, test result recorded in TCMS: https://tcms.engineering.redhat.com/run/21467/

Comment 15 errata-xmlrpc 2011-07-21 09:47:30 UTC
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 therefore 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/RHSA-2011-1065.html

Comment 18 Red Hat Bugzilla 2013-10-04 00:23:13 UTC
Removing external tracker bug with the id '00317700' as it is not valid for this tracker