Skip to content

Commit b877605

Browse files
committed
rbd: don't test rbd_dev->opts in rbd_dev_image_release()
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: b9ef2b8 ("rbd: don't establish watch for read-only mappings") Signed-off-by: Ilya Dryomov <[email protected]> Reviewed-by: Jason Dillaman <[email protected]>
1 parent 952c48b commit b877605

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/block/rbd.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6898,7 +6898,7 @@ static void rbd_print_dne(struct rbd_device *rbd_dev, bool is_snap)
68986898

68996899
static void rbd_dev_image_release(struct rbd_device *rbd_dev)
69006900
{
6901-
if (rbd_dev->opts)
6901+
if (!rbd_is_ro(rbd_dev))
69026902
rbd_unregister_watch(rbd_dev);
69036903

69046904
rbd_dev_unprobe(rbd_dev);

0 commit comments

Comments
 (0)