]> git.baikalelectronics.ru Git - kernel.git/commit
ext2: fix sleeping in atomic bugs on error
authorDan Carpenter <dan.carpenter@oracle.com>
Tue, 21 Sep 2021 20:32:33 +0000 (23:32 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 9 Oct 2021 12:39:49 +0000 (14:39 +0200)
commit80c1bf1fb1220d6d38a6752cbe35566ae92a4d6d
tree0f78b146ea7babc911fe49b43c36cc89e1f6108a
parentd805b6646b7b34d4293992ad76581338c977ba6f
ext2: fix sleeping in atomic bugs on error

[ Upstream commit 372d1f3e1bfede719864d0d1fbf3146b1e638c88 ]

The ext2_error() function syncs the filesystem so it sleeps.  The caller
is holding a spinlock so it's not allowed to sleep.

   ext2_statfs() <- disables preempt
   -> ext2_count_free_blocks()
      -> ext2_get_group_desc()

Fix this by using WARN() to print an error message and a stack trace
instead of using ext2_error().

Link: https://lore.kernel.org/r/20210921203233.GA16529@kili
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: Sasha Levin <sashal@kernel.org>
fs/ext2/balloc.c