The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Alexey Dobriyan <adobriyan@gmail.com>
To: ericvh@gmail.com
Cc: akpm@osdl.org, linux-kernel@vger.kernel.org
Subject: Re: v9fs-transport-modules.patch added to -mm tree
Date: Mon, 6 Jun 2005 14:06:43 +0400	[thread overview]
Message-ID: <200506061406.44290.adobriyan@gmail.com> (raw)
In-Reply-To: <200506060624.j566OYq4010573@shell0.pdx.osdl.net>

Added linux-kernel, sorry.

On Monday 06 June 2005 10:24, akpm@osdl.org wrote:
>      v9fs: transport modules

> --- /dev/null
> +++ 25-akpm/fs/9p/mux.c

> +static int xread(struct v9fs_session_info *v9ses, void *ptr, unsigned long sz)
> +{
> +	int rd = 0;
> +	int ret = 0;
> +	int readnum = 0;
> +	while (rd < sz) {
> +		ret = v9ses->transport->read(v9ses->transport, ptr, sz - rd);
> +		readnum++;
> +		if (ret <= 0) {
> +			dprintk(DEBUG_ERROR, "xread errno %d\n", ret);
> +			return ret;
> +		}
> +		rd += ret;
> +		ptr += ret;
> +	}
> +	return (rd);
> +}

readnum is needed for what?

> +/**
> + * read_message - read a full 9P2000 fcall packet
> + * @v9ses: session info structure
> + * @rcall: fcall structure to read into
> + * @rcalllen: size of fcall structure

This makes me think rcalllen == sizeof(struct v9fs_fcall) which is not true.

> +static int
> +read_message(struct v9fs_session_info *v9ses,
> +	     struct v9fs_fcall *rcall, int rcalllen)
> +{

> +	res = v9fs_deserialize_fcall(v9ses, size, data, v9ses->maxdata,
> +				     rcall, rcalllen);
> +
> +	kfree(data);
> +
> +	if (res == 0)
> +		return -ENOMEM;

v9fs_deserialize_fcall can return 0 if rcall->id in it is unknown. It's
not -ENOMEM.

> +static int v9fs_send(struct v9fs_session_info *v9ses, struct v9fs_rpcreq *req)
> +{

> +	ret =
> +	    v9fs_serialize_fcall(v9ses, tcall, data,
> +				 v9ses->maxdata + V9FS_IOHDRSZ);
> +	if (ret == 0) {
> +		ret = -ENOMEM;

See v9fs_deserialize_fcall wrt "bad msg type".

> +static int v9fs_recvproc(void *data)
> +{

> +	while (!kthread_should_stop() && err >= 0) {
> +		rcall = kmalloc(v9ses->maxdata + V9FS_IOHDRSZ, GFP_KERNEL);
> +		dprintk(DEBUG_MUX, "waiting for message\n");
> +		err = read_message(v9ses, rcall, v9ses->maxdata + V9FS_IOHDRSZ);

Unchecked kmalloc().

> --- /dev/null
> +++ 25-akpm/fs/9p/trans_sock.c

> +/**
> + * v9fs_tcp_init - initialize TCP socket
> + * @trans: private socket structure for mount
> + * @dev_name: mount target
> + * @data: mount options
> + *
> + */
> +
> +static int
> +v9fs_tcp_init(struct v9fs_session_info *v9ses, const char *addr, char *data)

Comment and arguments don't match.

> +/**
> + * v9fs_unix_init - initialize UNIX domain socket
> + * @trans: private socket info
> + * @dev_name: mount target
> + * @data: mount options
> + *
> + */
> +
> +static int
> +v9fs_unix_init(struct v9fs_session_info *v9ses, const char *dev_name,
> +	       char *data)

Comment and arguments don't match.

           reply	other threads:[~2005-06-06 10:02 UTC|newest]

Thread overview: expand[flat|nested]  mbox.gz  Atom feed
 [parent not found: <200506060624.j566OYq4010573@shell0.pdx.osdl.net>]

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=200506061406.44290.adobriyan@gmail.com \
    --to=adobriyan@gmail.com \
    --cc=akpm@osdl.org \
    --cc=ericvh@gmail.com \
    --cc=linux-kernel@vger.kernel.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