centos/redhat kernel 支持rbd模块(el7)

el内核3.10.0-123.el7.x86_64默认不支持rbd模块,需要将rbd模块编译进去。

1 需要将config的配置项打开。如下:

[root@66 SOURCES]# cat kernel-3.10.0-x86_64.config |grep CEPH
CONFIG_CEPH_LIB=m
CONFIG_CEPH_LIB_PRETTYDEBUG=y
CONFIG_CEPH_LIB_USE_DNS_RESOLVER=y
# CONFIG_CEPH_FS is not set
[root@66 SOURCES]# cat kernel-3.10.0-x86_64.config |grep RBD
# CONFIG_BLK_DEV_DRBD is not set
CONFIG_BLK_DEV_RBD=m

2 编译过程可以选择只编译模块,也可以将kernel重新编译。模块编译见本博客相关内容,这里采用kernel重新编译,编译过程中出现以下问题:

<i> drivers/block/rbd.c error: bio_list may be used uninitialized in this function </i>

经分析后,给内核该文件打了个patch

@@ -2171,9 +2171,9 @@ static int rbd_img_request_fill(struct r
struct rbd_obj_request *obj_request = NULL;
struct rbd_obj_request *next_obj_request;
bool write_request = img_request_write_test(img_request);
-    struct bio *bio_list;
+    struct bio *bio_list = NULL;
unsigned int bio_offset = 0;
-    struct page **pages;
+    struct page **pages = NULL;
u64 img_offset;
u64 resid;

发表评论

您的电子邮箱地址不会被公开。