Skip to content

Commit d874703

Browse files
afr:prevent null pointer access in afr_notify
Add a check for the `this->cleanup_starting` flag at the beginning of `afr_notify()` to skip notifications for volumes that are undergoing finalization (`fini`). This prevents `afr_has_quorum` from accessing already freed `this->private`. Fixex: #4644
1 parent 33ea6c5 commit d874703

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

xlators/cluster/afr/src/afr-common.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6397,7 +6397,6 @@ afr_notify(xlator_t *this, int32_t event, void *data, void *data2)
63976397
}
63986398
}
63996399
}
6400-
UNLOCK(&priv->lock);
64016400

64026401
if (priv->quorum_count) {
64036402
has_quorum = afr_has_quorum(priv->child_up, priv, NULL);
@@ -6414,6 +6413,7 @@ afr_notify(xlator_t *this, int32_t event, void *data, void *data2)
64146413
this->ctx->cmd_args.client_pid, this->name);
64156414
}
64166415
}
6416+
UNLOCK(&priv->lock);
64176417

64186418
/* if all subvols have reported status, no need to hide anything
64196419
or wait for anything else. Just propagate blindly */

0 commit comments

Comments
 (0)