All of lore.kernel.org
 help / color / mirror / Atom feed
From: Al Viro <viro@ZenIV.linux.org.uk>
To: Jia-Ju Bai <baijiaju1990@163.com>
Cc: bcrl@kvack.org, linux-aio@kvack.org,
	linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [BUG] fs/aio: A possible sleep-in-atomic bug in aio_migratepage
Date: Sat, 7 Oct 2017 03:31:52 +0100	[thread overview]
Message-ID: <20171007023152.GQ21978@ZenIV.linux.org.uk> (raw)
In-Reply-To: <dee03130-37ef-3958-455b-b1fca415b2c1@163.com>

On Sat, Oct 07, 2017 at 09:36:48AM +0800, Jia-Ju Bai wrote:
> According to fs/aio.c, cond_resched is called under a spinlock,
> and the function call path is:
> aio_migratepage (acquire the spinlock)
>   migrate_page_copy
>     copy_huge_page
>       __copy_gigantic_page
>         cond_resched
>           might_sleep
> 
> This bug is found by my static analysis tool and my code review.
> A possible fix is to remove cond_resched in __copy_gigantic_page.

How the hell would a huge page end up in page cache of inode created
by aio_private_file()???

      reply	other threads:[~2017-10-07  2:31 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-07  1:36 [BUG] fs/aio: A possible sleep-in-atomic bug in aio_migratepage Jia-Ju Bai
2017-10-07  2:31 ` Al Viro [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=20171007023152.GQ21978@ZenIV.linux.org.uk \
    --to=viro@zeniv.linux.org.uk \
    --cc=baijiaju1990@163.com \
    --cc=bcrl@kvack.org \
    --cc=linux-aio@kvack.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.