drivers/cephfs: log an error if RO access is used and it's unavailable

Read-only (RO) access was introduced in Ceph version 10.2.3 (Jewel). If
RO access is being used on a lower version, (also) log an error in
response.

Change-Id: I8c1a735c52054b545524f809cbc35d7a7a39a645
Signed-off-by: Rishabh Dave <ridave@redhat.com>
This commit is contained in:
Rishabh Dave 2018-01-30 15:48:56 +05:30
parent 4adbf82fd3
commit ad171147ff
1 changed files with 3 additions and 2 deletions

View File

@ -363,12 +363,13 @@ class NativeProtocolHelper(ganesha.NASHelperBase):
ceph_auth_id)
raise exception.InvalidInput(message=error_message)
# TODO(rraja): Log the Ceph point release version, once available, in
# which the volume client can enable read-only access.
if not getattr(self.volume_client, 'version', None):
if access['access_level'] == constants.ACCESS_LEVEL_RO:
LOG.error("Need python-cephfs package version 10.2.3 or "
"greater to enable read-only access.")
raise exception.InvalidShareAccessLevel(
level=constants.ACCESS_LEVEL_RO)
auth_result = self.volume_client.authorize(
cephfs_share_path(share), ceph_auth_id)
else: