Patrick Donnelly [Fri, 15 Jan 2021 03:55:43 +0000 (19:55 -0800)]
mds: fix alternate_name durability
This is a collection of fixes to Xiubo's prior work. Namely:
- Add new mds_alternate_name_max option to limit the size of
alternate_name. Otherwise a Client could trick the MDS into creating
an alternate_name of any size!
- Clean up how alternate_name is assigned to CDentry. In the general
case, this should be assigned as part of creating the dentry. We want
this value to be immutable for the life of the dentry. Even for the
very special case of rename(2) where the destination dentry already
exists. We explicitly check (after discussion with Jeff) that the
target dentry alternate_name already matches what the rename RPC is
giving.
- The MDS is now properly journaling the alternate_name.
- The MDS rejoin phase is properly transmitting each dentry's
alternate_name. I've discovered that this MMDSCacheRejoin message
actually wasn't versioned which I've raised in a tracker [1]. In the
mean time, we'll just bump CEPH_MDS_PROTOCOL as usual.
[1] https://tracker.ceph.com/issues/48886
Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>
Xiubo Li [Mon, 21 Sep 2020 04:55:31 +0000 (12:55 +0800)]
mds: add alternate_name feature support for dentries
This will support the "alternate_name" filename support, and will save
an alternate name for each dentry. This alternate name is not used in
path lookup or for any other usual file system purpose. The name is
simply an added blob of metadata on the dentry that is distributed to
clients so that "long" file names may be supported for clients which
require them. In the case of an fscrypt enhanced kernel mount driver,
the long name may be the cyphertext (exceeding FILENAME_MAX) of a long
file name.
Because this affects only files with long file names, the use of this
feature should be rare but could be common for some unusual
applications.
The client mount should check the CEPHFS_FEATURE_ALTERNATE_NAME feature
bit first to check whether the MDS has support for this feature or not.
The alternate_name is transmitted as part of the message payload in
MClientRequest when setting the alternate_name. The LeaseStat structure
in MClientReply contains the alternate_name.
When executing a metadata mutation RPC, the client will set the
alternate_name (if it exists) as part of the operation. The MDS will
pick that up and set it on the new or mutated dentry.
Fixes: https://tracker.ceph.com/issues/47162 Signed-off-by: Xiubo Li <xiubli@redhat.com> Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>
Xiubo Li [Wed, 23 Sep 2020 02:54:34 +0000 (10:54 +0800)]
mds: add new CDentry tags support
This will add new tag 'i' for inode and new tag 'l' for remote link
for the CDentry. And at the same time will add one proper dentry
version, which will be helpful to add new features/members in future
for the CDentry.
Fixes: https://tracker.ceph.com/issues/47162 Signed-off-by: Xiubo Li <xiubli@redhat.com>
Kefu Chai [Tue, 12 Jan 2021 14:24:42 +0000 (22:24 +0800)]
doc/_ext: parse prefix and args for command signature
unlike the commands defined by C++, the commands defined by python
now uses "prefix" and "args" properties of elements in COMMAND class
attribute to define their command and arguments. the "cmd" property is
still available for the ceph CLI.
but the ceph_command sphinx extension should now use "prefix" and "args"
for printing out the usage of commands implemented using python. in
this change, the extension is updated to read "prefix" and "args"
properties of command defined by python modules.
peng jiaqi [Tue, 5 Jan 2021 03:15:26 +0000 (11:15 +0800)]
mgr: fix deadlock in ActivePyModules::get_osdmap()
In function "ActivePyModules::get_osdmap()", We do not read or write to
object "ActivePyModules", so it is safe to delete lock
"ActivePyModules::lock", and it can avoid other thread waiting for lock
"ActivePyModules::lock"
Kefu Chai [Sun, 27 Dec 2020 14:42:33 +0000 (22:42 +0800)]
pybind/mgr/mgr_module: cast string to enum when collecting kwargs
as the parameters of handlers are properly typed, they are expecting
enum parameter, let's cast string parameter to enum if the callee claims
that it wants an enum.
Kefu Chai [Wed, 13 Jan 2021 11:28:48 +0000 (19:28 +0800)]
pybind/mgr/mgr_module: preserve the signature of wrapped func
before this change, the annotations of the func wrapped by
CLICheckNonemptyFileInput and returns_command_result are lost after being
wrapped with this decorator. after this change, the parameter annotations
are preserved. these annotations are used for generating the argdesc in a
later commit.
Kefu Chai [Fri, 15 Jan 2021 01:27:26 +0000 (09:27 +0800)]
mgr/cephadm: s/yield_fixture/fixture/
silences pytest warning. it complained:`
1: cephadm/tests/fixtures.py:68
1: /var/ssd/ceph/src/pybind/mgr/cephadm/tests/fixtures.py:68: PytestDeprecationWarning: @pytest.yield_fixture is deprecated.
1: Use @pytest.fixture instead; they are the same.
1: @pytest.yield_fixture()
Patrick Donnelly [Thu, 14 Jan 2021 16:09:01 +0000 (08:09 -0800)]
Merge PR #34858 into master
* refs/pull/34858/head:
mds: do not allow the service to run on Windows
win32*.sh: fix SKIP_TESTS flag
include/win32/win32_errno:h Add missing include
client: Port CephFS client to Windows
Reviewed-by: Patrick Donnelly <pdonnell@redhat.com> Reviewed-by: Jeff Layton <jlayton@redhat.com>
Jason Dillaman [Wed, 13 Jan 2021 18:50:41 +0000 (13:50 -0500)]
librbd/migration: add support for reading from QCOW2 snapshots
Tweak the IO read path to now utilize the L1 table associated with
the specified snapshot id. This will cause the IO to properly read
from the specific snapshot.
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
Jason Dillaman [Wed, 13 Jan 2021 02:19:22 +0000 (21:19 -0500)]
librbd/migration: decode QCOW2 snapshot metadata during open
This will allow the migration state machine to build matching RBD
snapshots to mimic the QCOW2 snapshots. The next commit will add the
ability to read from a snapshot.
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
Jason Dillaman [Tue, 12 Jan 2021 20:35:49 +0000 (15:35 -0500)]
librbd/migration: basic QCOW2 format handler
The initial implementation does not support backing files, compression,
snapshots, (deprecated) encryption, external data files, nor L2 subcluster
allocation. The former three features will be added in a future commit.
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
Jason Dillaman [Tue, 12 Jan 2021 03:12:27 +0000 (22:12 -0500)]
librbd/migration: basic QCOW v1 format handler
The initial implementation does not support backing files, compression, nor
(deprecated) encryption. The former two features will be added in a future commit.
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
Kefu Chai [Sun, 27 Dec 2020 04:44:39 +0000 (12:44 +0800)]
pybind/ceph_argparse: add argdesc() method to type classes
so they can be used to build argdesc from method annotations, these
argdesc strings will be consumed by ceph CLI to do client-side
validation of command arguments.
Ronen Friedman [Thu, 14 Jan 2021 08:02:19 +0000 (10:02 +0200)]
os/bluestore: fixing a dangling pointer
... and silencing compiler warnings:
Building CXX object src/os/CMakeFiles/os.dir/bluestore/BlueStore.cc.o
../src/os/bluestore/BlueStore.cc:8603:25: warning: object backing the pointer will be destroyed at the end of the full-expression [-Wdangling-gsl]
const char *c = it->key().c_str();
^~~~~~~~~
../src/os/bluestore/BlueStore.cc:8623:25: warning: object backing the pointer will be destroyed at the end of the full-expression [-Wdangling-gsl]
const char* c = it->key().c_str();
^~~~~~~~~
(reverting a minor part of ifed01)