Bug 227373 - link() on nfsv4 sometimes fails to update i_nlink count
Summary: link() on nfsv4 sometimes fails to update i_nlink count
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 4
Classification: Red Hat
Component: kernel
Version: 4.4
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
: ---
Assignee: Jeff Layton
QA Contact: Brian Brock
URL:
Whiteboard:
: 237894 (view as bug list)
Depends On:
Blocks: 248673
TreeView+ depends on / blocked
 
Reported: 2007-02-05 17:42 UTC by Jeff Layton
Modified: 2007-11-17 01:14 UTC (History)
5 users (show)

Fixed In Version: RHBA-2007-0791
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2007-11-15 16:19:35 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
patch 1 -- add restorefh xdr calls (1.09 KB, patch)
2007-02-05 17:55 UTC, Jeff Layton
no flags Details | Diff
patch 2 -- optimize nfs4 link calls and add postop attributes (3.81 KB, patch)
2007-02-05 17:57 UTC, Jeff Layton
no flags Details | Diff


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2007:0791 0 normal SHIPPED_LIVE Updated kernel packages available for Red Hat Enterprise Linux 4 Update 6 2007-11-14 18:25:55 UTC

Description Jeff Layton 2007-02-05 17:42:30 UTC
This was noticed at connectathon running cthon04 basic test7 against a Solaris
10 NFS server. This is the rename and link test. Sometimes, after creating a
hardlink, a follow-on stat call would still show that i_nlink hadn't been
incremented.

The issue seems to be that we're not properly doing a postop attribute update
after the LINK call.

Comment 1 Jeff Layton 2007-02-05 17:55:34 UTC
Created attachment 147380 [details]
patch 1 -- add restorefh xdr calls

Preliminary patch to add the xdr functions for RESTOREFH.

Comment 2 Jeff Layton 2007-02-05 17:57:39 UTC
Created attachment 147381 [details]
patch 2 -- optimize nfs4 link calls and add postop attributes

Backported from:

commit 91ba2eeec5e8e86e054937eb3bf5aec5b22b1830
Author: Trond Myklebust <Trond.Myklebust>
Date:	Thu Oct 27 22:12:42 2005 -0400

    NFSv4: Add post-op attributes to nfs4_proc_link()
    
     Optimise attribute revalidation when hardlinking. Add post-op attributes
     for the directory and the original inode.
    
     Signed-off-by: Trond Myklebust <Trond.Myklebust>

Comment 3 Jeff Layton 2007-02-20 16:01:19 UTC
Reproducer here is pretty much identical to the one in 227249:

On an nfs4 mount:

$ mkdir d1 d2
$ touch d1/foo; stat d1/foo; ln d1/foo d2/bar; stat d1/foo

The second stat should show 2 hardlinks, but it usually shows only 1. With a
combination of the two patches in this BZ, the problem goes away.


Comment 5 RHEL Program Management 2007-03-08 15:44:08 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 6 RHEL Program Management 2007-04-18 22:31:17 UTC
This request was evaluated by Red Hat Kernel Team for inclusion in a Red
Hat Enterprise Linux maintenance release, and has moved to bugzilla 
status POST.

Comment 7 Peter Staubach 2007-04-26 16:39:34 UTC
*** Bug 237894 has been marked as a duplicate of this bug. ***

Comment 8 Jeff Layton 2007-04-26 18:13:46 UTC
It's not clear to me that this is a regression, though maybe we opened a race
window with a different patch and that makes this occur more often, or we
eliminated a GETATTR somewhere.

It looks like Steve D. made mention of seeing this issue as well, and said that
the patchset for bz155929 seemed to fix it for him. This does not seem to be the
case since we still see the problem even with his patches.

I think this patch is the surest way to fix this since it ensures that the attrs
are updated after the link.




Comment 9 Jason Baron 2007-06-05 15:41:34 UTC
committed in stream U6 build 55.6. A test kernel with this patch is available
from http://people.redhat.com/~jbaron/rhel4/


Comment 11 Don Domingo 2007-08-23 02:06:14 UTC
added to RHEL4.6 release notes under "Kernel-Related Updates":

<quote>
fixed an nfsv4 link bug that prevented i_nlink counts from updating properly
</quote>

please advise if any revisions are necessary. thanks!



Comment 13 errata-xmlrpc 2007-11-15 16:19:35 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 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-0791.html



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