Bug 626974 - nfs: too many GETATTR and ACCESS calls after direct i/o
Summary: nfs: too many GETATTR and ACCESS calls after direct i/o
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: kernel
Version: 5.5
Hardware: All
OS: Linux
low
high
Target Milestone: rc
: ---
Assignee: Jeff Layton
QA Contact: Jian Li
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2010-08-24 19:07 UTC by Herbert van den Bergh
Modified: 2018-12-01 17:05 UTC (History)
14 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2011-07-21 09:47:30 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
[PATCH] NFS: Too many GETATTR and ACCESS calls after direct I/O (2.83 KB, patch)
2010-08-24 19:07 UTC, Herbert van den Bergh
no flags Details | Diff


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2011:1065 0 normal SHIPPED_LIVE Important: Red Hat Enterprise Linux 5.7 kernel security and bug fix update 2011-07-21 09:21:37 UTC

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


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