diff options
Diffstat (limited to 'drivers/staging/dst')
-rw-r--r-- | drivers/staging/dst/dcore.c | 9 | ||||
-rw-r--r-- | drivers/staging/dst/export.c | 2 |
2 files changed, 8 insertions, 3 deletions
diff --git a/drivers/staging/dst/dcore.c b/drivers/staging/dst/dcore.c index ac8577358ba0..c24e4e0367a2 100644 --- a/drivers/staging/dst/dcore.c +++ b/drivers/staging/dst/dcore.c @@ -102,7 +102,7 @@ static int dst_request(struct request_queue *q, struct bio *bio) struct dst_node *n = q->queuedata; int err = -EIO; - if (bio_empty_barrier(bio) && !q->prepare_discard_fn) { + if (bio_empty_barrier(bio) && !blk_queue_discard(q)) { /* * This is a dirty^Wnice hack, but if we complete this * operation with -EOPNOTSUPP like intended, XFS @@ -847,7 +847,7 @@ static dst_command_func dst_commands[] = { /* * Configuration parser. */ -static void cn_dst_callback(struct cn_msg *msg) +static void cn_dst_callback(struct cn_msg *msg, struct netlink_skb_parms *nsp) { struct dst_ctl *ctl; int err; @@ -855,6 +855,11 @@ static void cn_dst_callback(struct cn_msg *msg) struct dst_node *n = NULL, *tmp; unsigned int hash; + if (!cap_raised(nsp->eff_cap, CAP_SYS_ADMIN)) { + err = -EPERM; + goto out; + } + if (msg->len < sizeof(struct dst_ctl)) { err = -EBADMSG; goto out; diff --git a/drivers/staging/dst/export.c b/drivers/staging/dst/export.c index 80ae4ebe610a..4fbd848bd14f 100644 --- a/drivers/staging/dst/export.c +++ b/drivers/staging/dst/export.c @@ -159,7 +159,7 @@ static struct dst_state *dst_accept_client(struct dst_state *st) goto err_out_exit; new = dst_state_alloc(st->node); - if (!new) { + if (IS_ERR(new)) { err = -ENOMEM; goto err_out_release; } |