[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20140320143207.GA3760@redhat.com>
Date: Thu, 20 Mar 2014 10:32:07 -0400
From: Dave Jones <davej@...hat.com>
To: Gu Zheng <guz.fnst@...fujitsu.com>
Cc: Benjamin <bcrl@...ck.org>, Al Viro <viro@...iv.linux.org.uk>,
jmoyer@...hat.com, kosaki.motohiro@...fujitsu.com,
KAMEZAWA Hiroyuki <kamezawa.hiroyu@...fujitsu.com>,
Yasuaki Ishimatsu <isimatu.yasuaki@...fujitsu.com>,
tangchen <tangchen@...fujitsu.com>, miaox@...fujitsu.com,
linux-aio@...ck.org, fsdevel <linux-fsdevel@...r.kernel.org>,
linux-kernel <linux-kernel@...r.kernel.org>,
Andrew Morton <akpm@...ux-foundation.org>
Subject: Re: [PATCH 2/2] aio: fix the confliction of read events and
migrating ring page
On Thu, Mar 20, 2014 at 01:46:25PM +0800, Gu Zheng wrote:
> diff --git a/fs/aio.c b/fs/aio.c
> index 88ad40c..e353085 100644
> --- a/fs/aio.c
> +++ b/fs/aio.c
> @@ -319,6 +319,9 @@ static int aio_migratepage(struct address_space *mapping, struct page *new,
> ctx->ring_pages[old->index] = new;
> spin_unlock_irqrestore(&ctx->completion_lock, flags);
>
> + /* Ensure read event is completed before putting old page */
> + mutex_lock(&ctx->ring_lock);
> + mutex_unlock(&ctx->ring_lock);
> put_page(old);
>
> return rc;
This looks a bit weird. Would using a completion work here ?
Dave
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists