From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Date: Sat, 7 Oct 2017 03:31:52 +0100 From: Al Viro To: Jia-Ju Bai 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 Message-ID: <20171007023152.GQ21978@ZenIV.linux.org.uk> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org List-ID: 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()???