Return-Path: Received: from m12-12.163.com ([220.181.12.12]:34825 "EHLO m12-12.163.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752155AbdJGBg6 (ORCPT ); Fri, 6 Oct 2017 21:36:58 -0400 From: Jia-Ju Bai Subject: [BUG] fs/aio: A possible sleep-in-atomic bug in aio_migratepage To: bcrl@kvack.org, Al Viro Cc: linux-aio@kvack.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Message-ID: Date: Sat, 7 Oct 2017 09:36:48 +0800 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US Sender: linux-fsdevel-owner@vger.kernel.org List-ID: 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. Thanks, Jia-Ju Bai