fuse: avoid scheduling while atomic
authorMiklos Szeredi <mszeredi@suse.cz>
Mon, 7 Jul 2014 13:28:51 +0000 (15:28 +0200)
committerMiklos Szeredi <mszeredi@suse.cz>
Mon, 7 Jul 2014 13:28:51 +0000 (15:28 +0200)
commitc55a01d360afafcd52bc405c044a6ebf5de436d5
treef3aee71085c2c831563e06f0c78dfc21b931e342
parent233a01fa9c4c7c41238537e8db8434667ff28a2f
fuse: avoid scheduling while atomic

As reported by Richard Sharpe, an attempt to use fuse_notify_inval_entry()
triggers complains about scheduling while atomic:

  BUG: scheduling while atomic: fuse.hf/13976/0x10000001

This happens because fuse_notify_inval_entry() attempts to allocate memory
with GFP_KERNEL, holding "struct fuse_copy_state" mapped by kmap_atomic().

Introduced by commit 58bda1da4b3c "fuse/dev: use atomic maps"

Fix by moving the map/unmap to just cover the actual memcpy operation.

Original patch from Maxim Patlasov <mpatlasov@parallels.com>

Reported-by: Richard Sharpe <realrichardsharpe@gmail.com>
Signed-off-by: Miklos Szeredi <mszeredi@suse.cz>
Cc: <stable@vger.kernel.org> # v3.15+
fs/fuse/dev.c