[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
Wed Nov 16 01:24:25 UTC 2016


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

George <george.lian at nokia.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
              Flags|needinfo?(george.lian at nokia |
                   |.com)                       |



--- Comment #4 from George <george.lian at nokia.com> ---
sorry, I meet an issue on git commit -S
gpg: skipped "GeorgeLian <george.lian at nokia.com>": No secret key
gpg: signing failed: No secret key
error: gpg failed to sign the data
fatal: failed to write commit object

I would like put the git diff messages here , and could you please take a look
first?

--- a/xlators/performance/md-cache/src/md-cache.c
+++ b/xlators/performance/md-cache/src/md-cache.c
@@ -382,8 +382,14 @@ is_md_cache_iatt_valid (xlator_t *this, struct md_cache
*mdc)
         LOCK (&mdc->lock);
         {
                 ret = __is_cache_valid (this, mdc->ia_time);
+
+                /* differ with mdc->ia_time =0  which set in
mdc_inode_iatt_set_validate
+                   set mdc->ia_time = 1 mean 0 is handled here, and indicate
the value could be reset
+                   in mdc_inode_iatt_set_validate
+                */
+
                 if (ret == _gf_false)
-                        mdc->ia_time = 0;
+                        mdc->ia_time = 1;
         }
         UNLOCK (&mdc->lock);

@@ -520,6 +526,15 @@ mdc_inode_iatt_set_validate(xlator_t *this, inode_t
*inode, struct iatt *prebuf,

                 mdc_from_iatt (mdc, iatt);

+                /* Not reset mdc->ia_time while mdc->ia_time is 0,
+                 * which is the flag set by write-behind wb_cbk, if reset
here,
+                 * which mean the flag is over-writed here,
+                 * that will cause the meta-data cache in mdc-cache is stale
data
+                 * Make sure the 0 is read by is_md_cache_iatt_valid then
reset mdc->ia_time
+                 */
+
+                if(!mdc->ia_time) goto unlock;
+
                 time (&mdc->ia_time);
                 gf_msg_callingfn ("md-cache", GF_LOG_TRACE, 0,
                                   MD_CACHE_MSG_CACHE_UPDATE, "Updated
iatt(%s)"

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