Red Hat Bugzilla – Bug 61355
tmpfs does not honor O_TRUNC in 2.4.18-0.4
Last modified: 2007-03-26 23:51:58 EDT
Description of Problem:
shmfs/tmpfs ignores O_TRUNC flag at open time
Version-Release number of selected component (if applicable):
Rawhide kernel-2.4.18-0.4, built locally. tmpfs mounted in /tmp.
Steps to Reproduce:
1. mount tmpfs as /tmp
2. echo 1234567 > /tmp/test
3. echo 1 > /tmp/test
4. cat /tmp/test or ls -l /tmp/test -- file should contain 2 bytes
This is a very serious issue. It broke many apps (I discovered this
first for patch(1) program that produces garbage as a result). All
previous kernel versions as I know of was ok.
Sorry a typo -- not shmfs but tmpfs.
We recommend against using tmpfs for /tmp, despite the name.
Looks like -0.4 picked up a bug fixed in later -ac. You'll find I also broke
permission/owner setting. Should be fixed in our build tree if Arjan is on the
should be fixed in 2.4.18-0.13 (skipjack2) or 2.4.18-0.18 (rawhide)
Yes, indicated kernels, and 2.4.18-0.22, seems to be ok.
I'm sorry for long delay - had no chance to test this earlier (it is
very difficult to make any rpm from current rawhide -- way too much
bload/dependances... ;). I think this bug may be closed now. Should
I do that?
thanks for verifying!