1
0
Fork 0

dm writecache: remove BUG() and fail gracefully instead

commit 857c4c0a8b upstream.

Building on arch/s390/ results in this build error:

cc1: some warnings being treated as errors
../drivers/md/dm-writecache.c: In function 'persistent_memory_claim':
../drivers/md/dm-writecache.c:323:1: error: no return statement in function returning non-void [-Werror=return-type]

Fix this by replacing the BUG() with an -EOPNOTSUPP return.

Fixes: 48debafe4f ("dm: add writecache target")
Reported-by: Randy Dunlap <rdunlap@infradead.org>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5.4-rM2-2.2.x-imx-squashed
Mike Snitzer 2020-11-13 14:52:28 -08:00 committed by Greg Kroah-Hartman
parent 8e2c50315f
commit b9df537e5f
1 changed files with 1 additions and 1 deletions

View File

@ -316,7 +316,7 @@ err1:
#else
static int persistent_memory_claim(struct dm_writecache *wc)
{
BUG();
return -EOPNOTSUPP;
}
#endif