Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 60395

Summary: stat() seems to return always size zero for any fifo (named pipe)
Product: [Retired] Red Hat Linux Reporter: Pedro Pascual <pedro.pascual>
Component: kernelAssignee: Arjan van de Ven <arjanv>
Status: CLOSED ERRATA QA Contact: Brian Brock <bbrock>
Severity: medium Docs Contact:
Priority: medium    
Version: 7.2CC: ddjbolling
Target Milestone: ---   
Target Release: ---   
Hardware: i686   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2002-02-27 12:55:37 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:

Description Pedro Pascual 2002-02-27 12:50:07 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:0.9.8) Gecko/20020205

Description of problem:
I have a problem using stat() with kernel 2.4.9-21.
The size of ANY fifo is always 0.
There is no backward compatibility.
Probably it is a kernel bug in this particular version.
The problem shows up when using the ls, stat commands.


Version-Release number of selected component (if applicable):


How reproducible:
Always

Steps to Reproduce:
1. mkfifo xx
2. cat > xx &
3. cat < xx
4. ^Z
5. echo "abcd" > xx

	

Actual Results:  prw-rw-r--    1 kostadin kostadin        0 Feb 21 13:54 xx


Expected Results:  prw-rw-r--    1 kostadin kostadin        5 Feb 21 13:54 xx


Additional info:

The expected results is what you get with previous kernels like 2.4.3-12

Comment 1 Arjan van de Ven 2002-02-27 12:55:32 UTC
stat() on a fifo is undefined as per POSIX and SUS standards. The value it had
before was random, and due to a very serious kernel bug actually looked like
something real.

If you have software that depends on this you REALLY need to fix the software.
REALLY.

We can try to make it return a value that looks like something real again,
maybe. But this "meaning" is actually without meaning since it depends on the
current internal implementation on fifo's and that implementation will change
soon.

Comment 2 Arjan van de Ven 2002-02-28 09:41:43 UTC
2.4.9-31 will return some random value instead of 0

Comment 3 Doug Bolling 2002-05-16 19:39:14 UTC
On Linux version 2.2.17-14 (RedHat 7.0), the stat always returned the actual 
number of unread bytes in the fifo (not a random value).  We are now running 
Linux version 2.4.7-10 (RedHat 7.2) and the stat always returns a size of 
zero.  If your explanation of the problem is accurate, how do we go about 
getting the number of unread bytes in the fifo before we do any reads on the 
fifo?

Doug