]> 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)
committerJan Kara <jack@suse.cz>
Wed, 22 Sep 2021 11:05:23 +0000 (13:05 +0200)
commit4f448e83e83280c9b05dd9f7451a04904fbdef74
tree4d8253cbd68ebe7da45f4ca634cce3398c0e70f8
parent1e1a3a740da5cefe1cf826fe3de6d579f157d246
ext2: fix sleeping in atomic bugs on error

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>
fs/ext2/balloc.c