From: Boris Ostrovsky <boris.ostrovsky@oracle.com>
To: Juergen Gross <jgross@suse.com>,
linux-kernel@vger.kernel.org, xen-devel@lists.xenproject.org
Subject: Re: [PATCH] xen: add new hypercall buffer mapping device
Date: Fri, 15 Jun 2018 10:43:03 -0400 [thread overview]
Message-ID: <ca081371-7b21-85d2-edcc-8b7273c09cb2@oracle.com> (raw)
In-Reply-To: <20180615131740.5037-1-jgross@suse.com>
On 06/15/2018 09:17 AM, Juergen Gross wrote:
> +static int privcmd_buf_mmap(struct file *file, struct vm_area_struct *vma)
> +{
> + struct privcmd_buf_private *file_priv = file->private_data;
> + struct privcmd_buf_vma_private *vma_priv;
> + unsigned int count = vma_pages(vma);
> + unsigned int i;
> + int ret = 0;
> +
> + if (!(vma->vm_flags & VM_SHARED)) {
> + pr_err("Mapping must be shared\n");
> + return -EINVAL;
> + }
> +
> + if (file_priv->allocated + count > limit) {
> + pr_err("Mapping limit reached!\n");
> + return -ENOSPC;
This error (which I thought should have been E2BIG) is not in the list
of allowed error codes (per man page). I think it it's either EINVAL or
ENOMEM (EINVAL seems more appropriate to me).
I am also not sure about pr_err as the caller can force it (although
presumably the file is only accessible to superuser).
-boris
next prev parent reply other threads:[~2018-06-15 14:43 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-06-15 13:17 Juergen Gross
2018-06-15 14:15 ` [Xen-devel] " Andrew Cooper
2018-06-15 14:39 ` Juergen Gross
2018-06-15 14:35 ` Jan Beulich
2018-06-15 14:43 ` Boris Ostrovsky [this message]
2018-06-15 15:26 ` Juergen Gross
[not found] ` <5B23CE9502000078001CBA36@suse.com>
2018-06-15 15:24 ` [Xen-devel] " Juergen Gross
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ca081371-7b21-85d2-edcc-8b7273c09cb2@oracle.com \
--to=boris.ostrovsky@oracle.com \
--cc=jgross@suse.com \
--cc=linux-kernel@vger.kernel.org \
--cc=xen-devel@lists.xenproject.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®