From: Bob Glossman Date: Sun, 27 Apr 2014 17:07:02 +0000 (-0400) Subject: staging/lustre/lloop: avoid panic during blockdev_info X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=4de665c1b308c256c0c32f950afe350b8c153583;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git staging/lustre/lloop: avoid panic during blockdev_info Change the LL_IOC_LLOOP_INFO ioctl in the lustre lloop device driver to return an error instead of causing panics with LASSERT(). Signed-off-by: Bob Glossman Reviewed-on: http://review.whamcloud.com/9888 Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-4863 Reviewed-by: Nathaniel Clark Reviewed-by: Andreas Dilger Signed-off-by: Oleg Drokin Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/lustre/lustre/llite/lloop.c b/drivers/staging/lustre/lustre/llite/lloop.c index f78eda235c7a..437adaff0c0a 100644 --- a/drivers/staging/lustre/lustre/llite/lloop.c +++ b/drivers/staging/lustre/lustre/llite/lloop.c @@ -624,7 +624,10 @@ static int lo_ioctl(struct block_device *bdev, fmode_t mode, case LL_IOC_LLOOP_INFO: { struct lu_fid fid; - LASSERT(lo->lo_backing_file != NULL); + if (lo->lo_backing_file == NULL) { + err = -ENOENT; + break; + } if (inode == NULL) inode = lo->lo_backing_file->f_dentry->d_inode; if (lo->lo_state == LLOOP_BOUND)