From: Greg KH <greg@kroah.com>
To: David Teigland <teigland@redhat.com>
Cc: linux-kernel@vger.kernel.org, akpm@osdl.org
Subject: Re: [PATCH 5/7] dlm: device interface
Date: Mon, 25 Apr 2005 14:23:51 -0700 [thread overview]
Message-ID: <20050425212350.GB25247@kroah.com> (raw)
In-Reply-To: <20050425151303.GF6826@redhat.com>
On Mon, Apr 25, 2005 at 11:13:03PM +0800, David Teigland wrote:
> +#ifndef __KERNEL
> +#define __user
> +#endif
What is this for?
> +/* struct passed to the lock write */
> +struct dlm_lock_params {
> + uint8_t mode;
> + uint16_t flags;
> + uint32_t lkid;
> + uint32_t parent;
These are crossing the userspace/kernelspace boundry, please mark them
__u8, __u16, and __u32.
> + struct dlm_range range;
> + uint8_t namelen;
> + void __user *castparam;
> + void __user *castaddr;
> + void __user *bastparam;
> + void __user *bastaddr;
> + struct dlm_lksb __user *lksb;
> + char lvb[DLM_LVB_LEN];
> + char name[1];
Mix of tabs and spaces.
> +/*
> + * ioctls to create/remove lockspaces, and check how many
> + * outstanding ASTs there are against a particular LS.
> + */
Your comment is wrong, based on the code.
> +static int dlm_ioctl(struct inode *inode, struct file *file,
> + uint command, ulong u)
> +{
> + struct file_info *fi = file->private_data;
> + int status = -EINVAL;
> + int count;
> + struct list_head *tmp_list;
> +
> + switch (command) {
> +
> + /* Are there any ASTs for us to read?
> + * Warning, this returns the number of messages (ASTs)
> + * in the queue, NOT the number of bytes to read
> + */
> + case FIONREAD:
> + count = 0;
> + spin_lock(&fi->fi_ast_lock);
> + list_for_each(tmp_list, &fi->fi_ast_list)
> + count++;
> + spin_unlock(&fi->fi_ast_lock);
> + status = put_user(count, (int *)u);
> + break;
Is this really needed?
thanks,
greg k-h
prev parent reply other threads:[~2005-04-25 21:26 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-04-25 15:13 David Teigland
2005-04-25 16:09 ` Jesper Juhl
2005-04-25 21:27 ` Daniel Phillips
2005-04-25 21:00 ` Arjan van de Ven
2005-04-25 21:23 ` Greg KH [this message]
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=20050425212350.GB25247@kroah.com \
--to=greg@kroah.com \
--cc=akpm@osdl.org \
--cc=linux-kernel@vger.kernel.org \
--cc=teigland@redhat.com \
/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®