diff options
author | Pranith Kumar K <pranithk@gluster.com> | 2012-03-29 12:17:12 +0530 |
---|---|---|
committer | Vijay Bellur <vijay@gluster.com> | 2012-03-29 04:52:53 -0700 |
commit | 834408a49f204e8c256dad4b46d0f19053bf4b0e (patch) | |
tree | 947d7b0e2d6ae457fa451d8c696e5c37e3b3ec69 /xlators/cluster/afr/src/afr-self-heal-data.c | |
parent | fbfb4d48491b160436e6ac986057a8fe5e320502 (diff) |
cluster/afr: handle fstat failure in data-self-heal
The final fstat which makes the call_count 0 could be a failure.
In that case the buf could either be NULL or buf is all zeros.
If buf is NULL then it will crash, if it is all zeros
buf->ia_type will be IA_INVAL and it proceeds to special file fix.
sh->type is assigned with the ia_type of the file to be healed.
I modified the code to depend on that instead.
Change-Id: Icf7e19ff5908207128f2a1ee2963ad6b791c1ac5
BUG: 804645
Signed-off-by: Pranith Kumar K <pranithk@gluster.com>
Reviewed-on: http://review.gluster.com/3031
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vijay@gluster.com>
Diffstat (limited to 'xlators/cluster/afr/src/afr-self-heal-data.c')
-rw-r--r-- | xlators/cluster/afr/src/afr-self-heal-data.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/xlators/cluster/afr/src/afr-self-heal-data.c b/xlators/cluster/afr/src/afr-self-heal-data.c index 3df6a0e8705..bf37729fe82 100644 --- a/xlators/cluster/afr/src/afr-self-heal-data.c +++ b/xlators/cluster/afr/src/afr-self-heal-data.c @@ -909,7 +909,7 @@ afr_sh_data_fstat_cbk (call_frame_t *frame, void *cookie, afr_sh_data_fail (frame, this); goto out; } - if (IA_ISREG (buf->ia_type)) + if (IA_ISREG (sh->type)) afr_sh_data_fix (frame, this); else afr_sh_data_special_file_fix (frame, this); |