Loading Documentation/filesystems/ceph.rst +3 −3 Original line number Diff line number Diff line Loading @@ -163,14 +163,14 @@ Mount Options to the default VFS implementation if this option is used. recover_session=<no|clean> Set auto reconnect mode in the case where the client is blacklisted. The Set auto reconnect mode in the case where the client is blocklisted. The available modes are "no" and "clean". The default is "no". * no: never attempt to reconnect when client detects that it has been blacklisted. Operations will generally fail after being blacklisted. blocklisted. Operations will generally fail after being blocklisted. * clean: client reconnects to the ceph cluster automatically when it detects that it has been blacklisted. During reconnect, client drops detects that it has been blocklisted. During reconnect, client drops dirty data/metadata, invalidates page caches and writable file handles. After reconnect, file locks become stale because the MDS loses track of them. If an inode contains any stale file locks, read/write on the Loading drivers/block/rbd.c +4 −4 Original line number Diff line number Diff line Loading @@ -4010,10 +4010,10 @@ static int rbd_try_lock(struct rbd_device *rbd_dev) rbd_warn(rbd_dev, "breaking header lock owned by %s%llu", ENTITY_NAME(lockers[0].id.name)); ret = ceph_monc_blacklist_add(&client->monc, ret = ceph_monc_blocklist_add(&client->monc, &lockers[0].info.addr); if (ret) { rbd_warn(rbd_dev, "blacklist of %s%llu failed: %d", rbd_warn(rbd_dev, "blocklist of %s%llu failed: %d", ENTITY_NAME(lockers[0].id.name), ret); goto out; } Loading Loading @@ -4077,7 +4077,7 @@ static int rbd_try_acquire_lock(struct rbd_device *rbd_dev) ret = rbd_try_lock(rbd_dev); if (ret < 0) { rbd_warn(rbd_dev, "failed to lock header: %d", ret); if (ret == -EBLACKLISTED) if (ret == -EBLOCKLISTED) goto out; ret = 1; /* request lock anyway */ Loading Loading @@ -4613,7 +4613,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 && ret != -ENOENT) { if (ret != -EBLOCKLISTED && ret != -ENOENT) { queue_delayed_work(rbd_dev->task_wq, &rbd_dev->watch_dwork, RBD_RETRY_DELAY); Loading fs/ceph/addr.c +12 −12 Original line number Diff line number Diff line Loading @@ -271,8 +271,8 @@ static int ceph_do_readpage(struct file *filp, struct page *page) if (err < 0) { SetPageError(page); ceph_fscache_readpage_cancel(inode, page); if (err == -EBLACKLISTED) fsc->blacklisted = true; if (err == -EBLOCKLISTED) fsc->blocklisted = true; goto out; } if (err < PAGE_SIZE) Loading Loading @@ -312,8 +312,8 @@ static void finish_read(struct ceph_osd_request *req) int i; dout("finish_read %p req %p rc %d bytes %d\n", inode, req, rc, bytes); if (rc == -EBLACKLISTED) ceph_inode_to_client(inode)->blacklisted = true; if (rc == -EBLOCKLISTED) ceph_inode_to_client(inode)->blocklisted = true; /* unlock all pages, zeroing any data we didn't read */ osd_data = osd_req_op_extent_osd_data(req, 0); Loading Loading @@ -737,8 +737,8 @@ static int writepage_nounlock(struct page *page, struct writeback_control *wbc) end_page_writeback(page); return err; } if (err == -EBLACKLISTED) fsc->blacklisted = true; if (err == -EBLOCKLISTED) fsc->blocklisted = true; dout("writepage setting page/mapping error %d %p\n", err, page); mapping_set_error(&inode->i_data, err); Loading Loading @@ -801,8 +801,8 @@ static void writepages_finish(struct ceph_osd_request *req) if (rc < 0) { mapping_set_error(mapping, rc); ceph_set_error_write(ci); if (rc == -EBLACKLISTED) fsc->blacklisted = true; if (rc == -EBLOCKLISTED) fsc->blocklisted = true; } else { ceph_clear_error_write(ci); } Loading Loading @@ -2038,16 +2038,16 @@ static int __ceph_pool_perm_get(struct ceph_inode_info *ci, if (err >= 0 || err == -ENOENT) have |= POOL_READ; else if (err != -EPERM) { if (err == -EBLACKLISTED) fsc->blacklisted = true; if (err == -EBLOCKLISTED) fsc->blocklisted = true; goto out_unlock; } if (err2 == 0 || err2 == -EEXIST) have |= POOL_WRITE; else if (err2 != -EPERM) { if (err2 == -EBLACKLISTED) fsc->blacklisted = true; if (err2 == -EBLOCKLISTED) fsc->blocklisted = true; err = err2; goto out_unlock; } Loading fs/ceph/file.c +2 −2 Original line number Diff line number Diff line Loading @@ -933,8 +933,8 @@ static ssize_t ceph_sync_read(struct kiocb *iocb, struct iov_iter *to, ceph_release_page_vector(pages, num_pages); if (ret < 0) { if (ret == -EBLACKLISTED) fsc->blacklisted = true; if (ret == -EBLOCKLISTED) fsc->blocklisted = true; break; } Loading fs/ceph/mds_client.c +8 −8 Original line number Diff line number Diff line Loading @@ -3303,7 +3303,7 @@ static void handle_forward(struct ceph_mds_client *mdsc, } static int __decode_session_metadata(void **p, void *end, bool *blacklisted) bool *blocklisted) { /* map<string,string> */ u32 n; Loading @@ -3318,7 +3318,7 @@ static int __decode_session_metadata(void **p, void *end, ceph_decode_32_safe(p, end, len, bad); ceph_decode_need(p, end, len, bad); if (err_str && strnstr(*p, "blacklisted", len)) *blacklisted = true; *blocklisted = true; *p += len; } return 0; Loading @@ -3341,7 +3341,7 @@ static void handle_session(struct ceph_mds_session *session, u32 op; u64 seq, features = 0; int wake = 0; bool blacklisted = false; bool blocklisted = false; /* decode */ ceph_decode_need(&p, end, sizeof(*h), bad); Loading @@ -3354,7 +3354,7 @@ static void handle_session(struct ceph_mds_session *session, if (msg_version >= 3) { u32 len; /* version >= 2, metadata */ if (__decode_session_metadata(&p, end, &blacklisted) < 0) if (__decode_session_metadata(&p, end, &blocklisted) < 0) goto bad; /* version >= 3, feature bits */ ceph_decode_32_safe(&p, end, len, bad); Loading Loading @@ -3445,8 +3445,8 @@ static void handle_session(struct ceph_mds_session *session, session->s_state = CEPH_MDS_SESSION_REJECTED; cleanup_session_requests(mdsc, session); remove_session_caps(session); if (blacklisted) mdsc->fsc->blacklisted = true; if (blocklisted) mdsc->fsc->blocklisted = true; wake = 2; /* for good measure */ break; Loading Loading @@ -4367,14 +4367,14 @@ static void maybe_recover_session(struct ceph_mds_client *mdsc) if (READ_ONCE(fsc->mount_state) != CEPH_MOUNT_MOUNTED) return; if (!READ_ONCE(fsc->blacklisted)) if (!READ_ONCE(fsc->blocklisted)) return; if (fsc->last_auto_reconnect && time_before(jiffies, fsc->last_auto_reconnect + HZ * 60 * 30)) return; pr_info("auto reconnect after blacklisted\n"); pr_info("auto reconnect after blocklisted\n"); fsc->last_auto_reconnect = jiffies; ceph_force_reconnect(fsc->sb); } Loading Loading
Documentation/filesystems/ceph.rst +3 −3 Original line number Diff line number Diff line Loading @@ -163,14 +163,14 @@ Mount Options to the default VFS implementation if this option is used. recover_session=<no|clean> Set auto reconnect mode in the case where the client is blacklisted. The Set auto reconnect mode in the case where the client is blocklisted. The available modes are "no" and "clean". The default is "no". * no: never attempt to reconnect when client detects that it has been blacklisted. Operations will generally fail after being blacklisted. blocklisted. Operations will generally fail after being blocklisted. * clean: client reconnects to the ceph cluster automatically when it detects that it has been blacklisted. During reconnect, client drops detects that it has been blocklisted. During reconnect, client drops dirty data/metadata, invalidates page caches and writable file handles. After reconnect, file locks become stale because the MDS loses track of them. If an inode contains any stale file locks, read/write on the Loading
drivers/block/rbd.c +4 −4 Original line number Diff line number Diff line Loading @@ -4010,10 +4010,10 @@ static int rbd_try_lock(struct rbd_device *rbd_dev) rbd_warn(rbd_dev, "breaking header lock owned by %s%llu", ENTITY_NAME(lockers[0].id.name)); ret = ceph_monc_blacklist_add(&client->monc, ret = ceph_monc_blocklist_add(&client->monc, &lockers[0].info.addr); if (ret) { rbd_warn(rbd_dev, "blacklist of %s%llu failed: %d", rbd_warn(rbd_dev, "blocklist of %s%llu failed: %d", ENTITY_NAME(lockers[0].id.name), ret); goto out; } Loading Loading @@ -4077,7 +4077,7 @@ static int rbd_try_acquire_lock(struct rbd_device *rbd_dev) ret = rbd_try_lock(rbd_dev); if (ret < 0) { rbd_warn(rbd_dev, "failed to lock header: %d", ret); if (ret == -EBLACKLISTED) if (ret == -EBLOCKLISTED) goto out; ret = 1; /* request lock anyway */ Loading Loading @@ -4613,7 +4613,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 && ret != -ENOENT) { if (ret != -EBLOCKLISTED && ret != -ENOENT) { queue_delayed_work(rbd_dev->task_wq, &rbd_dev->watch_dwork, RBD_RETRY_DELAY); Loading
fs/ceph/addr.c +12 −12 Original line number Diff line number Diff line Loading @@ -271,8 +271,8 @@ static int ceph_do_readpage(struct file *filp, struct page *page) if (err < 0) { SetPageError(page); ceph_fscache_readpage_cancel(inode, page); if (err == -EBLACKLISTED) fsc->blacklisted = true; if (err == -EBLOCKLISTED) fsc->blocklisted = true; goto out; } if (err < PAGE_SIZE) Loading Loading @@ -312,8 +312,8 @@ static void finish_read(struct ceph_osd_request *req) int i; dout("finish_read %p req %p rc %d bytes %d\n", inode, req, rc, bytes); if (rc == -EBLACKLISTED) ceph_inode_to_client(inode)->blacklisted = true; if (rc == -EBLOCKLISTED) ceph_inode_to_client(inode)->blocklisted = true; /* unlock all pages, zeroing any data we didn't read */ osd_data = osd_req_op_extent_osd_data(req, 0); Loading Loading @@ -737,8 +737,8 @@ static int writepage_nounlock(struct page *page, struct writeback_control *wbc) end_page_writeback(page); return err; } if (err == -EBLACKLISTED) fsc->blacklisted = true; if (err == -EBLOCKLISTED) fsc->blocklisted = true; dout("writepage setting page/mapping error %d %p\n", err, page); mapping_set_error(&inode->i_data, err); Loading Loading @@ -801,8 +801,8 @@ static void writepages_finish(struct ceph_osd_request *req) if (rc < 0) { mapping_set_error(mapping, rc); ceph_set_error_write(ci); if (rc == -EBLACKLISTED) fsc->blacklisted = true; if (rc == -EBLOCKLISTED) fsc->blocklisted = true; } else { ceph_clear_error_write(ci); } Loading Loading @@ -2038,16 +2038,16 @@ static int __ceph_pool_perm_get(struct ceph_inode_info *ci, if (err >= 0 || err == -ENOENT) have |= POOL_READ; else if (err != -EPERM) { if (err == -EBLACKLISTED) fsc->blacklisted = true; if (err == -EBLOCKLISTED) fsc->blocklisted = true; goto out_unlock; } if (err2 == 0 || err2 == -EEXIST) have |= POOL_WRITE; else if (err2 != -EPERM) { if (err2 == -EBLACKLISTED) fsc->blacklisted = true; if (err2 == -EBLOCKLISTED) fsc->blocklisted = true; err = err2; goto out_unlock; } Loading
fs/ceph/file.c +2 −2 Original line number Diff line number Diff line Loading @@ -933,8 +933,8 @@ static ssize_t ceph_sync_read(struct kiocb *iocb, struct iov_iter *to, ceph_release_page_vector(pages, num_pages); if (ret < 0) { if (ret == -EBLACKLISTED) fsc->blacklisted = true; if (ret == -EBLOCKLISTED) fsc->blocklisted = true; break; } Loading
fs/ceph/mds_client.c +8 −8 Original line number Diff line number Diff line Loading @@ -3303,7 +3303,7 @@ static void handle_forward(struct ceph_mds_client *mdsc, } static int __decode_session_metadata(void **p, void *end, bool *blacklisted) bool *blocklisted) { /* map<string,string> */ u32 n; Loading @@ -3318,7 +3318,7 @@ static int __decode_session_metadata(void **p, void *end, ceph_decode_32_safe(p, end, len, bad); ceph_decode_need(p, end, len, bad); if (err_str && strnstr(*p, "blacklisted", len)) *blacklisted = true; *blocklisted = true; *p += len; } return 0; Loading @@ -3341,7 +3341,7 @@ static void handle_session(struct ceph_mds_session *session, u32 op; u64 seq, features = 0; int wake = 0; bool blacklisted = false; bool blocklisted = false; /* decode */ ceph_decode_need(&p, end, sizeof(*h), bad); Loading @@ -3354,7 +3354,7 @@ static void handle_session(struct ceph_mds_session *session, if (msg_version >= 3) { u32 len; /* version >= 2, metadata */ if (__decode_session_metadata(&p, end, &blacklisted) < 0) if (__decode_session_metadata(&p, end, &blocklisted) < 0) goto bad; /* version >= 3, feature bits */ ceph_decode_32_safe(&p, end, len, bad); Loading Loading @@ -3445,8 +3445,8 @@ static void handle_session(struct ceph_mds_session *session, session->s_state = CEPH_MDS_SESSION_REJECTED; cleanup_session_requests(mdsc, session); remove_session_caps(session); if (blacklisted) mdsc->fsc->blacklisted = true; if (blocklisted) mdsc->fsc->blocklisted = true; wake = 2; /* for good measure */ break; Loading Loading @@ -4367,14 +4367,14 @@ static void maybe_recover_session(struct ceph_mds_client *mdsc) if (READ_ONCE(fsc->mount_state) != CEPH_MOUNT_MOUNTED) return; if (!READ_ONCE(fsc->blacklisted)) if (!READ_ONCE(fsc->blocklisted)) return; if (fsc->last_auto_reconnect && time_before(jiffies, fsc->last_auto_reconnect + HZ * 60 * 30)) return; pr_info("auto reconnect after blacklisted\n"); pr_info("auto reconnect after blocklisted\n"); fsc->last_auto_reconnect = jiffies; ceph_force_reconnect(fsc->sb); } Loading