diff options
author | Noah Watkins <noahwatkins@gmail.com> | 2013-01-07 15:47:38 -0800 |
---|---|---|
committer | Noah Watkins <noahwatkins@gmail.com> | 2013-01-07 15:49:52 -0800 |
commit | 5c58aa96e4cd72f8be2fdbfc4cbb404aa49ec25c (patch) | |
tree | 6a2c4f913a1043b957e1cbb740edcf3fb75587af /src/libcephfs.cc | |
parent | c41210934c600d76011a7557e2f61164d80fa967 (diff) | |
download | ceph-5c58aa96e4cd72f8be2fdbfc4cbb404aa49ec25c.tar.gz |
libcephfs: return -ENOTCONN when call unmounted
Adds -ENOTCONN return value for stat, fchmod, fchown, lchown.
Signed-off-by: Noah Watkins <noahwatkins@gmail.com>
Diffstat (limited to 'src/libcephfs.cc')
-rw-r--r-- | src/libcephfs.cc | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/libcephfs.cc b/src/libcephfs.cc index e3f54508013..8b51ab93fcc 100644 --- a/src/libcephfs.cc +++ b/src/libcephfs.cc @@ -477,6 +477,8 @@ extern "C" int ceph_symlink(struct ceph_mount_info *cmount, const char *existing extern "C" int ceph_stat(struct ceph_mount_info *cmount, const char *path, struct stat *stbuf) { + if (!cmount->is_mounted()) + return -ENOTCONN; return cmount->get_client()->stat(path, stbuf); } @@ -562,6 +564,8 @@ extern "C" int ceph_chmod(struct ceph_mount_info *cmount, const char *path, mode } extern "C" int ceph_fchmod(struct ceph_mount_info *cmount, int fd, mode_t mode) { + if (!cmount->is_mounted()) + return -ENOTCONN; return cmount->get_client()->fchmod(fd, mode); } extern "C" int ceph_chown(struct ceph_mount_info *cmount, const char *path, @@ -574,11 +578,15 @@ extern "C" int ceph_chown(struct ceph_mount_info *cmount, const char *path, extern "C" int ceph_fchown(struct ceph_mount_info *cmount, int fd, uid_t uid, gid_t gid) { + if (!cmount->is_mounted()) + return -ENOTCONN; return cmount->get_client()->fchown(fd, uid, gid); } extern "C" int ceph_lchown(struct ceph_mount_info *cmount, const char *path, uid_t uid, gid_t gid) { + if (!cmount->is_mounted()) + return -ENOTCONN; return cmount->get_client()->lchown(path, uid, gid); } |