mirror of
https://github.com/ceph/ceph
synced 2024-12-18 17:37:38 +00:00
client: double mount returns -EISCONN
Change error code from -EDOM to -EISCONN when mounting an already mounted ceph_mount_info instance. The current convention is to return -ENOTCONN when using the libcephfs interface in an unmounted state. Signed-off-by: Noah Watkins <noahwatkins@gmail.com>
This commit is contained in:
parent
1152656c62
commit
f1eef53200
@ -67,7 +67,7 @@ public:
|
||||
int ret;
|
||||
|
||||
if (mounted)
|
||||
return -EDOM;
|
||||
return -EISCONN;
|
||||
|
||||
common_init_finish(cct);
|
||||
|
||||
|
@ -68,6 +68,17 @@ TEST(LibCephFS, Mount_non_exist) {
|
||||
ASSERT_NE(0, ceph_mount(cmount, "/non-exist"));
|
||||
}
|
||||
|
||||
TEST(LibCephFS, Mount_double) {
|
||||
|
||||
struct ceph_mount_info *cmount;
|
||||
|
||||
ASSERT_EQ(0, ceph_create(&cmount, NULL));
|
||||
ASSERT_EQ(0, ceph_conf_read_file(cmount, NULL));
|
||||
ASSERT_EQ(0, ceph_mount(cmount, "/"));
|
||||
ASSERT_EQ(-EISCONN, ceph_mount(cmount, "/"));
|
||||
ceph_shutdown(cmount);
|
||||
}
|
||||
|
||||
TEST(LibCephFS, Mount) {
|
||||
struct ceph_mount_info *cmount;
|
||||
ASSERT_EQ(ceph_create(&cmount, NULL), 0);
|
||||
|
Loading…
Reference in New Issue
Block a user