[Bugs] [Bug 1393743] the return size of fstat sometime is not correct while write-behind feature enabled

bugzilla at redhat.com bugzilla at redhat.com
Fri Nov 11 08:22:40 UTC 2016


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



--- Comment #1 from George <george.lian at nokia.com> ---
I seems find the root cause of this issue.

T0: f_stat is called with mdc-cache not hit, so called from server via RPC
T1: write is called
T2: mdc_writev_cbk is called , and call mdc_inode_iatt_set_validate , due to 
“(!iatt || !iatt->ia_ctime)” set mdc->ia_time=0 , this will let
is_md_cache_iatt_valid return faluse, am I right?
T3: f_stat_cbk is called and call mdc_inode_iatt_set_validate, and overwrite 
mdc->ia_time  with “time (&mdc->ia_time);”
T4: another fstat is called, mdc-cache hit, so just get the old st_size from
the old value stored by previous f_stat, but it not include the write of T1

T0<T1<T2<T3<T4,
In this case, is there a bug here?

And my fix is like below:
                mdc_from_iatt (mdc, iatt);

-                time (&mdc->ia_time);
+               if(mdc->ia_time)  time (&mdc->ia_time);  /*if mdc->ia_time is
0, don’t update it , so just let the stat md_cache_iatt_valid  is invalidate */

Now I am test the change , and will update the result when the time is long
enough.

Could you please confirm my findings and the code change for this issue? is
there any risk for this change?

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