Bug 520018

Summary: statfs on NFS partition always returns 0
Product: Red Hat Enterprise Linux 4 Reporter: Issue Tracker <tao>
Component: kernelAssignee: Jeff Layton <jlayton>
Status: CLOSED ERRATA QA Contact: Petr Beňas <pbenas>
Severity: high Docs Contact:
Priority: high    
Version: 4.8CC: jlayton, pbenas, pstehlik, rwheeler, staubach, steved, tao, tumeya
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-02-16 15:51:35 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:
Bug Depends On:    
Bug Blocks: 589293    
Attachments:
Description Flags
Proposed patch against inode.c of EL4.
none
reproducer code
none
proposed patch none

Description Issue Tracker 2009-08-28 02:20:10 UTC
Escalated to Bugzilla from IssueTracker

Comment 1 Takuma Umeya 2009-08-28 02:22:39 UTC
This report is for EL4. For EL5 it's reported in BZ519112. 

Description of problem:
statfs on NFS partition always returns 0 regardless of success/fail. 

Steps to Reproduce:
1. Start NFS service:
    # echo "/test        *(rw,no_root_squash)" >> /etc/exports
    # service nfs start
2. Setup client:
    # mount -t nfs -o soft,timeo=5 server:/test /mnt/nfs
3. Stop NFS service:
    # service nfs stop
4. From the client, run the attached test program:

Actual results:
The program returns with 0, which actually should return negative number
according to statfs(2) but returns 0. 

Expected results: 
Should return negative number. 

According to the call trace nfs_statfs is not returning the value properly. 
sys_statfs() => return 0
  vfs_statfs() => return 0
    nfs_statfs() => return 0
      nfs3_proc_statfs() => return -5

The patch is already upstream: 
1a0ba9ae485c5fd17d0bff2f14d9dd75b8985593

Comment 2 Takuma Umeya 2009-08-28 03:20:00 UTC
Created attachment 358986 [details]
Proposed patch against inode.c of EL4.

Comment 3 Takuma Umeya 2009-08-28 03:21:12 UTC
Created attachment 358987 [details]
reproducer code

Comment 4 Jeff Layton 2009-09-01 20:09:33 UTC
*** Bug 520092 has been marked as a duplicate of this bug. ***

Comment 5 Jeff Layton 2009-09-04 11:27:26 UTC
The test kernels on my people.redhat.com page have a patch to fix this (and also to turn the printk in this function into a dprintk). Could you test them and let me know whether they resolve the issue for you?

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

Comment 6 Jeff Layton 2009-09-04 11:28:22 UTC
Created attachment 359795 [details]
proposed patch

Comment 10 RHEL Program Management 2009-09-08 15:17:20 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 11 Vivek Goyal 2010-09-23 13:02:40 UTC
Committed in 89.37.EL . RPMS are available at http://people.redhat.com/vgoyal/rhel4/

Comment 16 Petr Beňas 2010-10-20 14:20:19 UTC
Reproduced in 2.6.9-89.36.EL and verified in 2.6.9-89.37.EL.

Comment 19 errata-xmlrpc 2011-02-16 15:51: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 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-0263.html