Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752209AbdLLA7o (ORCPT ); Mon, 11 Dec 2017 19:59:44 -0500 Received: from mail-pg0-f68.google.com ([74.125.83.68]:42938 "EHLO mail-pg0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751622AbdLLA7j (ORCPT ); Mon, 11 Dec 2017 19:59:39 -0500 X-Google-Smtp-Source: ACJfBovkKJE0yiLjxN+TiN0Een0p6XpfT668nbBM1ClKUdBa6h6mBe+Smaa7c8ScBs7LZ+Ou2j2k3Q== To: jaegeuk@kernel.org, yuchao0@huawei.com Cc: linux-f2fs-devel@lists.sourceforge.net, Linux Kernel Mailing List From: Jia-Ju Bai Subject: [BUG] fs/f2fs: a possible sleep-in-atomic bug in f2fs_trace_pid Message-ID: <8e7328d3-2df3-e79d-9558-a9b3713751c4@gmail.com> Date: Tue, 12 Dec 2017 08:59:29 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.2.0 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 357 Lines: 13 According to fs/f2fs/trace.c, the kernel module may sleep under a spinlock. The function call path is: f2fs_trace_pid (acquire the spinlock) f2fs_radix_tree_insert cond_resched --> may sleep I do not find a good way to fix it, so I only report. This possible bug is found by my static analysis tool (DSAC) and my code review. Thanks, Jia-Ju Bai