rbd: don't retry watch reregistration if header object is gone
authorIlya Dryomov <idryomov@gmail.com>
Thu, 29 Sep 2016 12:23:12 +0000 (14:23 +0200)
committerIlya Dryomov <idryomov@gmail.com>
Sat, 15 Oct 2016 21:22:09 +0000 (23:22 +0200)
If the header object gets deleted (perhaps along with the entire pool),
there is no point in attempting to reregister the watch.  Treat this
the same as blacklisting: fail all pending and new I/Os requiring the
lock.

Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
drivers/block/rbd.c

index 633e8c2ea12019d85eb2e2dbd6d6cf5b10932ecf..7b274ff4632c6944e32b95d605ee9aa9769f7082 100644 (file)
@@ -3944,7 +3944,7 @@ static void rbd_reregister_watch(struct work_struct *work)
        ret = __rbd_register_watch(rbd_dev);
        if (ret) {
                rbd_warn(rbd_dev, "failed to reregister watch: %d", ret);
-               if (ret == -EBLACKLISTED) {
+               if (ret == -EBLACKLISTED || ret == -ENOENT) {
                        set_bit(RBD_DEV_FLAG_BLACKLISTED, &rbd_dev->flags);
                        need_to_wake = true;
                } else {