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

bugzilla at redhat.com bugzilla at redhat.com
Fri Nov 29 04:55:09 UTC 2019


https://bugzilla.redhat.com/show_bug.cgi?id=1773476



--- Comment #12 from Ravishankar N <ravishankar at redhat.com> ---
(In reply to Raghavendra G from comment #10)
(In reply to Raghavendra G from comment #11)

> Just to get more details, when was the last stat (with all fields valid) sent?
> Is the 1s you mentioned was,
> 1. after the lookup/readdirp response that returned zeroed out stat (except
> for gfid and type)?
> 2. after a valid lookup/readdirp/stat/fstat response that returned a
> completely valid stat (all fields are valid)?

For the test "[root at vm1 fuse_mnt]# truncate -s 52 $FILE && stat -c "%s" $FILE",
here are the fops and their counts from profile info:
Note: there is no readdir(p) involved.
With readdir-ahead on:
------------------------
1     RELEASE
1       FLUSH
2    FINODELK
1        OPEN
1   FTRUNCATE
2    FXATTROP
2      LOOKUP

With readdir-ahead disabled:
--------------------------

 1     RELEASE
 2    FINODELK
 1       FLUSH
 1        OPEN
 1   FTRUNCATE
 2    FXATTROP
 1    GETXATTR
 4      LOOKUP    

So with readdir-ahead disabled (i.e. rda_inode_ctx_update_iatts() is not
involved), there are 2 extra lookups after the ftruncate that helps getting the
correct size. 
With readdir ahead enabled, those 2 lookup do not seem to be coming which means
the kernel is still considering the values returned during the truncate cbk as
valid.

-- 
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