summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIlya Dryomov <idryomov@gmail.com>2020-03-16 19:16:28 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2020-04-23 11:37:53 +0300
commit8d2e626d898c6179c3d264ac3e6eb6e8fd2b232f (patch)
tree9e5836d4e76ee64e15ba3aa34df486526427e3cd
parenta62bf759cfae86c5db2a38f5baf2270046c5a7d6 (diff)
downloadlinux-8d2e626d898c6179c3d264ac3e6eb6e8fd2b232f.tar.xz
rbd: don't test rbd_dev->opts in rbd_dev_image_release()
commit b8776051529230f76e464d5ffc5d1cf8465576bf upstream. rbd_dev->opts is used to distinguish between the image that is being mapped and a parent. However, because we no longer establish watch for read-only mappings, this test is imprecise and results in unnecessary rbd_unregister_watch() calls. Make it consistent with need_watch in rbd_dev_image_probe(). Fixes: b9ef2b8858a0 ("rbd: don't establish watch for read-only mappings") Signed-off-by: Ilya Dryomov <idryomov@gmail.com> Reviewed-by: Jason Dillaman <dillaman@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/block/rbd.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c
index 5bf2456aeb9e..27b80df49ba2 100644
--- a/drivers/block/rbd.c
+++ b/drivers/block/rbd.c
@@ -6955,7 +6955,7 @@ static void rbd_print_dne(struct rbd_device *rbd_dev, bool is_snap)
static void rbd_dev_image_release(struct rbd_device *rbd_dev)
{
- if (rbd_dev->opts)
+ if (!rbd_is_ro(rbd_dev))
rbd_unregister_watch(rbd_dev);
rbd_dev_unprobe(rbd_dev);