Project

General

Profile

Bug #41337

Updated by Patrick Donnelly over 1 year ago

Instead of a traceback, raise a clear error and log error message when FS subvolume and subvolume group is created with an invalid pool layout,

<pre>

```
ceph fs subvolume create ocsci-cephfs csi-vol-d9da6697-bf6f-11e9-ac31-0a580a810209 1073741824 --group_name csi --mode 777 -m 172.30.253.231:6789,172.30.37.131:6789,172.30.75.64:6789 -c /etc/ceph/ceph.conf -n client.admin --keyfile=***stripped*** --pool_layout ocsci-cephfs]: exit status 22: Error EINVAL: Traceback (most recent call last):
File "/usr/share/ceph/mgr/mgr_module.py", line 909, in _handle_command
return self.handle_command(inbuf, cmd)
File "/usr/share/ceph/mgr/volumes/module.py", line 182, in handle_command
return handler(inbuf, cmd)
File "/usr/share/ceph/mgr/volumes/module.py", line 231, in _cmd_fs_subvolume_create
return self.vc.create_subvolume(vol_name, sub_name, group_name, size, mode=mode, pool=pool_layout)
File "/usr/share/ceph/mgr/volumes/fs/volume.py", line 194, in create_subvolume
sv.create_subvolume(spec, size, pool=pool, mode=self.octal_str_to_decimal_int(mode))
File "/usr/share/ceph/mgr/volumes/fs/subvolume.py", line 86, in create_subvolume
self.fs.setxattr(subvolpath, 'ceph.dir.layout.pool', pool.encode('utf-8'), 0)
File "cephfs.pyx", line 1087, in cephfs.LibCephFS.setxattr (/home/jenkins-build/build/workspace/ceph-build/ARCH/x86_64/AVAILABLE_ARCH/x86_64/AVAILABLE_DIST/centos7/DIST/centos7/MACHINE_SIZE/huge/release/14.2.2/rpm/el7/BUILD/ceph-14.2.2/build/src/pybind/cephfs/pyrex/cephfs.c:11862)
InvalidValue: [Errno 22] error in setxattr
</pre> ```

Back