summaryrefslogtreecommitdiffstats
path: root/xlators/storage
diff options
context:
space:
mode:
authorVenky Shankar <vshankar@redhat.com>2016-01-27 17:04:18 +0530
committerVenky Shankar <vshankar@redhat.com>2016-01-28 05:29:08 -0800
commitf5ff11159544aa16b44965a0ce4500e9c615895d (patch)
tree8ad871583047bcbc831aab2b220d49eb711080d6 /xlators/storage
parenta816cc5124951a2cbe57d2bd95b6690e766c57a7 (diff)
features / bitrot: Prevent spurious pthread_cond_wait() wakeup
Backport of http://review.gluster.org/13302 pthread_cond_wait() is prone to spurious wakeups and it's utmost necessarry to check a boolean predicate for thread continuation. See man(3) pthread_cond_wait() for details. The following is done in bitrot scrubber: if (list_empty (&fsscrub->scrublist)) pthread_cond_wait (&fsscrub->cond, &fsscrub->mutex); followed by: list_first_entry (&fsscrub->scrublist, ...) A spurious wakeup from pthread_cond_wait() with the absence of list_empty() check causes list_first_entry() to return garbage. BUG: 1302199 Change-Id: I60151eabb8af257a35acd8e7c117876388166a0e Signed-off-by: Venky Shankar <vshankar@redhat.com> Reviewed-on: http://review.gluster.org/13307 Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com> Tested-by: Pranith Kumar Karampuri <pkarampu@redhat.com> Smoke: Gluster Build System <jenkins@build.gluster.com> NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org> CentOS-regression: Gluster Build System <jenkins@build.gluster.com>
Diffstat (limited to 'xlators/storage')
0 files changed, 0 insertions, 0 deletions