linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Yan Zheng" <yanzheng@21cn.com>
To: linux-fsdevel@vger.kernel.org, linux-kernel@zh-kernel.org,
	akpm@linux-foundation.org
Subject: [PATCH]AIO: fix cleanup in io_submit_one(...)
Date: Sun, 7 Oct 2007 00:24:28 +0800	[thread overview]
Message-ID: <3d0408630710060924l348462e4k67d462f5e85079a6@mail.gmail.com> (raw)

Hello,

When IOCB_FLAG_RESFD flag is set and iocb->aio_resfd is incorrect,
statement 'goto out_put_req' is executed. At label 'out_put_req',
aio_put_req(..) is called, which requires 'req->ki_filp' set.

Regards

Signed-off-by: Yan Zheng<yanzheng@21cn.com>
----
diff -ur linux-2.6.23-rc9/fs/aio.c linux/fs/aio.c
--- linux-2.6.23-rc9/fs/aio.c	2007-07-09 07:32:17.000000000 +0800
+++ linux/fs/aio.c	2007-10-07 00:05:10.000000000 +0800
@@ -1562,6 +1562,7 @@
 		fput(file);
 		return -EAGAIN;
 	}
+	req->ki_filp = file;
 	if (iocb->aio_flags & IOCB_FLAG_RESFD) {
 		/*
 		 * If the IOCB_FLAG_RESFD flag of aio_flags is set, get an
@@ -1576,7 +1577,6 @@
 		}
 	}

-	req->ki_filp = file;
 	ret = put_user(req->ki_key, &user_iocb->aio_key);
 	if (unlikely(ret)) {
 		dprintk("EFAULT: aio_key\n");

                 reply	other threads:[~2007-10-06 16:24 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=3d0408630710060924l348462e4k67d462f5e85079a6@mail.gmail.com \
    --to=yanzheng@21cn.com \
    --cc=akpm@linux-foundation.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@zh-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;
as well as URLs for NNTP newsgroup(s).