Bug 227373 - link() on nfsv4 sometimes fails to update i_nlink count
link() on nfsv4 sometimes fails to update i_nlink count
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 4
Classification: Red Hat
Component: kernel (Show other bugs)
4.4
All Linux
medium Severity medium
: ---
: ---
Assigned To: Jeff Layton
Brian Brock
:
: 237894 (view as bug list)
Depends On:
Blocks: 248673
  Show dependency treegraph
 
Reported: 2007-02-05 12:42 EST by Jeff Layton
Modified: 2007-11-16 20:14 EST (History)
5 users (show)

See Also:
Fixed In Version: RHBA-2007-0791
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2007-11-15 11:19:35 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


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

  None (edit)
Description Jeff Layton 2007-02-05 12:42:30 EST
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 12:55:34 EST
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 12:57:39 EST
Created attachment 147381 [details]
patch 2 -- optimize nfs4 link calls and add postop attributes

Backported from:

commit 91ba2eeec5e8e86e054937eb3bf5aec5b22b1830
Author: Trond Myklebust <Trond.Myklebust@netapp.com>
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@netapp.com>
Comment 3 Jeff Layton 2007-02-20 11:01:19 EST
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 Product and Program Management 2007-03-08 10:44:08 EST
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 Product and Program Management 2007-04-18 18:31:17 EDT
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 12:39:34 EDT
*** Bug 237894 has been marked as a duplicate of this bug. ***
Comment 8 Jeff Layton 2007-04-26 14:13:46 EDT
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 11:41:34 EDT
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-22 22:06:14 EDT
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 11:19:35 EST
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.