From 5353deb0205d2dda6f1af5b07ee8d3963c5e9a29 Mon Sep 17 00:00:00 2001 From: Bob Glossman Date: Fri, 4 Apr 2014 14:21:28 -0700 Subject: [PATCH] LU-4863 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 Change-Id: Ib50afa94960dee6fb580038d6e96ea648252d9ea Reviewed-on: http://review.whamcloud.com/9888 Tested-by: Jenkins Tested-by: Maloo Reviewed-by: Nathaniel Clark Reviewed-by: Andreas Dilger --- lustre/llite/lloop.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lustre/llite/lloop.c b/lustre/llite/lloop.c index cef0de6..90bf646 100644 --- a/lustre/llite/lloop.c +++ b/lustre/llite/lloop.c @@ -645,7 +645,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) -- 1.8.3.1