This folds ops_results and error into one. This enables the error code to trickle all the way to the calling function and the gfs2 mount fails if older dlm_controld is used. Signed-off-by: Goldwyn Rodrigues <rgoldwyn@xxxxxxxx> --- diff --git a/fs/dlm/lockspace.c b/fs/dlm/lockspace.c index 88556dc..8c8327a 100644 --- a/fs/dlm/lockspace.c +++ b/fs/dlm/lockspace.c @@ -409,7 +409,7 @@ static void threads_stop(void) static int new_lockspace(const char *name, const char *cluster, uint32_t flags, int lvblen, const struct dlm_lockspace_ops *ops, void *ops_arg, - int *ops_result, dlm_lockspace_t **lockspace) + dlm_lockspace_t **lockspace) { struct dlm_ls *ls; int i, size, error; @@ -431,11 +431,9 @@ static int new_lockspace(const char *name, const char *cluster, goto out; } - if (ops && ops_result) { - if (!dlm_config.ci_recover_callbacks) - *ops_result = -EOPNOTSUPP; - else - *ops_result = 0; + if (ops && (!dlm_config.ci_recover_callbacks)) { + error = -EOPNOTSUPP; + goto out; } if (dlm_config.ci_recover_callbacks && cluster && @@ -679,7 +677,7 @@ static int new_lockspace(const char *name, const char *cluster, int dlm_new_lockspace(const char *name, const char *cluster, uint32_t flags, int lvblen, const struct dlm_lockspace_ops *ops, void *ops_arg, - int *ops_result, dlm_lockspace_t **lockspace) + dlm_lockspace_t **lockspace) { int error = 0; @@ -690,7 +688,7 @@ int dlm_new_lockspace(const char *name, const char *cluster, goto out; error = new_lockspace(name, cluster, flags, lvblen, ops, ops_arg, - ops_result, lockspace); + lockspace); if (!error) ls_count++; if (error > 0) diff --git a/fs/dlm/user.c b/fs/dlm/user.c index 8121491..a29dd09 100644 --- a/fs/dlm/user.c +++ b/fs/dlm/user.c @@ -393,7 +393,7 @@ static int device_create_lockspace(struct dlm_lspace_params *params) return -EPERM; error = dlm_new_lockspace(params->name, NULL, params->flags, - DLM_USER_LVB_LEN, NULL, NULL, NULL, + DLM_USER_LVB_LEN, NULL, NULL, &lockspace); if (error) return error; diff --git a/fs/gfs2/lock_dlm.c b/fs/gfs2/lock_dlm.c index c8423d6..2043544 100644 --- a/fs/gfs2/lock_dlm.c +++ b/fs/gfs2/lock_dlm.c @@ -1190,7 +1190,7 @@ static int gdlm_mount(struct gfs2_sbd *sdp, const char *table) char cluster[GFS2_LOCKNAME_LEN]; const char *fsname; uint32_t flags; - int error, ops_result; + int error; /* * initialize everything @@ -1232,24 +1232,13 @@ static int gdlm_mount(struct gfs2_sbd *sdp, const char *table) */ error = dlm_new_lockspace(fsname, cluster, flags, GDLM_LVB_SIZE, - &gdlm_lockspace_ops, sdp, &ops_result, + &gdlm_lockspace_ops, sdp, &ls->ls_dlm); if (error) { fs_err(sdp, "dlm_new_lockspace error %d\n", error); goto fail_free; } - if (ops_result < 0) { - /* - * dlm does not support ops callbacks, - * old dlm_controld/gfs_controld are used, try without ops. - */ - fs_info(sdp, "dlm lockspace ops not used\n"); - free_recover_size(ls); - set_bit(DFL_NO_DLM_OPS, &ls->ls_recover_flags); - return 0; - } - if (!test_bit(SDF_NOJOURNALID, &sdp->sd_flags)) { fs_err(sdp, "dlm lockspace ops disallow jid preset\n"); error = -EINVAL; diff --git a/fs/ocfs2/stack_user.c b/fs/ocfs2/stack_user.c index 286edf1..6546a6b 100644 --- a/fs/ocfs2/stack_user.c +++ b/fs/ocfs2/stack_user.c @@ -828,7 +828,7 @@ static int user_cluster_connect(struct ocfs2_cluster_connection *conn) } rc = dlm_new_lockspace(conn->cc_name, NULL, DLM_LSFL_FS, DLM_LVB_LEN, - NULL, NULL, NULL, &fsdlm); + NULL, NULL, &fsdlm); if (rc) { ocfs2_live_connection_drop(control); goto out; diff --git a/include/linux/dlm.h b/include/linux/dlm.h index d02da2c..9522b25 100644 --- a/include/linux/dlm.h +++ b/include/linux/dlm.h @@ -85,7 +85,7 @@ struct dlm_lockspace_ops { int dlm_new_lockspace(const char *name, const char *cluster, uint32_t flags, int lvblen, const struct dlm_lockspace_ops *ops, void *ops_arg, - int *ops_result, dlm_lockspace_t **lockspace); + dlm_lockspace_t **lockspace); /* * dlm_release_lockspace -- Linux-cluster mailing list Linux-cluster@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/linux-cluster