[Bug 18372] New: A filled up named pipe always has a size of zero!

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



https://bugzilla.kernel.org/show_bug.cgi?id=18372

           Summary: A filled up named pipe always has a size of zero!
           Product: File System
           Version: 2.5
    Kernel Version: 2.6.32-22-generic (also older and newer ones)
          Platform: All
        OS/Version: Linux
              Tree: Mainline
            Status: NEW
          Severity: high
          Priority: P1
         Component: ext4
        AssignedTo: fs_ext4@xxxxxxxxxxxxxxxxxxxx
        ReportedBy: tom.bzliknl83947@xxxxxxxxx
                CC: tom.bzliknl83947@xxxxxxxxx
        Regression: No


Hi, there!

The size of a filled named pipe is always zero. This is wrong! A read operation
is going to hang for try to read from an empty pipe. To go around this trap it
is necessary to do a conditional test on the filesize, [ -s pipe ]. Problem:
The test doesn't work, because filesize is always zero.

Try:
mknod pipe &
sleep 3600  <>pipe &
echo 'date' >pipe
[ -s pipe ] && echo "filled up"
ls -l pipe; stat pipe    # if size zero, it is wrong
[ -s pipe ] && (read val <pipe; echo $val)


This is a critical error. While parallel processing a script would be blocked.
In worst case it causes a deadlock situation. Every changing of a condition of
a file should be reported whithin the i-node. 

I found it in several disto: Ubuntu KarmicKoala 9.1, LucidLynx 10.04,
Linux Mint Debian Edition 5, Slackware 13.1 x64

Best regards
TOM

-- 
Configure bugmail: https://bugzilla.kernel.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are watching the assignee of the bug.
--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Reiser Filesystem Development]     [Ceph FS]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux FS]     [Yosemite National Park]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Device Mapper]     [Linux Media]

  Powered by Linux