diff options
| author | Anand V. Avati <avati@amp.gluster.com> | 2009-04-22 02:21:46 +0530 | 
|---|---|---|
| committer | Anand V. Avati <avati@amp.gluster.com> | 2009-04-22 13:07:03 +0530 | 
| commit | 8d2e5d8062361df451be7c6f748a23884f1cf315 (patch) | |
| tree | 5d19ab5402d9e75cc3ab2ad24e806e53ce46f6ba /xlators/cluster | |
| parent | 07f1524165f864e09033b7f78e921c5375d4e2d6 (diff) | |
afr_lookup_cbk - self-heal getting missed
compare for mismatching sizes and attributes before overwriting local->stbuf for read-child subvolume. This causes files with differing sizes on backed not to get self-healed if xattrs were missing.
Also add the ESTALE check for compulsorily failing revalidates in case of 2nd unwind and beyond
Signed-off-by: Anand V. Avati <avati@amp.gluster.com>
Diffstat (limited to 'xlators/cluster')
| -rw-r--r-- | xlators/cluster/afr/src/afr.c | 50 | 
1 files changed, 25 insertions, 25 deletions
diff --git a/xlators/cluster/afr/src/afr.c b/xlators/cluster/afr/src/afr.c index 270364ff999..1808961adca 100644 --- a/xlators/cluster/afr/src/afr.c +++ b/xlators/cluster/afr/src/afr.c @@ -521,15 +521,36 @@ afr_lookup_cbk (call_frame_t *frame, void *cookie,                          }  		} else { -                        if ((local->op_ret == 0) -                            && (child_index == local->read_child_index)) { +			if (FILETYPE_DIFFERS (buf, lookup_buf)) { +				/* mismatching filetypes with same name +				   -- Govinda !! GOvinda !!! +				*/ +				local->govinda_gOvinda = 1; +			} + +			if (PERMISSION_DIFFERS (buf, lookup_buf)) { +				/* mismatching permissions */ +				local->need_metadata_self_heal = 1; +			} + +			if (OWNERSHIP_DIFFERS (buf, lookup_buf)) { +				/* mismatching permissions */ +				local->need_metadata_self_heal = 1; +			} + +			if (SIZE_DIFFERS (buf, lookup_buf) +			    && S_ISREG (buf->st_mode)) { +				local->need_data_self_heal = 1; +			} + +                        if (child_index == local->read_child_index) {                                  /*                                      lookup has succeeded on the read child.                                     So use its inode number                                  */ - -                                local->op_ret = op_ret; +                                if (local->op_errno != ESTALE) +                                        local->op_ret = op_ret;                                  if (local->cont.lookup.xattr)                                          dict_unref (local->cont.lookup.xattr); @@ -553,27 +574,6 @@ afr_lookup_cbk (call_frame_t *frame, void *cookie,                                  }                          } -			if (FILETYPE_DIFFERS (buf, lookup_buf)) { -				/* mismatching filetypes with same name -				   -- Govinda !! GOvinda !!! -				*/ -				local->govinda_gOvinda = 1; -			} - -			if (PERMISSION_DIFFERS (buf, lookup_buf)) { -				/* mismatching permissions */ -				local->need_metadata_self_heal = 1; -			} - -			if (OWNERSHIP_DIFFERS (buf, lookup_buf)) { -				/* mismatching permissions */ -				local->need_metadata_self_heal = 1; -			} - -			if (SIZE_DIFFERS (buf, lookup_buf) -			    && S_ISREG (buf->st_mode)) { -				local->need_data_self_heal = 1; -			}  		}  		local->success_count++;  | 
