[Bugs] [Bug 1773476] gluster does not return correct filesize and blocksize after ftruncate

bugzilla at redhat.com bugzilla at redhat.com
Mon Nov 25 05:58:07 UTC 2019


--- Comment #5 from Ravishankar N <ravishankar at redhat.com> ---
(In reply to zhou lin from comment #4)
> ok, i will test

Thanks. I haven't found what the problem is yet but in case if this helps you
debug yourself, I found a fairly simple reproducer: The problem is that if you
immediately do a stat after truncate (to non-zero size), it is getting size as
zero as you observed. But if you wait for 1 second, it gets the right size.

[root at vm1 fuse_mnt]# TIME=0
[root at vm1 fuse_mnt]# FILE=file1

[root at vm1 fuse_mnt]# truncate -s 52 $FILE && sleep $TIME && stat -c "%s" $FILE

[root at vm1 fuse_mnt]# TIME=1
[root at vm1 fuse_mnt]# truncate -s 52 $FILE && sleep $TIME && stat -c "%s" $FILE

I also found that if you disable 'readdir-ahead' translator, you get the
correct size even if you mount without attribute-timeout=0 and entry-timeout=0.

You are receiving this mail because:
You are on the CC list for the bug.
You are the assignee for the bug.

More information about the Bugs mailing list